Problems with out in base

Konstantin Belousov kostikbel at
Sat Aug 20 15:10:51 UTC 2016

On Fri, Aug 19, 2016 at 09:50:28PM +0200, Tijl Coosemans wrote:
> On Fri, 19 Aug 2016 10:28:14 +0300 Konstantin Belousov <kostikbel at> 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 ->
>           -> port lib -> recent
> 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/ version GCC_4.6.0 required by /usr/local/lib/gcc5/ not found
> The base library (libexecinfo) doesn't have DT_RPATH or DT_RUNPATH so the
> only way rtld can find the right 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.

Indeed, and I rechecked the find_library() code against the latest gABI
once more.

So base libraries linked against libgcc_s are
and only libexecinfo would be somewhat problematic.  libcxxrt and libc++
come from C++ runtime, which must be provided by the port's compiler,
the private library should not be linked to by behaving applications.

I suppose that libexecinfo pull unwinder from libgcc_s.  It might be
possible just dlopen() libgcc_s for _Unwind_Backtrace, it seems.

More information about the freebsd-ports mailing list