We tried to compile official protobuf example on AIX7.1 with gcc8, the protobuf uses pthread and we encountered missing symbol problem
$ ./add_person_cpp
exec(): 0509-036 Cannot load program add_person_cpp because of the following errors:
0509-130 Symbol resolution failed for /opt/freeware/lib64/libprotobuf.a[libprotobuf.so.30] because:
0509-136 Symbol _ZSt11__once_call (number 10) is not exported from
dependent module /opt/freeware/lib64/libstdc++.a[libstdc++.so.6].
0509-136 Symbol _ZSt15__once_callable (number 11) is not exported from
dependent module /opt/freeware/lib64/libstdc++.a[libstdc++.so.6].
0509-136 Symbol __once_proxy (number 21) is not exported from
dependent module /opt/freeware/lib64/libstdc++.a[libstdc++.so.6].
0509-192 Examine .loader section symbols with the
'dump -Tv' command.
We have checked the libstdc++.a and found there are two libstdc++.a in the lib/gcc/powerpc-ibm-aix*/ directory
$ ls -ls /opt/freeware/lib64/libstdc++.a
0 lrwxrwxrwx 1 root system 53 Sep 01 15:10 /opt/freeware/lib64/libstdc++.a@ -> ../lib/gcc/powerpc-ibm-aix7.1.0.0/8/ppc64/libstdc++.a*
This problem could be solved by providing another pthread library with LIBPATH
$ LIBPATH=/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/pthread ./add_person_cpp
Usage: ./add_person_cpp ADDRESS_BOOK_FILE
We are curious that "Is it safe to use the pthread/libstdc++.a to replace the original ppc64/libstdc++.a in /opt/freeware/lib64?"
------------------------------
yy
------------------------------