public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7987: Linker command has wrong directory order
@ 2003-01-13  0:49 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-01-13  0:49 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, smithjc5

Synopsis: Linker command has wrong directory order

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Sun Jan 12 16:49:01 2003
State-Changed-Why:
    You have to set LD_LIBRARY_PATH to include the path to which
    gcc installs its libraries. The path to these libraries is
    not hard-wired into the executables.
    
    Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7987


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/7987: Linker command has wrong directory order
@ 2002-09-20  6:36 smithjc5
  0 siblings, 0 replies; 2+ messages in thread
From: smithjc5 @ 2002-09-20  6:36 UTC (permalink / raw)
  To: gcc-gnats


>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 <objdir>, configured with:
     <srcdir>/configure --prefix=<instdir> --enable-threads=posix

In <objdir>, built with:
     make bootstrap

In <objdir>, 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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-13  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13  0:49 c++/7987: Linker command has wrong directory order bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-09-20  6:36 smithjc5

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).