From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Darryl Cook Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: gcc 3.1 problem on Tru64 Date: Mon, 24 Jun 2002 08:28:29 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3D17106D.D1BC725F@cs.appstate.edu> References: <3D132D88.73FDF999@cs.appstate.edu> <10206210948.ZM69613@peony.cs.wright.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1024922104 20274 127.0.0.1 (24 Jun 2002 12:35:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 24 Jun 2002 12:35:04 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17MT3g-0005Gt-00 for ; Mon, 24 Jun 2002 14:35:04 +0200 Original-Received: (qmail 1967 invoked by uid 5); 24 Jun 2002 12:28:33 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 1959 invoked from network); 24 Jun 2002 12:28:33 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (134.167.3.119) by 0 with SMTP; 24 Jun 2002 12:28:33 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1 #39060) with ESMTP id <0GY7008HEMNJLJ@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 24 Jun 2002 08:28:33 -0400 (EDT) Original-Received: from cs.cs.appstate.edu (cs.cs.appstate.edu [152.10.113.12]) by emroute1.cind.ornl.gov (PMDF V6.1 #39060) with ESMTP id <0GY70057HMNGK8@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Mon, 24 Jun 2002 08:28:28 -0400 (EDT) Original-Received: from cs.appstate.edu (viking.cs.appstate.edu [152.10.116.70]) by cs.cs.appstate.edu (8.12.2/8.12.2) with ESMTP id g5OCSMkP038770 for ; Mon, 24 Jun 2002 08:28:22 -0400 (EDT) Original-To: Tru64 Mailing List X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en Xref: main.gmane.org gmane.os.tru64.managers:665 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:665 Thanks to the following for responses. It appears that all will work just depends on which method you prefer. I think the easiest fix is to set LD_LIBRARY_PATH. It seems that 3.x was changed due to the way they want to handle libraries in the future. Libraries will be dynamically linked rather than static linked as in the past. This apparently will make executables smaller and somewhat quicker as I understand it. Ill include several fixes for your viewing pleasure :-) I did try compiling with --disable-shared but still had to set LD_LIBRARY_PATH. One note: If you use standard location of /usr/local some have said it will work as expected. I install in /usr/local/gcc/version so I can have a couple of versions running at a time. Original question: > > Im trying to get gcc-3.1 to install on both 4.0f and 5.1. They both > > compile fine but when you do something like g++ t.C and run the a.out > > file you the following error: > > > > a.out: /sbin/loader: Fatal Error: cannot map libstdc++.so > > > > I compiled it with configure --prefix=pathname > > make bootstrap > > make install > > > > Anyone seen this before? 2.95.3 was compiled the same way and it runs > > fine. > Sheila Hollenbaugh wrote: > The problem is that in previous versions of gcc the location of the libraries > was known to gcc, somehow this utility has been lost. To get around this you > can either link the libraries to a standard location (this is what we do, link > them into /usr/lib) or you can add the location of the libraries to the > LD_LIBRARY_PATH of all the users or train the users to do it themselves. There > may be a way to tell gcc the location of the libraries during configuration or > compilation, but I have not found it. If you discover that kind of a solution > I would be interested in knowing what it is. Versions 3.x of gcc perform dynamic linking (at runtime) rather than create a full-linked executable (at compile time). If your gcc libraries are not in the set of paths normally searched by the runtime loader (as mine are not), you must compile the programs with an extra option -rpath /path/to/gcc/library/directory This information will be saved somehow within a.out. When you execute a.out, the run-time loader performs the final linking before actual execution. Dynamic linking has been a feature of Solaris and Linux for a few years, but they specify the run-time library search paths slightly differently. The idea is to make executable files smaller and to allow them to use newer versions of libraries without recompilation. An alternative action for you is to specify static linking (i.e. the traditional way of creating a fully-linked executable file). I am afraid that I do not know off the top of my head what options one specifies to do that. Regards, Eric Sisson Daryl, make sure the lib directory for gcc is in the the path. I tend to install into "non-standard" paths and the symlink to /usr/local. When I ran gcc/g++ from the non-standard directory without the symlinks in place, I saw the same problem with the compiled program. I then set LD_LIBRARY_PATH to point to the /lib and then it worked. After sym-linking the installed gcc/g++ stuff into user local I didn't have to set LD_LIBRARY_PATH anymore. hth, \@matthias Yes, I think I know the problem. Default on 2.95.3 was static binaries, but on 3.1 it's shared, meaning you need libstdc++.so, or recompile with --disable-shared. /daniel Point LD_LIBRARY_PATH at wherever you installed libstdc++. It would be found automatically with the default configure prefix, /usr/local/