From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2194 invoked by alias); 12 Dec 2009 11:08:36 -0000 Received: (qmail 2186 invoked by uid 22791); 12 Dec 2009 11:08:35 -0000 X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL,BAYES_00,BOTNET,SARE_LWSHORTT X-Spam-Check-By: sourceware.org Received: from out1.ip08ir2.opaltelecom.net (HELO out1.ip08ir2.opaltelecom.net) (62.24.128.244) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 12 Dec 2009 11:08:29 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiIIAJsII0vUQ3lr/2dsb2JhbACYabwehCsE Received: from oasis-out-f.onetel.net.uk (HELO sgrsil47.onetel.net.uk) ([212.67.121.107]) by out1.ip08ir2.opaltelecom.net with ESMTP; 12 Dec 2009 11:08:27 +0000 Message-ID: <4B23799B.3040101@onetel.net> Date: Sun, 13 Dec 2009 19:38:00 -0000 From: "Dr. David Kirkby" User-Agent: Thunderbird 2.0.0.21 (X11/20090323) MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Can I stop linking the same library twice? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00189.txt.bz2 I have seen issues in the Sage mathematics software http://www.sagemath.org/ where problems arise if a library included in Sage is installed on the system too. Sage included the source for all the libraries it needs (e.g. readline), in case the system does not have that library. That sometimes causes problems, if the option "-L $SAGE_HOME/local/lib" is added and the library is also on the system. Is there a way to specify that only the first copy of the library is linked, and not any other copies gcc might find? Readline is not the only library where issues have arisen (OpenSSL libraries on OpenSolaris is another example). I'd rather some way of doing this which is not GCC specific, and certainly not specific to the GNU linker, as on Solaris the Sun linker works better, and in any case we hope to support non-GNU compilers too. But in the short term, anything that works with gcc, even if not with other compilers, would be useful. Dave