Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2014 00:19:46 +0000
From:      "Montgomery-Smith, Stephen" <stephen@missouri.edu>
To:        FreeBSD Ports <freebsd-ports@FreeBSD.org>
Subject:   Problems with linking on FreeBSD-10
Message-ID:  <52EAEC1D.9040502@missouri.edu>

next in thread | raw e-mail | index | archive | help
I maintain the port math/sage.  The port builds its own version of the
libreadline library.  The port also uses lang/gcc instead of clang,
because the port needs Fortran.

The port is wanting to create a shared library called libR.so, which it
wants to link with the libreadline library it created itself.  So it
issues this kind of command:

gcc46 -Wl,-rpath=3Dpath-of-newly-made-library -o libR.so -lreadline

I have left out most of the command for brevity.

Unfortunately the libR.so pulls in /lib/libreadline - the version that
comes with the base FreeBSD.  I thought that -rpath flag was supposed to
tell the linker where to find the library.  But it doesn't.

The failure is when using FreeBSD-10.  With FreeBSD-8 it works great.  I
also assume that gcc46 uses /usr/local/bin/ld instead of /usr/bin/ld,
since devel/binutils is a dependency of lang/gcc.

Can anyone help me?  Is this a bug with FreeBSD?  Or is there some extra
flag I can set with the linker to make it work?  I have tried
-rpath-link and -z origin, but these were random guesses. and I don't
really know what I am doing.

Thanks, Stephen




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