(ld): er full
  ld: 0711-318 ERROR: Undefined symbols were found.
          The following symbols are in error:
   Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}
                                RLD: Address  Section  Rld-type Referencing Symbol
   ----------------------------------------------------------------------------------------------
  ld: 0711-317 ERROR: Undefined symbol: .__lwsync
   .__lwsync                 [450]   ER PR src/c/_cffi_backend.c(build/temp.aix-7204-9988-64-cpython-311/src/c/_cffi_backend.o)
                                     00026dd0 .text    R_RBR    [1316]  <.cffi_call_python>
  ER: The return code is 8.
  collect2: error: ld returned 8 exit status
  error: command '/opt/pyenv/versions/3.11.3/lib/python3.11/config-3.11/ld_so_aix' failed with exit code 1
  [end of output]
 
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cffi
Failed to build cffi
ERROR: Could not build wheels for cffi, which is required to install pyproject.toml-based projects
error message for pip install cffi
------------------------------
Avinesh Benjamin
------------------------------
                                                
					
                                                    
        
                                                
				
                                                
                                                Original Message:
Sent: Tue September 09, 2025 04:32 AM
From: Avinesh Benjamin
Subject: AIX 7.2 install cffi, pyinstaller gives error when using gcc
Hi,
(venv) bash-5.2$ oslevel -s
7200-04-01-1939
I am using python 3.11.3 to create a venv, then pip install cffi and pip install pyinstaller.
The issue is when trying to install cffi I get an error for undefined symbol __lwsync, this is if I export CC=gcc
If export CC= IBM xlclang I dont get any error.
Similarly, for pyinstaller xlclang no error but for gcc I get an error saying to build bootloader and set --target 64 bit or 32 bit.
When using gcc I set cflags to have -maix64 OBJECT_MODE=64 and AR=ar -X64
The endgoal is to build a binary using pyinstaller
Is it safe to use IBM compiler as python has been built using gcc 10.3, and some other packages we use gets built fine using gcc
Is ABI from gcc and IBM compiler interoperable?
 
------------------------------
Avinesh Benjamin
------------------------------
#AIXOpenSource