From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17149 invoked by alias); 20 Sep 2002 13:36:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17110 invoked by uid 71); 20 Sep 2002 13:36:01 -0000 Resent-Date: 20 Sep 2002 13:36:01 -0000 Resent-Message-ID: <20020920133601.17109.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, smithjc5@navair.navy.mil Received: (qmail 11222 invoked by uid 61); 20 Sep 2002 13:26:03 -0000 Message-Id: <20020920132603.11221.qmail@sources.redhat.com> Date: Fri, 20 Sep 2002 06:36:00 -0000 From: smithjc5@navair.navy.mil Reply-To: smithjc5@navair.navy.mil To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7987: Linker command has wrong directory order X-SW-Source: 2002-09/txt/msg00595.txt.bz2 List-Id: >Number: 7987 >Category: c++ >Synopsis: Linker command has wrong directory order >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Sep 20 06:36:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: smithjc5@navair.navy.mil >Release: 3.0.4 >Organization: >Environment: Redhat Linux 2.4.18-3 i686 >Description: On a RedHat system with gcc 2.96 in /usr/bin, 3.11 in /usr/local/bin, I compiled gcc 3.0.4 into ~/gcc-3.0. (The need for 3.0.4 is configuration-management related and due to up comming version release, we can't change to 3.2 yet). The configure/build/install went fine. Information regarding this is at the end. When using this compiler, we get a strange linker error with an undefined reference (nm shows the symbols in the version of libstdc++ compiled with this version, but not the one from gcc 3.1.1). As a test, I statically linked in the libstdc++ that was built with this compiler; this worked. I then captured the commands used to actually do the link (collect2) to file. In the section of the arguments specifying the search path (-L options), /usr/local/lib and /usr/X11/lib were searched prior to the directories involved with this installation of gcc. This resulted in the wrong libstdc++ being used. I would think that the compiler's library directories should *always* be used first. Regardless, how can I force my installation to do this? In , configured with: /configure --prefix= --enable-threads=posix In , built with: make bootstrap In , installed with: make install >How-To-Repeat: Install gcc 3.1.x or 3.2 into /usr/local, install gcc 3.0.4 into ~/gcc-3.0.4, and try to compile. >Fix: >Release-Note: >Audit-Trail: >Unformatted: