From owner-freebsd-ports@freebsd.org Fri Feb 22 13:39:27 2019 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3910814EBFD7 for ; Fri, 22 Feb 2019 13:39:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566B36D277; Fri, 22 Feb 2019 13:39:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x1MDdHAo035112 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 22 Feb 2019 15:39:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x1MDdHAo035112 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x1MDdHMk035111; Fri, 22 Feb 2019 15:39:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 22 Feb 2019 15:39:17 +0200 From: Konstantin Belousov To: =?utf-8?Q?T=C4=B3l?= Coosemans Cc: FreeBSD Ports ML Subject: Re: FreeCAD 0.17 && /lib//libgcc_s.so.1 Message-ID: <20190222133917.GZ2420@kib.kiev.ua> References: <416689e6-37f9-17ec-54d8-0d224c26f30f@pinyon.org> <20190217151604.GB68620@night.db.net> <20190221180515.39c79ce6@kalimero.tijl.coosemans.org> <092b17f0-6fbf-662e-1061-403442248abd@pinyon.org> <20190222140407.2145c11e@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190222140407.2145c11e@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2019 13:39:27 -0000 On Fri, Feb 22, 2019 at 02:04:07PM +0100, Tijl Coosemans wrote: > On Thu, 21 Feb 2019 10:53:00 -0700 "Russell L. Carter" > wrote: > > On 2/21/19 10:05 AM, Tijl Coosemans wrote: > >> On Sun, 17 Feb 2019 10:16:04 -0500 Diane Bruce wrote: > >>> On Sat, Feb 16, 2019 at 06:35:52PM -0700, Russell L. Carter wrote: > >>>> So I must dig deeper. Perhaps with rpaths interacting with the system > >>>> paths? > >>> > >>> You got it. ;) > >>> Except python doesn't have an rpath which is why this keeps coming > >>> up over and over again. > >> > >> Maybe we should just add the gcc rpaths to the python ports LDFLAGS > >> without depending on gcc. Then python should use gcc libgcc_s when > >> it exists and fall back to base system libgcc_s when it doesn't. > >> > >> Maybe we should compile *all* ports with gcc rpaths without depending > >> on gcc, just like we already compile everything with -fstack-protector > >> in LDFLAGS. > > > > I would like to briefly present the perspective from a user's POV. > > There is a large world wide population of scientific custom code > > users/coders who run on linux boxes in a wide variety of > > configurations. Almost none of that code will ever have a chance of > > ending up in /usr/ports, although there is nothing technically > > challenging about almost any of it (the porting process that is). So > > anytime any of those users wants to try running their non-ported > > scientific code, a large fraction of which contains python and/or > > gfortan code, they are going to hit the libgcc_s issue. Only a few of > > those people understand rpaths as well as I do (and I'm no expert), > > because it's never been their job. They probably struggle to figure > > out what question to ask, because, "libgcc_s? WTF?, this is python!" > > In addition, oftentimes people have sometimes big pipelines of > > different programs executing. So writing a shell script wrapper > > around each and every one of those custom programs... not going to > > happen. libmap.conf(5)? Not going to happen. Linux works out of the > > box. > > > > People like Steve Kargl and me are... puzzled at why FreeBSD would > > do this to itself. Having people writing and running custom > > opensource software on a performant opensource OS is **good**. We > > should be enabling them. > > If I were the lang/gcc maintainer this -rpath problem would be my number > one priority. The current maintainer has never proposed any solutions > and when I submit patches he always resists. I'm done wasting my time > fighting him. > > Then threads like this appear every few months. It's always the same > people that respond with the same wrong ideas and wrong solutions and > never providing patches. I always politely point out what's wrong with > their ideas and provide patches that do work. Then they respond with > the same wrong ideas without even trying my patches. You can see that > in this very thread. Rinse, repeat. > > It's a people problem, not a technical problem. My patches solve the > technical problem. I can't help it if people don't pick up the patches. Yes, we absolutely must avoid situation where two similar libraries (i.e. providing some subset of symbols from other) are linked into the same executing process. I think your patches would be a definitive improvement, esp. the part which makes libgfortran linking only as needed. For the other part, which makes the ports dso a priority over the base dso, I would exercise some more causion. For ports we know only about libgcc_s.so.1 which has the same name in base and in ports, other libraries in base should have libprivate suffix to not conflict, right ? What about openssl libraries ? I think such setup makes it easier for user to accidentaly break the system. She could install something manually (not from ports), or copy some file into /usr/local/lib, which conflicts with base and cause troubles. Do you agree that the ultimate and proper solution is to add missed symbols and versions to the base libgcc_s.so.1 ? IMO it is, and this thread started to show some work which might finally solve that. (But about as-needed for libgfortran see above). > > As for Linux, note that in theory the same problem also exists there. > It's just that most Linux distribution only provide one version of gcc. > FreeBSD provides multiple versions of multiple compilers and we allow > code compiled with different compilers to be linked together. Still, > with my patches it should all just work without -rpath. > > I can only recommend that you try the patches. Your Fortran/Python > pipeline will just work like it does on Linux. I've attached them once > more for your convenience. > Index: libexec/rc/rc.conf > =================================================================== > --- libexec/rc/rc.conf (revision 343935) > +++ libexec/rc/rc.conf (working copy) > @@ -636,14 +636,14 @@ linux_enable="NO" # Linux binary compatibility loaded > clear_tmp_enable="NO" # Clear /tmp at startup. > clear_tmp_X="YES" # Clear and recreate X11-related directories in /tmp > ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks > -ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg" > +ldconfig_paths="/usr/local/lib /usr/local/lib/compat/pkg /usr/lib /usr/lib/compat /lib" > # shared library search paths > ldconfig32_paths="/usr/lib32 /usr/lib32/compat" > # 32-bit compatibility shared library search paths > -ldconfigsoft_paths="/usr/libsoft /usr/libsoft/compat /usr/local/libsoft" > +ldconfigsoft_paths="/usr/local/libsoft /usr/libsoft /usr/libsoft/compat" > # soft float compatibility shared library search paths > # Note: temporarily with extra stuff for transition > -ldconfig_paths_aout="/usr/lib/compat/aout /usr/local/lib/aout" > +ldconfig_paths_aout="/usr/local/lib/aout /usr/lib/aout /usr/lib/compat/aout" > # a.out shared library search paths > ldconfig_local_dirs="/usr/local/libdata/ldconfig" > # Local directories with ldconfig configuration files. > Index: libexec/rc/rc.d/ldconfig > =================================================================== > --- libexec/rc/rc.d/ldconfig (revision 343935) > +++ libexec/rc/rc.d/ldconfig (working copy) > @@ -17,22 +17,23 @@ stop_cmd=":" > > ldconfig_start() > { > - local _files _ins > + local _files _ins _paths _LDC > > _ins= > ldconfig=${ldconfig_command} > checkyesno ldconfig_insecure && _ins="-i" > if [ -x "${ldconfig_command}" ]; then > - _LDC="/lib /usr/lib" > + _paths="" > for i in ${ldconfig_local_dirs}; do > if [ -d "${i}" ]; then > _files=`find ${i} -type f` > if [ -n "${_files}" ]; then > - ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`" > + _paths="${_paths} `cat ${_files} | sort -Vru`" > fi > fi > done > - for i in ${ldconfig_paths} /etc/ld-elf.so.conf; do > + _LDC="" > + for i in ${_paths} ${ldconfig_paths} /etc/ld-elf.so.conf; do > if [ -r "${i}" ]; then > _LDC="${_LDC} ${i}" > fi > @@ -42,16 +43,17 @@ ldconfig_start() > > case `sysctl -n hw.machine_arch` in > amd64|mips64|powerpc64) > + _paths="" > for i in ${ldconfig_local32_dirs}; do > if [ -d "${i}" ]; then > _files=`find ${i} -type f` > if [ -n "${_files}" ]; then > - ldconfig32_paths="${ldconfig32_paths} `cat ${_files} | sort -u`" > + _paths="${_paths} `cat ${_files} | sort -Vru`" > fi > fi > done > _LDC="" > - for i in ${ldconfig32_paths}; do > + for i in ${_paths} ${ldconfig32_paths}; do > if [ -r "${i}" ]; then > _LDC="${_LDC} ${i}" > fi > @@ -64,16 +66,17 @@ ldconfig_start() > > case `sysctl -n hw.machine_arch` in > armv[67]) > + _paths="" > for i in ${ldconfig_localsoft_dirs}; do > if [ -d "${i}" ]; then > _files=`find ${i} -type f` > if [ -n "${_files}" ]; then > - ldconfigsoft_paths="${ldconfigsoft_paths} `cat ${_files} | sort -u`" > + _paths="${_paths} `cat ${_files} | sort -Vru`" > fi > fi > done > _LDC="" > - for i in ${ldconfigsoft_paths}; do > + for i in ${_paths} ${ldconfigsoft_paths}; do > if [ -r "${i}" ]; then > _LDC="${_LDC} ${i}" > fi > @@ -87,10 +90,8 @@ ldconfig_start() > # Legacy aout support for i386 only > case `sysctl -n hw.machine_arch` in > i386) > - # Default the a.out ldconfig path. > - : ${ldconfig_paths_aout=${ldconfig_paths}} > _LDC="" > - for i in /usr/lib/aout ${ldconfig_paths_aout} /etc/ld.so.conf; do > + for i in ${ldconfig_paths_aout} /etc/ld.so.conf; do > if [ -r "${i}" ]; then > _LDC="${_LDC} ${i}" > fi > Index: lang/gcc8/files/patch-gcc_fortran_gfortranspec.c > =================================================================== > --- lang/gcc8/files/patch-gcc_fortran_gfortranspec.c (nonexistent) > +++ lang/gcc8/files/patch-gcc_fortran_gfortranspec.c (working copy) > @@ -0,0 +1,11 @@ > +--- gcc/fortran/gfortranspec.c.orig 2018-01-03 10:03:58 UTC > ++++ gcc/fortran/gfortranspec.c > +@@ -404,7 +404,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR > + } > + } > + > +-#ifdef ENABLE_SHARED_LIBGCC > ++#if 0 > + if (library) > + { > + unsigned int i; > > Property changes on: lang/gcc8/files/patch-gcc_fortran_gfortranspec.c > ___________________________________________________________________ > Added: fbsd:nokeywords > ## -0,0 +1 ## > +yes > \ No newline at end of property > Added: svn:eol-style > ## -0,0 +1 ## > +native > \ No newline at end of property > Added: svn:mime-type > ## -0,0 +1 ## > +text/plain > \ No newline at end of property > Index: lang/gcc8/files/patch-libgfortran_Makefile.in > =================================================================== > --- lang/gcc8/files/patch-libgfortran_Makefile.in (nonexistent) > +++ lang/gcc8/files/patch-libgfortran_Makefile.in (working copy) > @@ -0,0 +1,11 @@ > +--- libgfortran/Makefile.in.orig 2018-07-26 09:48:58 UTC > ++++ libgfortran/Makefile.in > +@@ -625,7 +625,7 @@ libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' > + $(LTLDFLAGS) $(LIBQUADLIB) ../libbacktrace/libbacktrace.la \ > + $(HWCAP_LDFLAGS) \ > + -lm $(extra_ldflags_libgfortran) \ > +- $(version_arg) -Wc,-shared-libgcc > ++ $(version_arg) > + > + libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP) > + cafexeclib_LTLIBRARIES = libcaf_single.la > > Property changes on: lang/gcc8/files/patch-libgfortran_Makefile.in > ___________________________________________________________________ > Added: fbsd:nokeywords > ## -0,0 +1 ## > +yes > \ No newline at end of property > Added: svn:eol-style > ## -0,0 +1 ## > +native > \ No newline at end of property > Added: svn:mime-type > ## -0,0 +1 ## > +text/plain > \ No newline at end of property > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"