Ask a Question related to AIX, Design and Development.
-
Peter Keller #1
g++ 3.3 and AIX
Hello,
Is there any way that I can force a static linking of libstdc++.a into a
binary produced by g++ 3.3 on AIX 5.1?
Even if I put the libstdc++.a file directly on the command line, it still ends
up linking it dynamically. If I use -bnso, then ALL libraries are linked
statically, but I don't want libc.a linked statically into the executable,
only libstdc++.a.
Any ideas on how to fix it? Thanks.
-pete
Peter Keller Guest
-
Gary R. Hook #2
Re: g++ 3.3 and AIX
Peter Keller wrote:
Try "... -bstatic -lstdc++ -bdynamic ..." as long as g++ maintains> Is there any way that I can force a static linking of libstdc++.a into a
> binary produced by g++ 3.3 on AIX 5.1?
>
> Even if I put the libstdc++.a file directly on the command line, it still ends
> up linking it dynamically. If I use -bnso, then ALL libraries are linked
> statically, but I don't want libc.a linked statically into the executable,
> only libstdc++.a.
command line ordering when it calls the linker.
--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
__________________________________________________ ______________________
Gary R. Hook Guest
-
Peter Keller #3
Re: g++ 3.3 and AIX
Gary R. Hook <nospam@nospammers.net> wrote:
I thought -b was for choosing a target machine when you have a compiler> Try "... -bstatic -lstdc++ -bdynamic ..." as long as g++ maintains
> command line ordering when it calls the linker.
that can compile for multiple architectures. -B(in case this is what you
meant to say) is for fixing the search paths for things like ld and cpp.
I think you meant: -Bstatic and -Bdynamic supplied to the _GNU Linker_.
Trouble is, I'm not using the GNU linker for this phase of the link.
I'm using collect2 under gcc which uses the AIX linker, which doesn't
understand -Bstatic and -Bdynamic in the capacity I need it.
I found -bnso and -bso for the AIX linker, but it seems all or nothing.
Is there anyway I can ask for SOME .a files(which contain .so files) to be
statically brought in, but leave other libraries shared. Basically
the -Bstatic/-Bdynamic effect for the AIX linker?
Thanks.
-pete
Peter Keller Guest
-
Peter Keller #4
Re: g++ 3.3 and AIX
Peter Keller <psilord@buzzard.cs.wisc.edu> wrote:
My mistake. You are correct.> Is there anyway I can ask for SOME .a files(which contain .so files) to be
> statically brought in, but leave other libraries shared. Basically
> the -Bstatic/-Bdynamic effect for the AIX linker?
If my command line looks like this:
AIX aix-machine > /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/collect2
-bpT:0x10000000 -bpD:0x20000000 -btextro -bnodelcsect
/lib/crt0.o -L/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3
-L/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/../../.. foo.o
-bstatic -lstdc++ -bdynamic -lm
/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/libgcc.a
/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/libgcc_eh.a
-lc /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/libgcc.a
/usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3/libgcc_eh.a -m
then it works as expected. I didn't know that -bstatic and -bdynamic were
valid flags for the AIX linker. But now, after careful reading of the man
page, I see what you are talking about. I've tried it and it works.
Thank you VERY much.
-pete
Peter Keller Guest
-
Gary R. Hook #5
Re: g++ 3.3 and AIX
Peter Keller wrote:
Well, it is what I do :-)> Peter Keller <psilord@buzzard.cs.wisc.edu> wrote:
>>>>Is there anyway I can ask for SOME .a files(which contain .so files) to be
>>statically brought in, but leave other libraries shared. Basically
>>the -Bstatic/-Bdynamic effect for the AIX linker?
> My mistake. You are correct.
Happy to assist.> Thank you VERY much.
--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
__________________________________________________ ______________________
Gary R. Hook Guest



Reply With Quote

