Any Success with AIX and GCC?
Has anyone had any success compiling the latest version of boost
wholesale with GCC on AIX? Besides the annoying dynamic linking
problems, I am also getting failed links for wchar_t stuff:
ld: 0711-317 ERROR: Undefined symbol: std::basic_string
Try gcc 3.3.3. It fixed a problem related to weak symbol. Peter Jones wrote:
Has anyone had any success compiling the latest version of boost wholesale with GCC on AIX? Besides the annoying dynamic linking problems, I am also getting failed links for wchar_t stuff:
ld: 0711-317 ERROR: Undefined symbol: std::basic_string
, std::allocator >::_Rep::_S_terminal With:
Boost: 1.31.0 GCC: 3.3.2 AIX: 5.2
Hey, remember back when Russell Mok said:
Try gcc 3.3.3. It fixed a problem related to weak symbol.
That fixed the wchar_t stuff. I still needed to hack the Jam file so that the gcc-Link-action action would link .so files with -pthread. *** 430,436 **** { $(SHELL_SET)$(gSHELL_LIBPATH)=$(LINK_LIBPATH)$(gAPPEND_LD_LIBRARY_PATH) $(SHELL_EXPORT)$(gSHELL_LIBPATH) ! $(.GXX[1]:R=$(GCC_BIN_DIR)) $(.GXX[2-]) $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])$(OUTTAG)" -L"$(LIBPATH:T)" -L"$(STDLIBPATH:T)" "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" "$(IMPLIB_FLAGS)$(NEEDIMPS)" -l$(FINDLIBS) $(LNOPT)$(RPATH_LINK). $(LNOPT)$(SONAME)$(<[1]:D=)$(SOTAG) $(ACTION_1)$(LN)$(_)-fs$(_)"$(<[1]:D=)$(OUTTAG)"$(_)"$(<[1])" } --- 430,436 ---- { $(SHELL_SET)$(gSHELL_LIBPATH)=$(LINK_LIBPATH)$(gAPPEND_LD_LIBRARY_PATH) $(SHELL_EXPORT)$(gSHELL_LIBPATH) ! $(.GXX[1]:R=$(GCC_BIN_DIR)) $(.GXX[2-]) $(IMPLIB_COMMAND)$(<[2]) $(LINKFLAGS) -o "$(<[1])$(OUTTAG)" -L"$(LIBPATH:T)" -L"$(STDLIBPATH:T)" "$(>)" "$(NEEDLIBS)" "$(NEEDLIBS)" "$(IMPLIB_FLAGS)$(NEEDIMPS)" -l$(FINDLIBS) $(LNOPT)$(RPATH_LINK). $(LNOPT)$(SONAME)$(<[1]:D=)$(SOTAG) -lpthread $(ACTION_1)$(LN)$(_)-fs$(_)"$(<[1]:D=)$(OUTTAG)"$(_)"$(<[1])" } I am sure there is a better way to do that, just not sure where in the gcc-tools.jam file would be the best place. I am still getting these strange link errors: gcc-Link-action bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true/libboost_prg_exec_monitor-gcc-1_31.so bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true/libboost_prg_exec_monitor-gcc-1_31.imp ld: 0711-317 ERROR: Undefined symbol: .cpp_main(int, char**) ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status LIBPATH=bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true:bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true:$LIBPATH export LIBPATH g++ -s -fPIC -shared -o "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true/libboost_prg_exec_monitor-gcc-1_31.so" "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true/execution_monitor.o" "bin/boost/libs/test/build/libboost_prg_exec_monitor.so/gcc/release/shared-linkable-true/cpp_main.o" -lpthread -- Peter Jones [unix;vi;crypto;c++;4wd] (http://pmade.org) PGP [5137 173E 5BFA 8C63 8982 F035 FDBB 1636 7D69 C63F]
Peter Jones wrote:
Hey, remember back when Russell Mok said:
Try gcc 3.3.3. It fixed a problem related to weak symbol.
That fixed the wchar_t stuff. I still needed to hack the Jam file so that the gcc-Link-action action would link .so files with -pthread. [snip] I am sure there is a better way to do that, just not sure where in the gcc-tools.jam file would be the best place.
The gcc toolset is already adding the -pthread option when linking multi-threaded variants (lines 143-145). Are you saying you need to use -pthread even when linking single-threaded variants? -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
Hey, remember back when Rene Rivera said:
The gcc toolset is already adding the -pthread option when linking multi-threaded variants (lines 143-145). Are you saying you need to use -pthread even when linking single-threaded variants?
This is what "bjam -sTOOLS=gcc -sBUILD=release" produces without my change to gcc-tools.jam: gcc-Link-action bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/libboost_filesystem-gcc-1_31.so bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/libboost_filesystem-gcc-1_31.imp ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status LIBPATH=bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true:bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true:$LIBPATH export LIBPATH g++ -s -fPIC -shared -o "bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/libboost_filesystem-gcc-1_31.so" "bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/exception.o" "bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/operations_posix_windows.o" "bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/path_posix_windows.o" "bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/convenience.o" -- Peter Jones [unix;vi;crypto;c++;4wd] (http://pmade.org) PGP [5137 173E 5BFA 8C63 8982 F035 FDBB 1636 7D69 C63F]
Peter Jones wrote:
Hey, remember back when Rene Rivera said:
The gcc toolset is already adding the -pthread option when linking multi-threaded variants (lines 143-145). Are you saying you need to use -pthread even when linking single-threaded variants?
This is what "bjam -sTOOLS=gcc -sBUILD=release" produces without my change to gcc-tools.jam:
Which builds the release single-threaded variants.
gcc-Link-action bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/libboost_filesystem-gcc-1_31.so bin/boost/libs/filesystem/build/libboost_filesystem.so/gcc/release/shared-linkable-true/libboost_filesystem-gcc-1_31.imp ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
Is there a way to tell who is referencing those symbols? As it might not be Boost code but other runtime code. -- Something to try would be to compile an empty *.so. That is compile an empty source file and try doing a "-shared" link. If you get thread errors with an empty shared library, then the problem is that the GCC+AIX runtimes require threading. And I'll fix that on the toolset, and post a patch ;-) -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
Hey, remember back when Rene Rivera said:
Is there a way to tell who is referencing those symbols? As it might not be Boost code but other runtime code. -- Something to try would be to compile an empty *.so. That is compile an empty source file and try doing a "-shared" link. If you get thread errors with an empty shared library, then the problem is that the GCC+AIX runtimes require threading. And I'll fix that on the toolset, and post a patch ;-)
I generated a .so with void foo (void); void foo (void) { int x(1); x++; } and, using the same compiler flags that Jam is, was able to build the .so without the link errors. Very strange. I started over with a clean copy of boost_1_31_0 and build using: bjam -sTOOLS=gcc stage With the same sort of errors: gcc-Link-action bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/libboost_date_time-gcc-1_31.so bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/libboost_date_time-gcc-1_31.imp ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. collect2: ld returned 8 exit status LIBPATH=bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true:bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true:$LIBPATH export LIBPATH g++ -s -fPIC -shared -o "bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/libboost_date_time-gcc-1_31.so" "bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/greg_month.o" "bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/greg_weekday.o" "bin/boost/libs/date_time/build/libboost_date_time.so/gcc/release/shared-linkable-true/date_generators.o" This is what got built into the stage directory: libboost_date_time-gcc-1_31.a libboost_date_time-gcc-d-1_31.a libboost_date_time-gcc-d.a libboost_date_time-gcc-mt-1_31.a libboost_date_time-gcc-mt-1_31.so* libboost_date_time-gcc-mt-d-1_31.a libboost_date_time-gcc-mt-d-1_31.so* libboost_date_time-gcc-mt-d.a libboost_date_time-gcc-mt-d.so* libboost_date_time-gcc-mt.a libboost_date_time-gcc-mt.so* libboost_date_time-gcc.a libboost_filesystem-gcc-1_31.a libboost_filesystem-gcc-d-1_31.a libboost_filesystem-gcc-d.a libboost_filesystem-gcc-mt-1_31.a libboost_filesystem-gcc-mt-1_31.so* libboost_filesystem-gcc-mt-d-1_31.a libboost_filesystem-gcc-mt-d-1_31.so* libboost_filesystem-gcc-mt-d.a libboost_filesystem-gcc-mt-d.so* libboost_filesystem-gcc-mt.a libboost_filesystem-gcc-mt.so* libboost_filesystem-gcc.a libboost_prg_exec_monitor-gcc-1_31.a libboost_prg_exec_monitor-gcc-d-1_31.a libboost_prg_exec_monitor-gcc-d.a libboost_prg_exec_monitor-gcc-mt-1_31.a libboost_prg_exec_monitor-gcc-mt-d-1_31.a libboost_prg_exec_monitor-gcc-mt-d.a libboost_prg_exec_monitor-gcc-mt.a libboost_prg_exec_monitor-gcc.a libboost_regex-gcc-1_31.a libboost_regex-gcc-d-1_31.a libboost_regex-gcc-d.a libboost_regex-gcc-mt-1_31.a libboost_regex-gcc-mt-1_31.so* libboost_regex-gcc-mt-d-1_31.a libboost_regex-gcc-mt-d-1_31.so* libboost_regex-gcc-mt-d.a libboost_regex-gcc-mt-d.so* libboost_regex-gcc-mt.a libboost_regex-gcc-mt.so* libboost_regex-gcc.a libboost_signals-gcc-1_31.a libboost_signals-gcc-d-1_31.a libboost_signals-gcc-d.a libboost_signals-gcc-mt-1_31.a libboost_signals-gcc-mt-1_31.so* libboost_signals-gcc-mt-d-1_31.a libboost_signals-gcc-mt-d-1_31.so* libboost_signals-gcc-mt-d.a libboost_signals-gcc-mt-d.so* libboost_signals-gcc-mt.a libboost_signals-gcc-mt.so* libboost_signals-gcc.a libboost_test_exec_monitor-gcc-1_31.a libboost_test_exec_monitor-gcc-d-1_31.a libboost_test_exec_monitor-gcc-d.a libboost_test_exec_monitor-gcc-mt-1_31.a libboost_test_exec_monitor-gcc-mt-d-1_31.a libboost_test_exec_monitor-gcc-mt-d.a libboost_test_exec_monitor-gcc-mt.a libboost_test_exec_monitor-gcc.a libboost_thread-gcc-mt-1_31.so* libboost_thread-gcc-mt-d-1_31.so* libboost_thread-gcc-mt-d.so* libboost_thread-gcc-mt.so* libboost_unit_test_framework-gcc-1_31.a libboost_unit_test_framework-gcc-d-1_31.a libboost_unit_test_framework-gcc-d.a libboost_unit_test_framework-gcc-mt-1_31.a libboost_unit_test_framework-gcc-mt-d-1_31.a libboost_unit_test_framework-gcc-mt-d.a libboost_unit_test_framework-gcc-mt.a libboost_unit_test_framework-gcc.a And just for reference:
g++ -v Reading specs from /opt/gcc-3.3.3/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.3/specs Configured with: ../gcc-3.3.3/configure --prefix=/opt/gcc-3.3.3 --disable-nls --disable-libgcj --disable-shared --enable-languages=c,c++ --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-threads=aix Thread model: aix gcc version 3.3.3
Let me know if there is any other data I can get for you. -- Peter Jones [unix;vi;crypto;c++;4wd] (http://pmade.org) PGP [5137 173E 5BFA 8C63 8982 F035 FDBB 1636 7D69 C63F]
The gcc toolset is already adding the -pthread option when linking multi-threaded variants (lines 143-145). Are you saying you need to use -pthread even when linking single-threaded variants?
I suspect that AIX is one of those platforms where threading is on by default (even when <threading>multi is not specified), so yes -pthread will always be needed. John.
Has anyone had any success compiling the latest version of boost wholesale with GCC on AIX? Besides the annoying dynamic linking problems, I am also getting failed links for wchar_t stuff:
ld: 0711-317 ERROR: Undefined symbol: std::basic_string
, std::allocator >::_Rep::_S_terminal With:
Boost: 1.31.0 GCC: 3.3.2 AIX: 5.2
It might be a config issue if there's no std::wstring support in gcc 3.3.1 on AIX, however I would have expected compile time rather than link time errors in that case. In any case if you're not interested in wchar_t support in Boost code then you could try defining BOOST_NO_STD_WSTRING and see if that helps. Otherwise upgrading your gcc version might help as well. John.
participants (4)
-
John Maddock
-
Peter Jones
-
Rene Rivera
-
Russell Mok