I am building Python 3.11 into an Ubuntu Core Snap(craft.yaml). This for use within Greengrass (also part of same Snap). Running on a Raspberry CM4. During pip install of RPi.GPIO==0.7.1 I get a failure from gcc linker:
2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thio_bp_lab: stderr. gcc -pthread -shared -L/root/parts/python/install/usr/lib -L/root/parts/python/install/usr/lib/aarch64-linux-gnu -L/root/parts/python/install/usr/lib -L/root/parts/python/install/usr/lib/aarch64-linux-gnu -DCONFIG64 -L/snap/aws-iot-greengrass-v2/x1 build/temp.linux-aarch64-cpython-311/source/cgpio.o build/temp.linux-aarch64-cpython-311/source/common.o build/temp.linux-aarch64-cpython-311/source/constants.o build/temp.linux-aarch64-cpython-311/source/cpuinfo.o build/temp.linux-aarch64-cpython-311/source/eventgpio.o build/temp.linux-aarch64-cpython-311/source/pygpio.o build/temp.linux-aarch64-cpython-311/source/pypwm.o build/temp.linux-aarch64-cpython-311/source/softpwm.o -o build/lib.linux-aarch64-cpython-311/RPi/GPIO.cpython-311-aarch64-linux-gnu.so. {scriptName=services.com.thio.coredevice.thiobplab.lifecycle.run.Script, serviceName=com.thio.coredevice.thiobplab, currentState=RUNNING}
2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thiobplab: stderr. collect2: error: ld returned 1 exit status. {scriptName=services.com.thio.coredevice.thiobplab.lifecycle.run.Script, serviceName=com.thio.coredevice.thiobplab, currentState=RUNNING}
2025-02-27T16:24:49.551Z [WARN] (Copier) com.thio.coredevice.thiobplab: stderr. error: command '/snap/aws-iot-greengrass-v2/x1/usr/bin/gcc' failed with exit code 1. {scriptName=services.com.thio.coredevice.thio*
The main error appears to be the linker cannot find the libc_nonshared.a. I have found this library under /snap/aws-iot-greengrass-v2/x1/usr/lib in the snap -- however even though I added this under the -L option (using CFLAGS) I still get an error from ld cannot find /usr/lib/libc_nonshared.a
Help?