Skip to content

pip install fails on AIX #160

Open

Description

@shubhamhii

Pip install is failing on AIX due to undefined symbol.
Log:

building '_cffi_backend' extension
creating build/temp.aix-7105-9988-64-cpython-39
creating build/temp.aix-7105-9988-64-cpython-39/src
creating build/temp.aix-7105-9988-64-cpython-39/src/c
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -O2 -Wall -I/opt/freeware/include -I/usr/include -DAIX_GENUINE_CPLUSCPLUS -D_ALL_SOURCE -D_LINUX_SOURCE_COMPAT -I/opt/freeware/include -I/usr/include -DAIX_GENUINE_CPLUSCPLUS -D_ALL_SOURCE -D_LINUX_SOURCE_COMPAT -maix64 -I/usr/local/include -I/opt/freeware/include -DFFI_BUILDING=1 -DUSE__THREAD -I/opt/freeware/include -I/opt/freeware/include/python3.9 -c src/c/_cffi_backend.c -o build/temp.aix-7105-9988-64-cpython-39/src/c/_cffi_backend.o
src/c/_cffi_backend.c: In function 'cdata_call':
src/c/_cffi_backend.c:3240:30: warning: comparison of integer expressions of different signedness: 'Py_ssize_t' {aka 'long int'} and 'long unsigned int' [-Wsign-compare]
 3240 |         if (fresult->ct_size < sizeof(ffi_arg))
      |                              ^
In file included from src/c/cffi1_module.c:20,
                 from src/c/_cffi_backend.c:8027:
src/c/call_python.c: In function 'cffi_call_python':
src/c/call_python.c:203:28: warning: implicit declaration of function '__lwsync' [-Wimplicit-function-declaration]
  203 | #   define read_barrier()  __lwsync()
      |                            ^~~~~~~~
src/c/call_python.c:252:5: note: in expansion of macro 'read_barrier'
  252 |     read_barrier();
      |     ^~~~~~~~~~~~
/opt/freeware/lib64/python3.9/config-3.9/ld_so_aix gcc -maix64 -fPIC -pthread -O2 -bI:/opt/freeware/lib64/python3.9/config-3.9/python.exp -L/opt/freeware/lib/pthread -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib/pthread:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib -L/opt/freeware/lib/pthread -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib/pthread:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib -L/opt/freeware/lib64 -L/opt/freeware/lib -lgcc -maix64 -I/usr/local/include -I/opt/freeware/include build/temp.aix-7105-9988-64-cpython-39/src/c/_cffi_backend.o -L/opt/freeware/lib64 -L/opt/freeware/lib64 -lffi -o build/lib.aix-7105-9988-64-cpython-39/_cffi_backend.cpython-39.so
ld: 0711-317 ERROR: Undefined symbol: .__lwsync

Activity

  1. added 2 commits that reference this issue on Apr 4, 2025
    79685ec
    55b8aff
  2. arigo commented on Apr 4, 2025

    @arigo
    Contributor

    This function comes from a block a few lines above that was copied from somewhere long ago:

    ...
    # if defined(HAVE_SYNC_SYNCHRONIZE)
    #   define read_barrier()  __sync_synchronize()
    # elif defined(_AIX)
    #   define read_barrier()  __lwsync()
    ...
    

    Apparently you're using a C compiler (is that really gcc?) that for some reason doesn't have either __sync_synchronize() nor __lwsync(). Or maybe it does have __sync_synchronize() but the HAVE_SYNC_SYNCHRONIZE is not defined for some reason?

  3. shubhamhii commented on Apr 8, 2025

    @shubhamhii
    Author

    Hi,

    Thanks for the suggestion. By including HAVE_SYNC_SYNCHRONIZE in CFLAGS we are able to build with pip.
    However, we are able to build without setting explicitly HAVE_SYNC_SYNCHRONIZE in setup.py build.

    Regards,
    Shubham

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions