This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Building with AIX gcc 3.3
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: "Frank Patz" <fp at contact dot de>
- Cc: "'Ken Foskey'" <foskey at optushome dot com dot au>, gcc-help at gcc dot gnu dot org
- Date: Thu, 07 Aug 2003 13:42:02 -0400
- Subject: Re: Building with AIX gcc 3.3
>>>>> Frank Patz writes:
>> nm -BCpg *.o | awk '{ if ((($2 == "T") || ($2 == "D") || ($2
>> == "B")) && (substr($3,1,1) != ".")) { print $3 } }' | sort
>> -u > icu.exp
>>
>> Also, you need to use -Wl,-G when creating the shared object and
>> -Wl,-brtl when linking the final application.
Frank> Doesn't the GCC frontend do all this automatically? collect2 generates
Frank> an export file and adds it to the linker command, and -brtl is added
Frank> automatically, when -shared is used. The frontend does not add -G
Frank> automatically when linking shared libraries, however. On the other hand
Frank> this doesn't seem to make a difference.
collect2 creates an export file for symbols that collect2
generates -- static constructors and destructors, and frames. collect2
cannot make assumptions about how user symbols will be used and cannot
generate an export file for those.
Also, GCC does not invoke the linker with "-brtl" under any
circumstances. GCC "-shared" invokes the linker with "-bM:SRE", which
creates a shared object. GCC does not make any assumptions about the user
expecting System-V semantics.
David