From owner-freebsd-ports@FreeBSD.ORG Fri Jan 31 00:19:49 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EF11297 for ; Fri, 31 Jan 2014 00:19:49 +0000 (UTC) Received: from um-tip1-missouri-out.um.umsystem.edu (um-tip1-missouri-out.um.umsystem.edu [198.209.49.135]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD8DA14D6 for ; Fri, 31 Jan 2014 00:19:48 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgEFAPLr6lLPoJ7G/2dsb2JhbABZgww4V74zFnSCLHgTASkWGAMCAQIBICcEDQgBAYgBnFCnZIhtk0EEiRGQSZBtgy2CKg X-IPAS-Result: AgEFAPLr6lLPoJ7G/2dsb2JhbABZgww4V74zFnSCLHgTASkWGAMCAQIBICcEDQgBAYgBnFCnZIhtk0EEiRGQSZBtgy2CKg Received: from um-tcas2.um.umsystem.edu ([207.160.158.198]) by um-tip1-exch-relay.um.umsystem.edu with ESMTP; 30 Jan 2014 18:19:47 -0600 Received: from UM-MBX-N02.um.umsystem.edu ([169.254.5.41]) by UM-TCAS2.um.umsystem.edu ([207.160.158.198]) with mapi id 14.03.0174.001; Thu, 30 Jan 2014 18:19:47 -0600 From: "Montgomery-Smith, Stephen" To: FreeBSD Ports Subject: Problems with linking on FreeBSD-10 Thread-Topic: Problems with linking on FreeBSD-10 Thread-Index: AQHPHholgD2MMQMMlEanesmM2H1EvQ== Date: Fri, 31 Jan 2014 00:19:46 +0000 Message-ID: <52EAEC1D.9040502@missouri.edu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 x-originating-ip: [207.160.158.205] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2014 00:19:49 -0000 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