Re: AIX 5.3 GCC 4.2.1 libstdc++ Linker Problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Haley <aph-gcc@xxxxxxxxxxxxxxxxxxx> wrote on 09/11/2007 08:36:57 
AM:

> ericbambach1@xxxxxxxxxxxx writes:
>  > Thanks for responding.
>  > 
>  > Andrew Haley <aph-gcc@xxxxxxxxxxxxxxxxxxx> wrote on 09/11/2007 
04:53:09 
>  > AM:
>  > 
>  > > ericbambach1@xxxxxxxxxxxx writes:
>  > >  > Hello,
>  > >  > 
>  > >  >         Please CC as I'm not subscribed. Hope line breaks are 
ok, I 
>  > hate 
>  > >  > Lotus Notes :)
>  > >  > 
>  > >  >         I'm having a lot of trouble getting gcc 4.2.1 compiled 
and 
>  > run on 
>  > >  > AIX 5.3 on the power5 architecture. Even after GCC compiles 
>  > successfully 
>  > >  > it seems libstdc++.a isn't built correctly.
>  > >  > 
>  > >  >         We have the IBM binary gcc-4.0.0 compiler installed in 
>  > >  > /opt/freeware/bin so I know its possible to get GCC on here 
somehow.
>  > >  > 
>  > >  >         It builds fine but compilation of this simple test 
program 
>  > fails 
>  > >  > with g++. gcc SEEMS to function ok but I havent checked it in 
depth 
>  > yet. 
>  > >  > Take a look at the session below (edited for readability + mask 
>  > >  > user+hostname only) where it first fails to find libgcc_s even 
though 
>  > the 
>  > >  > configure script placed it in /sys/usr/lib just like I asked, 
Next it 
>  > cant 
>  > >  > link against libstdc++.a. Once I turn on the verbose output I 
see 
>  > that 
>  > >  > libstdc++.a has no symbols being imported! I dont know much 
about 
>  > >  > compilers but it seems that I need SOME symbols from libstdc++ 
are 
>  > needed. 
>  > >  > Last, if I force it to link against IBM's libstdc++.a it works 
fine. 
>  > >  > 
>  > >  >         Am I building gcc wrong? I did build it with GNU make 
and the 
>  > AIX 
>  > >  > as+ld. I borrowed IBM's config flags from 4.0.0. Any additional 
info 
>  > >  > needed?
>  > > 
>  > > This is a clue:
>  > > 
>  > > Configured with: ../gcc-4.2.1/configure --with-as=/usr/bin/as 
>  > > --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ 
>  > > --prefix=/sys/usr/local --bindir=/sys/usr --enable-threads 
>  > > --enable-version-specific-runtime-libs 
--host=powerpc-ibm-aix5.3.0.0 : 
>  > > (reconfigured) ../gcc-4.2.1/configure --with-as=/usr/bin/as 
>  > > --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ 
>  > > --prefix=/sys/usr/local --with-slibdir=/sys/usr/lib 
--enable-threads 
>  > > --enable-version-specific-runtime-libs 
--host=powerpc-ibm-aix5.3.0.0
>  > > 
>  > > So, you configured and built gcc without specifying the dir for the
>  > > shared libgcclibrary, and you then reconfigured with one.  Why did 
you
>  > > do this?
>  > 
>  > At first I was just testing the build. Then I reconfigured to put the 

>  > libraries int the location we need them for the server. I figure that 
may 
>  > be why it can't find libgcc_s initially, but I'm not too worried 
about 
>  > that. I'm more worried that it can't find symbols in libstdc++.
> 
> Well no, you didn't.  You put libgcc in one place and the rest of the
> libraries in another.  This is a Bad Thing.  You should only use
> --with-slibdir in very special circumstances -- otherwise you should
> just put everything in the prefix.
> 

Well removing --with-slibdir fixed all my problems. Doh! Thanks for that 
cluestick.

However, how should I configure GCC so that all the stuff needed for 
runtime is in /sys/usr/lib but everything else in /sys/usr/local.

That is, we have a dev box that compiles code and a production box without 
a compiler that should run this code.
We only want the bare minimum needed to run programs copied to the prod 
box. Will --libdir=/sys/usr/lib --prefix=/sys/usr/local suffice? Then we 
can copy contents of /sys/usr/lib over.

It seems that libgcc_s and libstdc++.a are the only gcc specific runtimes 
needed. Would it be bad to configure with --prefix=/sys/usr/local then 
copy /sys/usr/local/lib/ to /sys/usr/lib by hand on the production box as 
long as /sys/usr lib is in the LIBPATH?

Thanks again!


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux