public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building with AIX gcc 3.3
@ 2003-06-26 13:34 Ken Foskey
  0 siblings, 0 replies; 5+ messages in thread
From: Ken Foskey @ 2003-06-26 13:34 UTC (permalink / raw)
  To: gcc-help

Code is tested and builds on Linux gcc 3.3.  I am trying to build icu
2.2 on AIX for OpenOffice.org port using gcc 3.3 and the standard ld
tool and I am getting:

ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
icu_2_2::UnicodeFilter::matches(icu_2_2::Replaceable const&, int&, int,
signed char)
ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
icu_2_2::UnicodeFilter::toPattern(icu_2_2::UnicodeString&, signed char)
const
ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
icu_2_2::UnicodeFilter::matchesIndexValue(unsigned char) const
ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
icu_2_2::UnicodeFilter::addMatchSetTo(icu_2_2::UnicodeSet&) const
collect2: ld returned 8 exit status

The looks like bug 4122 but I can compile 4122 code fine.  my link line
is:
/usr/local/gcc3.3/bin/g++ -O   -Wl,-brtl -shared -Wl,-bexpall  -o
libicui18n22.0.so ucln_in.o ... ucurr.o -L../common -licuuc22
-L../data/out -L../stubdata -licudata22 -lpthread -lm

Any suggestions on what to try next? 

-- 
Thanks
KenF
OpenOffice.org developer

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

* RE: Building with AIX gcc 3.3
  2003-08-07 17:42     ` David Edelsohn
@ 2003-08-07 18:11       ` Frank Patz
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Patz @ 2003-08-07 18:11 UTC (permalink / raw)
  To: 'David Edelsohn'; +Cc: gcc-help

David wrote:
> >> 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.

You're right, David. How could I doubt that. I was just to lazy to
look at the .x-file contents.

> 	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. 

Your point also: someone modified the specs file at our site. Don't
know why ... 

Sorry,
	- frank

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

* Re: Building with AIX gcc 3.3
  2003-08-07 17:29   ` Frank Patz
@ 2003-08-07 17:42     ` David Edelsohn
  2003-08-07 18:11       ` Frank Patz
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2003-08-07 17:42 UTC (permalink / raw)
  To: Frank Patz; +Cc: 'Ken Foskey', gcc-help

>>>>> 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

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

* RE: Building with AIX gcc 3.3
  2003-07-07 19:05 ` David Edelsohn
@ 2003-08-07 17:29   ` Frank Patz
  2003-08-07 17:42     ` David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Patz @ 2003-08-07 17:29 UTC (permalink / raw)
  To: 'David Edelsohn', 'Ken Foskey'; +Cc: gcc, gcc-help

> dje wrote:
> 	-Wl,-bexpall does not export symbols with leading underscore,
> which are all C++ mangled names in the new ABI.  You need to 
> generate the
> export list explicitly using nm and awk substr:
> 
> 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.

Doesn't the GCC frontend do all this automatically? collect2 generates
an export file and adds it to the linker command, and -brtl is added
automatically, when -shared is used. The frontend does not add -G
automatically when linking shared libraries, however. On the other hand
this doesn't seem to make a difference.

	- frank

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

* Re: Building with AIX gcc 3.3
       [not found] <1057578203.6303.4.camel@gandalf.foskey.org>
@ 2003-07-07 19:05 ` David Edelsohn
  2003-08-07 17:29   ` Frank Patz
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2003-07-07 19:05 UTC (permalink / raw)
  To: Ken Foskey; +Cc: gcc, gcc-help

>>>>> Ken Foskey writes:

Ken> Code is tested and builds on Linux gcc 3.3.  I am trying to build icu
Ken> 2.2 on AIX for OpenOffice.org port using gcc 3.3 and the standard ld
Ken> tool and I am getting:
 
Ken> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
Ken> information.
Ken> ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
Ken> icu_2_2::UnicodeFilter::matches(icu_2_2::Replaceable const&, int&, int,
Ken> signed char)
Ken> ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
Ken> icu_2_2::UnicodeFilter::toPattern(icu_2_2::UnicodeString&, signed char)
Ken> const
Ken> ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
Ken> icu_2_2::UnicodeFilter::matchesIndexValue(unsigned char) const
Ken> ld: 0711-317 ERROR: Undefined symbol: non-virtual thunk [nv:-4] to
Ken> icu_2_2::UnicodeFilter::addMatchSetTo(icu_2_2::UnicodeSet&) const
Ken> collect2: ld returned 8 exit status

Ken> the nm command (default aix) cannot deal with these files at all.  So I
Ken> cannot really analyse this further.

	I do not know what "cannot deal with these files at all" means.  I
have no difficulty using AIX nm with libstdc++.  If you want demanged
names, use c++filt.
 
Ken> The looks like bug 4122 but I can compile 4122 code fine.  my link line
Ken> is:
Ken> /usr/local/gcc3.3/bin/g++ -O   -Wl,-brtl -shared -Wl,-bexpall  -o
Ken> libicui18n22.0.so ucln_in.o ... ucurr.o -L../common -licuuc22
Ken> -L../data/out -L../stubdata -licudata22 -lpthread -lm

	-Wl,-bexpall does not export symbols with leading underscore,
which are all C++ mangled names in the new ABI.  You need to generate the
export list explicitly using nm and awk substr:

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.

Ken> I tried compiling the binutils from tarball and installing it but it
Ken> makes matters worse.

	GNU Binutils does not fully support AIX 5L.

David

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

end of thread, other threads:[~2003-08-07 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-26 13:34 Building with AIX gcc 3.3 Ken Foskey
     [not found] <1057578203.6303.4.camel@gandalf.foskey.org>
2003-07-07 19:05 ` David Edelsohn
2003-08-07 17:29   ` Frank Patz
2003-08-07 17:42     ` David Edelsohn
2003-08-07 18:11       ` Frank Patz

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).