Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Feb 2019 22:19:20 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Eugene Grosbein <eugen@grosbein.net>
Cc:        "Russell L. Carter" <rcarter@pinyon.org>, FreeBSD Ports ML <freebsd-ports@freebsd.org>
Subject:   Re: FreeCAD 0.17 && /lib//libgcc_s.so.1
Message-ID:  <20190217061920.GB91668@troutmask.apl.washington.edu>
In-Reply-To: <532b1923-33b4-d0c7-3499-175900c98d9e@grosbein.net>
References:  <a2102b4e-7d7a-7d5b-2ba1-b9a14f8574f6@pinyon.org> <f6a45ec9-7ae4-d9ba-f71c-f2ef8c235039@grosbein.net> <20190217051109.GA91424@troutmask.apl.washington.edu> <692e3772-9b06-03fa-790b-73117f3c6ec8@grosbein.net> <20190217055655.GA91549@troutmask.apl.washington.edu> <532b1923-33b4-d0c7-3499-175900c98d9e@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 17, 2019 at 01:13:15PM +0700, Eugene Grosbein wrote:
> 17.02.2019 12:56, Steve Kargl wrote:
> 
> >> 17.02.2019 12:11, Steve Kargl wrot:
> >>>
> >>> There is a problem with the order of libgcc_s.so.1
> >>> in the cache created by ldconfig.  rtld will use
> >>> the first one it finds.  If it fails, it fails.  It
> >>> does not look to see if there is a second entry.
> >>
> >> If binary needs specific version of libgcc_s.so.1 installed
> >> with gcc8 port/package, then building system must use specific
> >> rpath, so rtld would not use "the first one it finds".
> > 
> > This is a well-known problem with libgcc_s.so.1 and gfortran.
> > You can state whatever you believe should happen, but it does
> > not seem to work that.  You have a few options:
> > 1) Add -static to your options;
> > 2) Use LD_LIBRARY_PATH, LD_RUN_PATH to point to
> >    /usr/local/lib/gcc8;
> > 3) Add -Wl,-rpath=/usr/local/lib/gcc8 to FFLAGS in /etc/make.conf
> >    (check syntax for this one);
> > 4) bump the major library version number for /lib/libgcc.so.1
> >    to 2;
> > 5) fix rtld to not fail on the first found library in the cache.
> >    Iterated over all entries and only fail if the library isn't found;
> > 6) rename /lib/libgcc_s.so.1 to /lib/libllvm_s.so.1 and teach
> >    llvm/clang/rtld to not misappropriate a well-known GCC library
> >    name.
> > 
> 
> When a port from our Ports Collection needs specific version of GCC and its runtime libraries,
> it utilizes "USE_GCC=8" and bsd.gcc.mk adds this to make everybody happy:
> 
> CFLAGS+=                -Wl,-rpath=${_GCC_RUNTIME}
> CXXFLAGS+=              -Wl,-rpath=${_GCC_RUNTIME}
> LDFLAGS+=               -Wl,-rpath=${_GCC_RUNTIME} -L${_GCC_RUNTIME}
>
> This is your 3) case and this is what I have meant.

FFLAGS+= ????

For whatever reason, there are situations where the rpath
isn't set in the library.  Read the rtld manpage.  You're
hitting #5 in the list.

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190217061920.GB91668>