This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: problem getting std::string::_Rep::_S_max_size and std::string::_ Rep::_S_terminal under AIX linked
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Freimann Mario <mario dot freimann at siemens dot com>
- Cc: "'libstdc++ at gcc dot gnu dot org'" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 30 Jan 2002 11:39:05 -0800 (PST)
- Subject: Re: problem getting std::string::_Rep::_S_max_size and std::string::_ Rep::_S_terminal under AIX linked
> compiling the program worked fine. but when the thing got to linking
> problems occured. the two symbols std::string::_Rep::_S_max_size and
> std::string::_Rep::_S_terminal couldn't be ressolved. so i looked in google
...
> next thing i did was looking in the mailing list archive of gnu. i found
> several threads, but i didn't realize the solution for the problem.
...
> i don't know what else to do. could someboldy please help me?
Sure. I just asked this question to David Edelsohn myself. Here is his
reply to me:
--------
In addition to weak symbol support, V3 relies on SVR4 symbol
merging "run-time linking" semantics, especially for C++ streams support.
That is not AIX's default shared object behavior. AIX 4.2 and later
provided that as an option through -G/-brtl linker flags. The problem is
that both the library *and* the application linked against the library
need to be linked with the appropriate flags. This is why I added -Wl,-G
to OPT_LDFLAGS.
Now libstdc++.a is created "run-time linking enabled" with the -G
flag, but the testcases are not linked with the -brtl flag. I cannot see
a way to inform the testsuite to use that extra flag.
Running the testsuite manually with that flag in GCC 3.0, I obtain
results like:
FAIL: 21_strings/capacity.cc (test for excess errors)
WARNING: 21_strings/capacity.cc compilation failed to produce executable
FAIL: 22_locale/ctype_char_members.cc execution test
FAIL: 22_locale/numpunct.cc (test for excess errors)
WARNING: 22_locale/numpunct.cc compilation failed to produce executable
FAIL: 26_numerics/c99_classification_macros_c++.cc (test for excess
errors)
FAIL: 26_numerics/complex_inserters_extractors.cc (test for excess errors)
WARNING: 26_numerics/complex_inserters_extractors.cc compilation failed to
produ
ce executable
=== libstdc++-v3 Summary ===
# of expected passes 239
# of unexpected failures 5
# of expected failures 8
which I think you will agree are acceptable.
libtool understands "-Wl,-brtl" as a special flag telling it to
build libraries with the -Wl,-brtl flag as well, but it changes other
behaviors such as producing shared libraries named libstdc++.so instead of
libstdc++.a. AIX only looks for libstdc++.so if an application is linked
with -brtl, so that would break normal linking. -brtl may adversely
affect AIX applications which do not want SVR4 semantics. And we do not
want all GCC target libraries linked with -G. Plus V3 testsuite does not
use it, so *everything* fails to link. Conclusion: the libtool special
signal is not an option.
So, I use OPT_LDFLAGS and inform AIX users in the GCC Manual
compatibility page to use -brtl. I and IBM will just have to teach AIX
GCC users to use this extra option when linking with libstdc++-v3.
BTW, linking with -brtl in 3.1 does not appear much better because
the test harness reports the linker warnings as failures. Even with the
-G/-brtl flag, one gets warnings of duplicate symbols for the BSS and DATA
symbols which it is preparing to merge.
--------
It would be nice to fix this for gcc-3.1. Anyway, hope you find it
helpful. I suggest looking at the AIX parts of the gcc manual.
-benjamin