Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2016 21:50:28 +0200
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Dimitry Andric <dim@FreeBSD.org>, freebsd-toolchain@freebsd.org, freebsd-ports@freebsd.org, Steve Kargl <sgk@troutmask.apl.washington.edu>, kargl@uw.edu
Subject:   Re: Problems with out libgcc_s.so in base
Message-ID:  <20160819215028.3d8e5b42@kalimero.tijl.coosemans.org>
In-Reply-To: <20160819072813.GB83214@kib.kiev.ua>
References:  <20160814230351.GA10587@troutmask.apl.washington.edu> <20160814233430.GA35872@night.db.net> <20160817211710.GA59205@troutmask.apl.washington.edu> <20160818111521.7f79b9f8@kalimero.tijl.coosemans.org> <AB844E50-01A9-4559-8F7A-FE1F7B768F3A@FreeBSD.org> <20160819011432.6f2eadbd@kalimero.tijl.coosemans.org> <20160819072813.GB83214@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 19 Aug 2016 10:28:14 +0300 Konstantin Belousov <kostikbel@gmail.com> wrote:
> The option which would fix all this mess is:
> 1. add rpath for gcc lib/ directory into spec file
> and
> 2. make ports collection use its own compiler instead of fighting with
>    the base.

That still doesn't cover all cases, e.g.:

port exec -> base lib -> libgcc_s.so.1
          -> port lib -> recent libgcc_s.so.1

An example is:

% echo 'int main(void){}' > test.c
% clang37 -o test test.c -lexecinfo -lgfortran -L/usr/local/lib/gcc5 -Wl,-rpath,/usr/local/lib/gcc5
% ./test
/lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc5/libgfortran.so.3 not found

The base library (libexecinfo) doesn't have DT_RPATH or DT_RUNPATH so the
only way rtld can find the right libgcc_s.so is if the executable (test)
has DT_RPATH and no DT_RUNPATH.  Clang runs ld with --enable-new-dtags
so the executable has DT_RUNPATH.  DT_RPATH is deprecated in the Linux
world so there are probably more ports that use --enable-new-dtags.
Another example seems to be Rust.



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