public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How do I add missing stdc functions to libstdc++-v3?
@ 2012-03-06 20:08 Vaugha Brewchuk
  2012-03-06 20:34 ` Jonathan Wakely
  0 siblings, 1 reply; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-06 20:08 UTC (permalink / raw)
  To: gcc-help

Hello,

I recently spent a considerable amount of time porting gcc-3.2.3 to NEXTSTEP 3.3 on m68k NeXT hardware.  With some tweaks I was able to finish all three stages of c, objc, c++ and f77 and all the binaries successfully compare.  I do, however, have a problem with correctly configuring libstdc++ and consequently c++ binaries do not link.  I spent some time reading through the gcc, collect2 and libstdc++ documentation, but so far I was not able to find an obvious solution.  Below are the error messages that I receive when compiling abi_check.cc:

/bin/ld: Undefined symbols:
access(char const*, int)
___gxx_personality_sj0
___cxa_call_unexpected
strxfrm(char*, char const*, unsigned long)
strdup(char*)
write(int, void const*, unsigned long)
_strdup

I presume that the function declarations displayed above originate from collect2 and that they were not picked up from the NeXT headers during the libstdc++ configuration.  Where can I override this so that the messages disappear?  I already defined these functions (access, strxfrm, strdup and write) as required in the applicable libstdc++ code but that is not sufficient.  Presumably collect2 stores a definition of all available system symbols somewhere?

This brings me to my second question.  How do I then add the object files or source code for the functions missing from the standard NeXT libraries to the libstdc++ build?  I looked through the source tree and nothing obvious jumps at me.

Finally, I am somewhat perplexed about the missing ___gxx_personality_sj0 and ___cxa_call_unexpected symbols, and would appreciate any insight.

I should also add here that I am not a software developer, but I simply enjoy tinkering with software as a hobby, so please be gentle with me.

Any assistance or suggestions would be greatly appreciated,
thank you!

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-06 20:08 How do I add missing stdc functions to libstdc++-v3? Vaugha Brewchuk
@ 2012-03-06 20:34 ` Jonathan Wakely
       [not found]   ` <0328DAEF-BA39-4B42-BA04-35A6976A6C26@yahoo.ca>
  0 siblings, 1 reply; 24+ messages in thread
From: Jonathan Wakely @ 2012-03-06 20:34 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: gcc-help

On 6 March 2012 20:04, Vaugha Brewchuk wrote:
> Hello,
>
> I recently spent a considerable amount of time porting gcc-3.2.3 to NEXTSTEP 3.3 on m68k NeXT hardware.  With some tweaks I was able to finish all three stages of c, objc, c++ and f77 and all the binaries successfully compare.  I do, however, have a problem with correctly configuring libstdc++ and consequently c++ binaries do not link.  I spent some time reading through the gcc, collect2 and libstdc++ documentation, but so far I was not able to find an obvious solution.  Below are the error messages that I receive when compiling abi_check.cc:
>
> /bin/ld: Undefined symbols:
> access(char const*, int)
> ___gxx_personality_sj0
> ___cxa_call_unexpected
> strxfrm(char*, char const*, unsigned long)
> strdup(char*)
> write(int, void const*, unsigned long)
> _strdup

How are you compiling abi_check.cc?  By running 'make check' or some other way?

strdup and write are not part of libstdc++, so if they're not being
found then something is going wrong.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
       [not found]     ` <CAH6eHdRX62KvRJCNYiXin0H245Ft-+Bhanw+T+Xztq_EzBb1ug@mail.gmail.com>
@ 2012-03-07  3:50       ` Vaugha Brewchuk
  2012-03-08  9:40         ` Jeffrey Walton
  2012-03-13  0:15         ` Vaugha Brewchuk
  0 siblings, 2 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-07  3:50 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help


On 2012-03-06, at 4:51 PM, Jonathan Wakely wrote:

> On 6 March 2012 20:53, Vaugha Brewchuk wrote:
>> Thank you for a super-fast response!
>> 
>> I was compiling abi_check.cc using make check.  The NeXT supplied libraries are very old and do not include all of the libstdc++ dependencies.  Specifically, strxfrm() and strdup() are not in the NeXT libraries and therefore my plan was to add them to libstdc++ so that the dependency is satisfied locally.
> 
> Those functions are required by C90 so it's not surprising that
> libstdc++ (even such an ancient version as 3.2.3) assumes they are
> available.  I think the usual way to provide them would be in
> libiberty, not in libstdc++
> See http://gcc.gnu.org/onlinedocs/libiberty/

Thank you for the suggestion - I will review the documentation for libiberty and see if I can build it with some additional functions.

> 
>>  On the other hand access() and write() are in the NeXT libraries, but are defined in header libc.h, that libstdc++ does not recognize out of the box...
> 
> I doubt those functions are defined in a header, note the error you're
> getting is an undefined reference - meaning the library containing the
> functions hasn't been found.  Not finding a header isn't the problem.
> Which library defines them?

It looks like the actual objects for access() and write() reside in /usr/shlib/libsys_s.B.shlib, which is a shared library that is automatically loaded, if needed, by the standard NeXT static library /lib/libsys_s.a.  To confirm I just created a short test program in C that uses write() and compiled it with my C only port of gcc-3.2.3 using the following command:

gcc -o test -Wall test.c

It compiles and links successfully, creating a test executable that includes the write() object.  I wonder if this has something to do with the way that NEXTSTEP 3.3 libraries are set-up and the way collect2 works.  What I don't understand is that it works fine with C executables, but not with C++ executables.

> 
> Is there a reason you're porting such an ancient GCC rather than a
> newer version which might work better on NeXT, or might be fixable if
> you report bugs in its support for NeXT?

Unfortunately gcc-3.2.3 is the most modern GCC that supports the NeXT out of the box, and even then only with the obsolete flag.  Any newer versions would require significant effort to implement NeXT support, since I understand that the platform configuration files have been completely changed.  I would love to port a more modern compiler, but it is substantially beyond my abilities.  Just for reference, NEXTSTEP 3.3 originally shipped with gcc-2.5.8, so 3.2.3 is a significant upgrade already :-)

Thank you again.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-07  3:50       ` Vaugha Brewchuk
@ 2012-03-08  9:40         ` Jeffrey Walton
  2012-03-12 23:51           ` Vaugha Brewchuk
  2012-03-13  0:15         ` Vaugha Brewchuk
  1 sibling, 1 reply; 24+ messages in thread
From: Jeffrey Walton @ 2012-03-08  9:40 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: gcc-help

On Tue, Mar 6, 2012 at 10:50 PM, Vaugha Brewchuk
<vaugha_brewchuk@yahoo.ca> wrote:
>
> On 2012-03-06, at 4:51 PM, Jonathan Wakely wrote:
>
>> On 6 March 2012 20:53, Vaugha Brewchuk wrote:
>>>
>>>
>>> [SNIP]
>>>
>>>  On the other hand access() and write() are in the NeXT libraries, but are defined in header libc.h, that libstdc++ does not recognize out of the box...
>>
>> I doubt those functions are defined in a header, note the error you're
>> getting is an undefined reference - meaning the library containing the
>> functions hasn't been found.  Not finding a header isn't the problem.
>> Which library defines them?
>
> It looks like the actual objects for access() and write() reside in /usr/shlib/libsys_s.B.shlib, which is a shared library that is automatically loaded, if needed, by the standard NeXT static library /lib/libsys_s.a.  To confirm I just created a short test program in C that uses write() and compiled it with my C only port of gcc-3.2.3 using the following command:
>
Be careful with access(2) - I believe its a TOCTOU lying in wait. My
man pages tell me "access() is a potential security hole and should
never be used."

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-08  9:40         ` Jeffrey Walton
@ 2012-03-12 23:51           ` Vaugha Brewchuk
  0 siblings, 0 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-12 23:51 UTC (permalink / raw)
  To: noloader; +Cc: gcc-help

Thank you for the heads-up.  The access() function is used by libstdc++ from gcc-3.2.3, so I do not have much choice.  Having said that, NEXTSTEP and OPENSTEP are so stale at this point that it would be nearly impossible to bring them up to anything remotely resembling modern security.  I keep the machine for mostly nostalgic reasons and I don't let it talk to the outside world...


On 2012-03-08, at 4:39 AM, Jeffrey Walton wrote:

> On Tue, Mar 6, 2012 at 10:50 PM, Vaugha Brewchuk
> <vaugha_brewchuk@yahoo.ca> wrote:
>> 
>> On 2012-03-06, at 4:51 PM, Jonathan Wakely wrote:
>> 
>>> On 6 March 2012 20:53, Vaugha Brewchuk wrote:
>>>> 
>>>> 
>>>> [SNIP]
>>>> 
>>>>  On the other hand access() and write() are in the NeXT libraries, but are defined in header libc.h, that libstdc++ does not recognize out of the box...
>>> 
>>> I doubt those functions are defined in a header, note the error you're
>>> getting is an undefined reference - meaning the library containing the
>>> functions hasn't been found.  Not finding a header isn't the problem.
>>> Which library defines them?
>> 
>> It looks like the actual objects for access() and write() reside in /usr/shlib/libsys_s.B.shlib, which is a shared library that is automatically loaded, if needed, by the standard NeXT static library /lib/libsys_s.a.  To confirm I just created a short test program in C that uses write() and compiled it with my C only port of gcc-3.2.3 using the following command:
>> 
> Be careful with access(2) - I believe its a TOCTOU lying in wait. My
> man pages tell me "access() is a potential security hole and should
> never be used."

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-07  3:50       ` Vaugha Brewchuk
  2012-03-08  9:40         ` Jeffrey Walton
@ 2012-03-13  0:15         ` Vaugha Brewchuk
  2012-03-13  1:25           ` Jonathan Wakely
  1 sibling, 1 reply; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-13  0:15 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

I have done a bit more experimenting and have made small progress.  I tried linking abi_check manually while adding an object including strdup().  As a result, my original error message changed from:

/bin/ld: Undefined symbols:
access(char const*, int)
___gxx_personality_sj0
___cxa_call_unexpected
strxfrm(char*, char const*, unsigned long)
strdup(char*)
write(int, void const*, unsigned long)
_strdup

to:

/bin/ld: Undefined symbols:
access(char const*, int)
___gxx_personality_sj0
___cxa_call_unexpected
strxfrm(char*, char const*, unsigned long)
strdup(char*)
write(int, void const*, unsigned long)

So the actual linker error relating to missing "_strdup" disappeared, but the error with "strdup(char*)" remained.  I then edited my system headers to add the missing definitions for access(), strxfrm(), strdup() and write() and rebuilt gcc-3.2.3 from scratch (it takes around 20 hours on a 68040!).  Subsequent manual linking of abi_check only complained about two missing symbols:

/bin/ld: Undefined symbols:
___gxx_personality_sj0
___cxa_call_unexpected

Could someone please indicate to me at what point in gcc configuration (or build) the system headers are scanned for presence or absence of functions?  Where do I tweak the gcc source to be able to define these missing functions without the need for editing my system headers?  I tried to search the sources and the build directories, but was not successful in finding anything obviously related.

Finally, how and where are the missing two symbols "___gxx_personality_sj0" and "___cxa_call_unexpected" normally generated?  And again, where in the code do I need to start looking to define a workaround?

I would very much appreciate any assistance or suggestions...
Thank you!


On 2012-03-06, at 10:50 PM, Vaugha Brewchuk wrote:

> 
> On 2012-03-06, at 4:51 PM, Jonathan Wakely wrote:
> 
>> On 6 March 2012 20:53, Vaugha Brewchuk wrote:
>>> Thank you for a super-fast response!
>>> 
>>> I was compiling abi_check.cc using make check.  The NeXT supplied libraries are very old and do not include all of the libstdc++ dependencies.  Specifically, strxfrm() and strdup() are not in the NeXT libraries and therefore my plan was to add them to libstdc++ so that the dependency is satisfied locally.
>> 
>> Those functions are required by C90 so it's not surprising that
>> libstdc++ (even such an ancient version as 3.2.3) assumes they are
>> available.  I think the usual way to provide them would be in
>> libiberty, not in libstdc++
>> See http://gcc.gnu.org/onlinedocs/libiberty/
> 
> Thank you for the suggestion - I will review the documentation for libiberty and see if I can build it with some additional functions.
> 
>> 
>>> On the other hand access() and write() are in the NeXT libraries, but are defined in header libc.h, that libstdc++ does not recognize out of the box...
>> 
>> I doubt those functions are defined in a header, note the error you're
>> getting is an undefined reference - meaning the library containing the
>> functions hasn't been found.  Not finding a header isn't the problem.
>> Which library defines them?
> 
> It looks like the actual objects for access() and write() reside in /usr/shlib/libsys_s.B.shlib, which is a shared library that is automatically loaded, if needed, by the standard NeXT static library /lib/libsys_s.a.  To confirm I just created a short test program in C that uses write() and compiled it with my C only port of gcc-3.2.3 using the following command:
> 
> gcc -o test -Wall test.c
> 
> It compiles and links successfully, creating a test executable that includes the write() object.  I wonder if this has something to do with the way that NEXTSTEP 3.3 libraries are set-up and the way collect2 works.  What I don't understand is that it works fine with C executables, but not with C++ executables.
> 
>> 
>> Is there a reason you're porting such an ancient GCC rather than a
>> newer version which might work better on NeXT, or might be fixable if
>> you report bugs in its support for NeXT?
> 
> Unfortunately gcc-3.2.3 is the most modern GCC that supports the NeXT out of the box, and even then only with the obsolete flag.  Any newer versions would require significant effort to implement NeXT support, since I understand that the platform configuration files have been completely changed.  I would love to port a more modern compiler, but it is substantially beyond my abilities.  Just for reference, NEXTSTEP 3.3 originally shipped with gcc-2.5.8, so 3.2.3 is a significant upgrade already :-)
> 
> Thank you again.
> 

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-13  0:15         ` Vaugha Brewchuk
@ 2012-03-13  1:25           ` Jonathan Wakely
  2012-03-15  3:09             ` Vaugha Brewchuk
  0 siblings, 1 reply; 24+ messages in thread
From: Jonathan Wakely @ 2012-03-13  1:25 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: gcc-help

On 13 March 2012 00:14, Vaugha Brewchuk wrote:
> I have done a bit more experimenting and have made small progress.  I tried linking abi_check manually while adding an object including strdup().  As a result, my original error message changed from:
>
> /bin/ld: Undefined symbols:
> access(char const*, int)
> ___gxx_personality_sj0
> ___cxa_call_unexpected
> strxfrm(char*, char const*, unsigned long)
> strdup(char*)
> write(int, void const*, unsigned long)
> _strdup
>
> to:
>
> /bin/ld: Undefined symbols:
> access(char const*, int)
> ___gxx_personality_sj0
> ___cxa_call_unexpected
> strxfrm(char*, char const*, unsigned long)
> strdup(char*)
> write(int, void const*, unsigned long)
>
> So the actual linker error relating to missing "_strdup" disappeared, but the error with "strdup(char*)" remained.  I then edited my system headers to add the missing definitions for access(), strxfrm(), strdup() and write() and rebuilt gcc-3.2.3 from scratch (it takes around 20 hours on a 68040!).  Subsequent manual linking of abi_check only complained about two missing symbols:
>
> /bin/ld: Undefined symbols:
> ___gxx_personality_sj0
> ___cxa_call_unexpected
>
> Could someone please indicate to me at what point in gcc configuration (or build) the system headers are scanned for presence or absence of functions?  Where do I tweak the gcc source to be able to define these missing functions without the need for editing my system headers?  I tried to search the sources and the build directories, but was not successful in finding anything obviously related.
>
> Finally, how and where are the missing two symbols "___gxx_personality_sj0" and "___cxa_call_unexpected" normally generated?  And again, where in the code do I need to start looking to define a workaround?

They should be defined by gcc itself, in libsupc++.so, you shouldn't
have to do anything.

How are you linking abi_check? What exact command?

I think the problem is how you're linking, not missing features of the OS.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-13  1:25           ` Jonathan Wakely
@ 2012-03-15  3:09             ` Vaugha Brewchuk
  2012-03-15  6:33               ` Marc Glisse
  2012-03-15  8:40               ` Jonathan Wakely
  0 siblings, 2 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-15  3:09 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help


On 2012-03-12, at 9:19 PM, Jonathan Wakely wrote:

> On 13 March 2012 00:14, Vaugha Brewchuk wrote:
>> I have done a bit more experimenting and have made small progress.  I tried linking abi_check manually while adding an object including strdup().  As a result, my original error message changed from:
>> 
>> /bin/ld: Undefined symbols:
>> access(char const*, int)
>> ___gxx_personality_sj0
>> ___cxa_call_unexpected
>> strxfrm(char*, char const*, unsigned long)
>> strdup(char*)
>> write(int, void const*, unsigned long)
>> _strdup
>> 
>> to:
>> 
>> /bin/ld: Undefined symbols:
>> access(char const*, int)
>> ___gxx_personality_sj0
>> ___cxa_call_unexpected
>> strxfrm(char*, char const*, unsigned long)
>> strdup(char*)
>> write(int, void const*, unsigned long)
>> 
>> So the actual linker error relating to missing "_strdup" disappeared, but the error with "strdup(char*)" remained.  I then edited my system headers to add the missing definitions for access(), strxfrm(), strdup() and write() and rebuilt gcc-3.2.3 from scratch (it takes around 20 hours on a 68040!).  Subsequent manual linking of abi_check only complained about two missing symbols:
>> 
>> /bin/ld: Undefined symbols:
>> ___gxx_personality_sj0
>> ___cxa_call_unexpected
>> 
>> Could someone please indicate to me at what point in gcc configuration (or build) the system headers are scanned for presence or absence of functions?  Where do I tweak the gcc source to be able to define these missing functions without the need for editing my system headers?  I tried to search the sources and the build directories, but was not successful in finding anything obviously related.
>> 
>> Finally, how and where are the missing two symbols "___gxx_personality_sj0" and "___cxa_call_unexpected" normally generated?  And again, where in the code do I need to start looking to define a workaround?
> 
> They should be defined by gcc itself, in libsupc++.so, you shouldn't
> have to do anything.
> 
> How are you linking abi_check? What exact command?
> 
> I think the problem is how you're linking, not missing features of the OS.

You were absolutely correct regarding the linking phase.

I am using the exact same command as the Makefile with the all-target-libstdc++-v3 target:

/Storage2/gcc-3.2.3-bld/gcc/g++ -shared-libgcc -B/Storage2/gcc-3.2.3-bld/gcc/ -nostdinc++ -B/usr/local/m68k-next-nextstep3/bin/ -B/usr/local/m68k-next-nextstep3/lib/ -isystem /usr/local/m68k-next-nextstep3/include -g -O2 -o abi_check abi_check.o  -L/Storage2/gcc-3.2.3-bld/m68k-next-nextstep3/libstdc++-v3/src -L/Storage2/gcc-3.2.3-bld/m68k-next-nextstep3/libstdc++-v3/src/.libs -lm

With verbose output enabled, the command produces the following output:

Reading specs from /Storage2/gcc-3.2.3-bld/gcc/specs
Configured with: ../gcc-3.2.3/configure --prefix=/usr/local --enable-languages=c,objc,c++,f77 --disable-shared --disable-threads --enable-cpp --enable-obsolete m68k-next-nextstep3
Thread model: single
gcc version 3.2.3
 /Storage2/gcc-3.2.3-bld/gcc/collect2 -o abi_check -lcrt0.o -L/Storage2/gcc-3.2.3-bld/m68k-next-nextstep3/libstdc++-v3/src -L/Storage2/gcc-3.2.3-bld/m68k-next-nextstep3/libstdc++-v3/src/.libs -L/Storage2/gcc-3.2.3-bld/gcc -L/usr/local/lib/gcc-lib/m68k-next-nextstep3/3.2.3 -L/usr/local/lib/gcc-lib/m68k-next-nextstep3/3.2.3/../../.. abi_check.o -lstdc++ -lm -lgcc -lsys_s -lgcc
/bin/ld: Undefined symbols:
access(char const*, int)
___gxx_personality_sj0
strdup(char const*)
___cxa_call_unexpected
_strdup
strxfrm(char*, char const*, unsigned long)
collect2: ld returned 1 exit status

Following your suggestions and looking at the above output, it is obvious that there is no -lsupc++ command passed-on to collect2.  I manually added -lsupc++ to the above command and both of the missing symbols have been imported by the linker!  I am now one step closer to getting abi_check linked - thank you!

Now the question is why does g++ not try to link with libsupc++.a?  I will dig through the configuration, but as always any pointers would be very much appreciated.

And of course I still get this even with all the symbols resolved by the linker:

/bin/ld: Undefined symbols:
access(char const*, int)
strdup(char const*)
strxfrm(char*, char const*, unsigned long)
collect2: ld returned 1 exit status

Thank you once again!

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-15  3:09             ` Vaugha Brewchuk
@ 2012-03-15  6:33               ` Marc Glisse
  2012-03-15  8:39                 ` Jonathan Wakely
  2012-03-15  8:40               ` Jonathan Wakely
  1 sibling, 1 reply; 24+ messages in thread
From: Marc Glisse @ 2012-03-15  6:33 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: gcc-help

On Wed, 14 Mar 2012, Vaugha Brewchuk wrote:

> /bin/ld: Undefined symbols:
> access(char const*, int)
> strdup(char const*)
> strxfrm(char*, char const*, unsigned long)
> collect2: ld returned 1 exit status

It is suspicious that you get the types of the arguments printed here. It 
means the functions were compiled as C++ functions, so probably their 
declaration is missing extern "C".

-- 
Marc Glisse

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-15  6:33               ` Marc Glisse
@ 2012-03-15  8:39                 ` Jonathan Wakely
  2012-03-15 11:20                   ` Vaugha Brewchuk
  0 siblings, 1 reply; 24+ messages in thread
From: Jonathan Wakely @ 2012-03-15  8:39 UTC (permalink / raw)
  To: gcc-help; +Cc: Vaugha Brewchuk

On 15 March 2012 06:32, Marc Glisse wrote:
> On Wed, 14 Mar 2012, Vaugha Brewchuk wrote:
>
>> /bin/ld: Undefined symbols:
>> access(char const*, int)
>> strdup(char const*)
>> strxfrm(char*, char const*, unsigned long)
>> collect2: ld returned 1 exit status
>
>
> It is suspicious that you get the types of the arguments printed here. It
> means the functions were compiled as C++ functions, so probably their
> declaration is missing extern "C".

Indeed, check in the relevant libc headers, <unistd.h> and <string.h>
to see if the headers are enclosed in:

#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif

If none of the NeXT headers have that, there's a compiler setting that
forces all headers in system directories such as /usr/include to be
implicitly treated as though they had that extern "C" linkage.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-15  3:09             ` Vaugha Brewchuk
  2012-03-15  6:33               ` Marc Glisse
@ 2012-03-15  8:40               ` Jonathan Wakely
  2012-03-15 11:38                 ` Vaugha Brewchuk
  2012-03-19 15:40                 ` Vaugha Brewchuk
  1 sibling, 2 replies; 24+ messages in thread
From: Jonathan Wakely @ 2012-03-15  8:40 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: gcc-help

On 15 March 2012 03:09, Vaugha Brewchuk wrote:
>
>
> Following your suggestions and looking at the above output, it is obvious that there is no -lsupc++ command passed-on to collect2.  I manually added -lsupc++ to the above command and both of the missing symbols have been imported by the linker!  I am now one step closer to getting abi_check linked - thank you!
>
> Now the question is why does g++ not try to link with libsupc++.a?  I will dig through the configuration, but as always any pointers would be very much appreciated.

I think usually libstdc++ would automatically link to libsupc++, but
maybe NeXT needs it to be done explicitly.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-15  8:39                 ` Jonathan Wakely
@ 2012-03-15 11:20                   ` Vaugha Brewchuk
  0 siblings, 0 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-15 11:20 UTC (permalink / raw)
  To: Jonathan Wakely, Marc Glisse; +Cc: gcc-help


On 2012-03-15, at 4:38 AM, Jonathan Wakely wrote:

> On 15 March 2012 06:32, Marc Glisse wrote:
>> On Wed, 14 Mar 2012, Vaugha Brewchuk wrote:
>> 
>>> /bin/ld: Undefined symbols:
>>> access(char const*, int)
>>> strdup(char const*)
>>> strxfrm(char*, char const*, unsigned long)
>>> collect2: ld returned 1 exit status
>> 
>> 
>> It is suspicious that you get the types of the arguments printed here. It
>> means the functions were compiled as C++ functions, so probably their
>> declaration is missing extern "C".
> 
> Indeed, check in the relevant libc headers, <unistd.h> and <string.h>
> to see if the headers are enclosed in:
> 
> #ifdef __cplusplus
> extern "C" {
> #endif
> ...
> #ifdef __cplusplus
> }
> #endif
> 
> If none of the NeXT headers have that, there's a compiler setting that
> forces all headers in system directories such as /usr/include to be
> implicitly treated as though they had that extern "C" linkage.

BINGO - that did it!  Thank you!  I am also very rapidly coming to a realization that trying to port g++ while not knowing anything about c++ is a silly idea...

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-15  8:40               ` Jonathan Wakely
@ 2012-03-15 11:38                 ` Vaugha Brewchuk
  2012-03-19 15:40                 ` Vaugha Brewchuk
  1 sibling, 0 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-15 11:38 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help


On 2012-03-15, at 4:40 AM, Jonathan Wakely wrote:

> On 15 March 2012 03:09, Vaugha Brewchuk wrote:
>> 
>> 
>> Following your suggestions and looking at the above output, it is obvious that there is no -lsupc++ command passed-on to collect2.  I manually added -lsupc++ to the above command and both of the missing symbols have been imported by the linker!  I am now one step closer to getting abi_check linked - thank you!
>> 
>> Now the question is why does g++ not try to link with libsupc++.a?  I will dig through the configuration, but as always any pointers would be very much appreciated.
> 
> I think usually libstdc++ would automatically link to libsupc++, but
> maybe NeXT needs it to be done explicitly.

I added my two missing objects, strdup() and strxfrm(), to libsupc++ and tried linking again.  Unfortunately the result looks like I'm "sinking" even deeper and way beyond my skill level:

/bin/ld: Undefined symbols:
__GLOBAL__D__Z16check_compatibleRK11symbol_infoS1_b
__GLOBAL__D__ZN9__gnu_cxx4ropeIcSaIcEE10_S_min_lenE
__GLOBAL__D__ZNKSt9basic_iosIcSt11char_traitsIcEE7rdstateEv
__GLOBAL__I__Z16check_compatibleRK11symbol_infoS1_b
__GLOBAL__I__ZN9__gnu_cxx4ropeIcSaIcEE10_S_min_lenE
__GLOBAL__I__ZNKSt9basic_iosIcSt11char_traitsIcEE7rdstateEv
__GLOBAL__I__ZNSt10moneypunctIcLb0EEC2Em
__GLOBAL__I__ZNSt5ctypeIcE13classic_tableEv
__GLOBAL__I__ZNSt7codecvtIcc9mbstate_tE2idE
___main

I am almost ready to throw in the towel.  Thank you.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-15  8:40               ` Jonathan Wakely
  2012-03-15 11:38                 ` Vaugha Brewchuk
@ 2012-03-19 15:40                 ` Vaugha Brewchuk
  2012-03-19 15:54                   ` Jonathan Wakely
  2012-03-20 16:30                   ` Ian Lance Taylor
  1 sibling, 2 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-19 15:40 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

I have a quick update.  I was able to find an issue with the way my gcc configuration was using crtstuff.c.  After I corrected it I can now successfully link abi_check with a manual command!

What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.

Thank you everyone once again for your help.


On 2012-03-15, at 4:40 AM, Jonathan Wakely wrote:

> On 15 March 2012 03:09, Vaugha Brewchuk wrote:
>> 
>> 
>> Following your suggestions and looking at the above output, it is obvious that there is no -lsupc++ command passed-on to collect2.  I manually added -lsupc++ to the above command and both of the missing symbols have been imported by the linker!  I am now one step closer to getting abi_check linked - thank you!
>> 
>> Now the question is why does g++ not try to link with libsupc++.a?  I will dig through the configuration, but as always any pointers would be very much appreciated.
> 
> I think usually libstdc++ would automatically link to libsupc++, but
> maybe NeXT needs it to be done explicitly.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-19 15:40                 ` Vaugha Brewchuk
@ 2012-03-19 15:54                   ` Jonathan Wakely
  2012-03-19 20:46                     ` Vaugha Brewchuk
  2012-03-20 16:30                   ` Ian Lance Taylor
  1 sibling, 1 reply; 24+ messages in thread
From: Jonathan Wakely @ 2012-03-19 15:54 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: gcc-help

On 19 March 2012 15:39, Vaugha Brewchuk wrote:
> I have a quick update.  I was able to find an issue with the way my gcc configuration was using crtstuff.c.  After I corrected it I can now successfully link abi_check with a manual command!
>
> What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.

It would be a lot easier to answer if you showed the exact command you
used when it did link successfully.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-19 15:54                   ` Jonathan Wakely
@ 2012-03-19 20:46                     ` Vaugha Brewchuk
  0 siblings, 0 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-19 20:46 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

I apologize for not including the details.  I issued the same command as the Makefile command that builds abi_check, but in addition I included the path to libsupc++.a and also added -v -lsupc++

/Storage2/gcc-3.2.3-bld2/gcc/g++ -v -shared-libgcc -B/Storage2/gcc-3.2.3-bld2/gcc/ -nostdinc++ -B/usr/local/m68k-next-nextstep3/bin/ -B/usr/local/m68k-next-nextstep3/lib/ -isystem /usr/local/m68k-next-nextstep3/include -g -O2 -o abi_check abi_check.o  -L/Storage2/gcc-3.2.3-bld2/m68k-next-nextstep3/libstdc++-v3/src -L/Storage2/gcc-3.2.3-bld2/m68k-next-nextstep3/libstdc++-v3/src/.libs -L/Storage2/gcc-3.2.3-bld2/m68k-next-nextstep3/libstdc++-v3/libsupc++/.libs -lsupc++ -lm
Reading specs from /Storage2/gcc-3.2.3-bld2/gcc/specs
Configured with: ../gcc-3.2.3-NS/configure --prefix=/usr/local --enable-languages=c,c++ --disable-shared --disable-threads --enable-cpp --enable-obsolete m68k-next-nextstep3
Thread model: single
gcc version 3.2.3
 /Storage2/gcc-3.2.3-bld2/gcc/collect2 -o abi_check -lcrt0.o -lcrtbegin.o -L/Storage2/gcc-3.2.3-bld2/m68k-next-nextstep3/libstdc++-v3/src -L/Storage2/gcc-3.2.3-bld2/m68k-next-nextstep3/libstdc++-v3/src/.libs -L/Storage2/gcc-3.2.3-bld2/m68k-next-nextstep3/libstdc++-v3/libsupc++/.libs -L/Storage2/gcc-3.2.3-bld2/gcc -L/usr/local/lib/gcc-lib/m68k-next-nextstep3/3.2.3 -L/usr/local/lib/gcc-lib/m68k-next-nextstep3/3.2.3/../../.. abi_check.o -lsupc++ -lstdc++ -lm -lgcc -lsys_s -lgcc -lcrtend.o

I am now trying to identify which gcc or libstdc++ configuration files need to be modified to automatically link libsupc++ whenever g++ is run, as Jonathan earlier suggested should be happening.

Thank you.

On 2012-03-19, at 11:53 AM, Jonathan Wakely wrote:

> On 19 March 2012 15:39, Vaugha Brewchuk wrote:
>> I have a quick update.  I was able to find an issue with the way my gcc configuration was using crtstuff.c.  After I corrected it I can now successfully link abi_check with a manual command!
>> 
>> What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.
> 
> It would be a lot easier to answer if you showed the exact command you
> used when it did link successfully.

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-19 15:40                 ` Vaugha Brewchuk
  2012-03-19 15:54                   ` Jonathan Wakely
@ 2012-03-20 16:30                   ` Ian Lance Taylor
  2012-03-20 20:12                     ` Vaugha Brewchuk
  1 sibling, 1 reply; 24+ messages in thread
From: Ian Lance Taylor @ 2012-03-20 16:30 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: Jonathan Wakely, gcc-help

Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:

> What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.

Normally libstdc++ is linked against libsupc++, so normally linking
against -lstdc++ is sufficient to bring in -lsupc++.  I do not know why
that does not suffice for you.  In other words, there is normally no
automatic linking of libsupc++ because no such automatic linking is
normally required.

Ian

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-20 16:30                   ` Ian Lance Taylor
@ 2012-03-20 20:12                     ` Vaugha Brewchuk
  2012-03-20 20:30                       ` Ian Lance Taylor
  0 siblings, 1 reply; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-20 20:12 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Jonathan Wakely, gcc-help

This would definitely suffice, but it is not happening on NEXTSTEP.  Linking with g++ issues -lstdc++ but -lsupc++ is not getting brought-in.  I have been trying to determine why this does not happen and how to fix it.  I assumed (incorrectly) that it was related to some configuration files, but perhaps it has to do with libtool, collect2 or ld?  Also please note that all these are static libraries because NEXTSTEP does not support building of shared libraries.

As always, andy guidance would be very much appreciated.  Thank you.

On 2012-03-20, at 12:30 PM, Ian Lance Taylor wrote:

> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
> 
>> What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.
> 
> Normally libstdc++ is linked against libsupc++, so normally linking
> against -lstdc++ is sufficient to bring in -lsupc++.  I do not know why
> that does not suffice for you.  In other words, there is normally no
> automatic linking of libsupc++ because no such automatic linking is
> normally required.
> 
> Ian

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-20 20:12                     ` Vaugha Brewchuk
@ 2012-03-20 20:30                       ` Ian Lance Taylor
  2012-03-20 21:15                         ` Vaugha Brewchuk
  0 siblings, 1 reply; 24+ messages in thread
From: Ian Lance Taylor @ 2012-03-20 20:30 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: Jonathan Wakely, gcc-help

Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:

> This would definitely suffice, but it is not happening on NEXTSTEP.  Linking with g++ issues -lstdc++ but -lsupc++ is not getting brought-in.  I have been trying to determine why this does not happen and how to fix it.  I assumed (incorrectly) that it was related to some configuration files, but perhaps it has to do with libtool, collect2 or ld?  Also please note that all these are static libraries because NEXTSTEP does not support building of shared libraries.


What I'm suggesting is that you need to investigate how libstdc++ is
built and whether it is being linked with -lsupc++.  If it's a static
library then libstdc++.a should include the entire contents of
libsupc++.a.  Presumably that is not happening for some reason; you will
need to look at how libstdc++ is built to find out why not.

Unfortunately my first guess would some sort of libtool issue on
NEXTSTEP.  That is unfortunate because libtool is a complex, difficult
to understand, shell script.

Ian

> On 2012-03-20, at 12:30 PM, Ian Lance Taylor wrote:
>
>> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
>> 
>>> What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.
>> 
>> Normally libstdc++ is linked against libsupc++, so normally linking
>> against -lstdc++ is sufficient to bring in -lsupc++.  I do not know why
>> that does not suffice for you.  In other words, there is normally no
>> automatic linking of libsupc++ because no such automatic linking is
>> normally required.
>> 
>> Ian

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-20 20:30                       ` Ian Lance Taylor
@ 2012-03-20 21:15                         ` Vaugha Brewchuk
  2012-03-20 22:39                           ` Vaugha Brewchuk
  0 siblings, 1 reply; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-20 21:15 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Jonathan Wakely, gcc-help

Thank you very much for your suggestion sir - this gives me exactly what I need in terms of troubleshooting direction!


On 2012-03-20, at 4:30 PM, Ian Lance Taylor wrote:

> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
> 
>> This would definitely suffice, but it is not happening on NEXTSTEP.  Linking with g++ issues -lstdc++ but -lsupc++ is not getting brought-in.  I have been trying to determine why this does not happen and how to fix it.  I assumed (incorrectly) that it was related to some configuration files, but perhaps it has to do with libtool, collect2 or ld?  Also please note that all these are static libraries because NEXTSTEP does not support building of shared libraries.
> 
> 
> What I'm suggesting is that you need to investigate how libstdc++ is
> built and whether it is being linked with -lsupc++.  If it's a static
> library then libstdc++.a should include the entire contents of
> libsupc++.a.  Presumably that is not happening for some reason; you will
> need to look at how libstdc++ is built to find out why not.
> 
> Unfortunately my first guess would some sort of libtool issue on
> NEXTSTEP.  That is unfortunate because libtool is a complex, difficult
> to understand, shell script.
> 
> Ian
> 
>> On 2012-03-20, at 12:30 PM, Ian Lance Taylor wrote:
>> 
>>> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
>>> 
>>>> What configuration or setup file determines automatic linking of libsupc++?  I would like to fix it such that no manual intervention is required.
>>> 
>>> Normally libstdc++ is linked against libsupc++, so normally linking
>>> against -lstdc++ is sufficient to bring in -lsupc++.  I do not know why
>>> that does not suffice for you.  In other words, there is normally no
>>> automatic linking of libsupc++ because no such automatic linking is
>>> normally required.
>>> 
>>> Ian

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-20 21:15                         ` Vaugha Brewchuk
@ 2012-03-20 22:39                           ` Vaugha Brewchuk
  2012-03-20 22:49                             ` Ian Lance Taylor
  0 siblings, 1 reply; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-20 22:39 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Jonathan Wakely, gcc-help

I just had a good look at both static libraries that were generated during the build process, libstdc++ and libsupc++.  I found that libstdc++ has in it all the objects from libsupc++ with the exception of eh_aux_runtime.o and eh_personality.o.  This explains why I get linker warnings with missing symbols __gxx_personality_sj0 and __cxa_call_unexpected.  Can you please confirm that these objects need to be statically linked into libstdc++?  I can then figure out why they have been omitted.

I apologize about all these basic questions, but I tried really hard to find some low level detailed information about how gcc, g++ and libstdc++ are configured and built and I was not very successful.  I am obviously very inexperienced with this...

Thank you

On 2012-03-20, at 5:15 PM, Vaugha Brewchuk wrote:

> Thank you very much for your suggestion sir - this gives me exactly what I need in terms of troubleshooting direction!
> 
> 
> On 2012-03-20, at 4:30 PM, Ian Lance Taylor wrote:
> 
>> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
>> 
>>> This would definitely suffice, but it is not happening on NEXTSTEP.  Linking with g++ issues -lstdc++ but -lsupc++ is not getting brought-in.  I have been trying to determine why this does not happen and how to fix it.  I assumed (incorrectly) that it was related to some configuration files, but perhaps it has to do with libtool, collect2 or ld?  Also please note that all these are static libraries because NEXTSTEP does not support building of shared libraries.
>> 
>> 
>> What I'm suggesting is that you need to investigate how libstdc++ is
>> built and whether it is being linked with -lsupc++.  If it's a static
>> library then libstdc++.a should include the entire contents of
>> libsupc++.a.  Presumably that is not happening for some reason; you will
>> need to look at how libstdc++ is built to find out why not.
>> 
>> Unfortunately my first guess would some sort of libtool issue on
>> NEXTSTEP.  That is unfortunate because libtool is a complex, difficult
>> to understand, shell script.
>> 
>> Ian

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-20 22:39                           ` Vaugha Brewchuk
@ 2012-03-20 22:49                             ` Ian Lance Taylor
  2012-03-21  2:42                               ` Vaugha Brewchuk
  0 siblings, 1 reply; 24+ messages in thread
From: Ian Lance Taylor @ 2012-03-20 22:49 UTC (permalink / raw)
  To: Vaugha Brewchuk; +Cc: Jonathan Wakely, gcc-help

Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:

> I just had a good look at both static libraries that were generated during the build process, libstdc++ and libsupc++.  I found that libstdc++ has in it all the objects from libsupc++ with the exception of eh_aux_runtime.o and eh_personality.o.  This explains why I get linker warnings with missing symbols __gxx_personality_sj0 and __cxa_call_unexpected.  Can you please confirm that these objects need to be statically linked into libstdc++?  I can then figure out why they have been omitted.

Yes, those objects should be in the static libstdc++.a archive.  They
should also be in the static libsupc++.a archive.  I don't know why they
would be missing for you.

Ian

>
> I apologize about all these basic questions, but I tried really hard to find some low level detailed information about how gcc, g++ and libstdc++ are configured and built and I was not very successful.  I am obviously very inexperienced with this...
>
> Thank you
>
> On 2012-03-20, at 5:15 PM, Vaugha Brewchuk wrote:
>
>> Thank you very much for your suggestion sir - this gives me exactly what I need in terms of troubleshooting direction!
>> 
>> 
>> On 2012-03-20, at 4:30 PM, Ian Lance Taylor wrote:
>> 
>>> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
>>> 
>>>> This would definitely suffice, but it is not happening on NEXTSTEP.  Linking with g++ issues -lstdc++ but -lsupc++ is not getting brought-in.  I have been trying to determine why this does not happen and how to fix it.  I assumed (incorrectly) that it was related to some configuration files, but perhaps it has to do with libtool, collect2 or ld?  Also please note that all these are static libraries because NEXTSTEP does not support building of shared libraries.
>>> 
>>> 
>>> What I'm suggesting is that you need to investigate how libstdc++ is
>>> built and whether it is being linked with -lsupc++.  If it's a static
>>> library then libstdc++.a should include the entire contents of
>>> libsupc++.a.  Presumably that is not happening for some reason; you will
>>> need to look at how libstdc++ is built to find out why not.
>>> 
>>> Unfortunately my first guess would some sort of libtool issue on
>>> NEXTSTEP.  That is unfortunate because libtool is a complex, difficult
>>> to understand, shell script.
>>> 
>>> Ian

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-20 22:49                             ` Ian Lance Taylor
@ 2012-03-21  2:42                               ` Vaugha Brewchuk
  2012-03-22  3:43                                 ` Vaugha Brewchuk
  0 siblings, 1 reply; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-21  2:42 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Jonathan Wakely, gcc-help


On 2012-03-20, at 6:48 PM, Ian Lance Taylor wrote:

> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
> 
>> I just had a good look at both static libraries that were generated during the build process, libstdc++ and libsupc++.  I found that libstdc++ has in it all the objects from libsupc++ with the exception of eh_aux_runtime.o and eh_personality.o.  This explains why I get linker warnings with missing symbols __gxx_personality_sj0 and __cxa_call_unexpected.  Can you please confirm that these objects need to be statically linked into libstdc++?  I can then figure out why they have been omitted.
> 
> Yes, those objects should be in the static libstdc++.a archive.  They
> should also be in the static libsupc++.a archive.  I don't know why they
> would be missing for you.
> 
> Ian

This helps a lot, since now I know "why" and I just need to identify the "how".  To help, I built gcc-3.2.3 with static libraries on a virtualized Ubuntu 4.10 and confirmed that the two objects are in both libraries.  I will compare the build processes to determine why on NEXTSTEP eh_aux_runtime.o and eh_personality.o are in libsupc++ only and are missing in libstdc++.

Thank you again!

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

* Re: How do I add missing stdc functions to libstdc++-v3?
  2012-03-21  2:42                               ` Vaugha Brewchuk
@ 2012-03-22  3:43                                 ` Vaugha Brewchuk
  0 siblings, 0 replies; 24+ messages in thread
From: Vaugha Brewchuk @ 2012-03-22  3:43 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Jonathan Wakely, gcc-help


On 2012-03-20, at 10:41 PM, Vaugha Brewchuk wrote:

> 
> On 2012-03-20, at 6:48 PM, Ian Lance Taylor wrote:
> 
>> Vaugha Brewchuk <vaugha_brewchuk@yahoo.ca> writes:
>> 
>>> I just had a good look at both static libraries that were generated during the build process, libstdc++ and libsupc++.  I found that libstdc++ has in it all the objects from libsupc++ with the exception of eh_aux_runtime.o and eh_personality.o.  This explains why I get linker warnings with missing symbols __gxx_personality_sj0 and __cxa_call_unexpected.  Can you please confirm that these objects need to be statically linked into libstdc++?  I can then figure out why they have been omitted.
>> 
>> Yes, those objects should be in the static libstdc++.a archive.  They
>> should also be in the static libsupc++.a archive.  I don't know why they
>> would be missing for you.
>> 
>> Ian
> 
> This helps a lot, since now I know "why" and I just need to identify the "how".  To help, I built gcc-3.2.3 with static libraries on a virtualized Ubuntu 4.10 and confirmed that the two objects are in both libraries.  I will compare the build processes to determine why on NEXTSTEP eh_aux_runtime.o and eh_personality.o are in libsupc++ only and are missing in libstdc++.
> 
> Thank you again!

I was able to identify the root cause of the problem.  The 'ar' implementation on NEXTSTEP truncates object file names to 15 characters:

ar: filename eh_aux_runtime.o truncated to eh_aux_runtime.
ar: filename eh_personality.o truncated to eh_personality.

Consequently these objects extracted from libsupc++ have truncated file names and do not get picked-up by libtool when creating libstdc++.  I also found an interesting post relating to this issue:  http://lists.gnu.org/archive/html/bug-libtool/2011-11/msg00002.html

I will patch libtool supplied in gcc to fix this issue on NEXTSTEP.

Thank you once again for everyone's help and patience.

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

end of thread, other threads:[~2012-03-22  3:43 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-06 20:08 How do I add missing stdc functions to libstdc++-v3? Vaugha Brewchuk
2012-03-06 20:34 ` Jonathan Wakely
     [not found]   ` <0328DAEF-BA39-4B42-BA04-35A6976A6C26@yahoo.ca>
     [not found]     ` <CAH6eHdRX62KvRJCNYiXin0H245Ft-+Bhanw+T+Xztq_EzBb1ug@mail.gmail.com>
2012-03-07  3:50       ` Vaugha Brewchuk
2012-03-08  9:40         ` Jeffrey Walton
2012-03-12 23:51           ` Vaugha Brewchuk
2012-03-13  0:15         ` Vaugha Brewchuk
2012-03-13  1:25           ` Jonathan Wakely
2012-03-15  3:09             ` Vaugha Brewchuk
2012-03-15  6:33               ` Marc Glisse
2012-03-15  8:39                 ` Jonathan Wakely
2012-03-15 11:20                   ` Vaugha Brewchuk
2012-03-15  8:40               ` Jonathan Wakely
2012-03-15 11:38                 ` Vaugha Brewchuk
2012-03-19 15:40                 ` Vaugha Brewchuk
2012-03-19 15:54                   ` Jonathan Wakely
2012-03-19 20:46                     ` Vaugha Brewchuk
2012-03-20 16:30                   ` Ian Lance Taylor
2012-03-20 20:12                     ` Vaugha Brewchuk
2012-03-20 20:30                       ` Ian Lance Taylor
2012-03-20 21:15                         ` Vaugha Brewchuk
2012-03-20 22:39                           ` Vaugha Brewchuk
2012-03-20 22:49                             ` Ian Lance Taylor
2012-03-21  2:42                               ` Vaugha Brewchuk
2012-03-22  3:43                                 ` Vaugha Brewchuk

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