| Kyle Kolander 2005-05-19, 5:52 pm |
| I have two related/unrelated problems compiling and building Shared Library
files (.so).
AIX 5.2
IBM(R) VisualAge(R) C++ Version 6.0.0.11
When building .so files, I get the following link error (the error doesn't
occur when building a static library .a):
ld: 0711-781 ERROR: TOC overflow. TOC size: 67904 Maximum size: 65536
make: 1254-004 The error code from the last command is 12.
I can bypass this with the -bbigtoc flag; however, this increases the file
size and may be a performance hit?
Also, I get tons of Duplicate symbol warnings such as this one:
ld: 0711-224 WARNING: Duplicate symbol:
..std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::basic_string(const char*)
These duplicate symbol warnings appear whether building a library or an
executable... the TOC error only occurs when building the .so file. I don't
know if they are related -- the TOC error is a serious problem, while
currently, the duplicate symbols is a major annoyance (that I feel should
not be present). Does anyone have suggestions or insights into how to fix
the problems or what would cause the problems? Below are stripped down
commands I am using to compile and build the libraries (there are actually
lots of .o files). Using xlC_r rather than just xlC because other libraries
that I am linking with make use of threading.
// Compiling Source Files
xlC_r -q64 -c MyFile1.cpp -o MyFile1.o
xlC_r -q64 -c MyFile2.cpp -o MyFile2.o
// Creating Static Library...
ar -ru -X64 -o libMyLibrary.a MyFile1.o MyFile2.o
// Creating Shared Library...
xlC_r -G -qmkshrobj -q64 -o libMyLibrary.so MyFile1.o MyFile2.o
// Eliminates the error building the shared library
xlC_r -G -qmkshrobj -q64 -bbigtoc -o libMyLibrary.so MyFile1.o MyFile2.o
Hopefully someone can help me get to the root of this problem!
Thanks,
Kyle
|