Originally posted by: bernardn
Hi Ayappan,
As of AIX 7.1, AIX system libraries like libc.a are thread-safe: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.genprogc/thread_safe_libraries.htm
On my AIX 7.2 system, libc_r.a is just a symbolic to libc.a. I guess the AIX team decided to take the performance hit for singled-threaded applications. Why not do the same for GCC?
Now, assuming we are stuck with these 2 GCC runtimes (pthread and non-threaded) for a while, what's the rule to set libpath correctly in a program?
If a program built with GCC links with libphread, then the first entry in its libpath should be /opt/freeware/lib/pthread? And if a program built with GCC does not link with libpthread, the first entry in the libpath should be /opt/freeware/lib?
However, if you check python, it links with libpthread and yet its libpath picks the non-threaded GCC runtime:
ldd /usr/bin/python
/usr/bin/python needs:
/opt/freeware/lib/libpython2.7.so
/opt/freeware/lib/libffi.a(libffi.so.6)
/opt/freeware/lib/libncurses.so
/opt/freeware/lib/libsqlite3.so
/opt/freeware/lib/libstdc++.a(libstdc++.so.6)
/opt/freeware/lib/libgcc_s.a(shr.o)
/usr/lib/libc.a(shr.o)
/usr/lib/librtl.a(shr.o)
/usr/lib/libdl.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libpthreads.a(shr_xpg5.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/unix
/usr/lib/libcrypt.a(shr.o)
Is this another bug?
Best regards,
Bernard