The package can be built and/or 'pip install'ed under Python 3.10 and gcc 10.
However, trying to 'pip install' or build it from source under Python 3.10 and gcc 11 fails. This seems to be an issue with gcc 11 and/or optimization settings. I can NOT change the version of Python or gcc, since those are the only versions supported under OpenWrt 22.03.5.
Error log:
running bdist_wheel
running build
running build_py
running build_ext
building 'RPi._GPIO' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/c_gpio.c -o build/temp.linux-aarch64-cpython-310/source/c_gpio.o ""
source/c_gpio.c: In function 'setup':
source/c_gpio.c:170:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
170 | if ((uint32_t)gpio_mem % PAGE_SIZE)
| ^
source/c_gpio.c:171:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
171 | gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
| ^
gcc: warning: : linker input file unused because linking not done
gcc: error: : linker input file not found: No such file or directory
error: command '/usr/bin/gcc' failed with exit code 1
root@UAVroute:~/RPi.GPIO-0.7.1# gcc --version
gcc (OpenWrt GCC 11.2.0) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
root@UAVroute:~/RPi.GPIO-0.7.1# python --version
Python 3.10.12
root@UAVroute:~/RPi.GPIO-0.7.1# clear
root@UAVroute:~/RPi.GPIO-0.7.1# python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
running build_ext
building 'RPi._GPIO' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/c_gpio.c -o build/temp.linux-aarch64-cpython-310/source/c_gpio.o
source/c_gpio.c: In function 'setup':
source/c_gpio.c:170:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
170 | if ((uint32_t)gpio_mem % PAGE_SIZE)
| ^
source/c_gpio.c:171:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
171 | gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
| ^
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/common.c -o build/temp.linux-aarch64-cpython-310/source/common.o
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/constants.c -o build/temp.linux-aarch64-cpython-310/source/constants.o
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/cpuinfo.c -o build/temp.linux-aarch64-cpython-310/source/cpuinfo.o
source/cpuinfo.c: In function 'get_rpi_info':
source/cpuinfo.c:144:28: warning: format '%llx' expects argument of type 'long long unsigned int ', but argument 3 has type 'uint64_t ' {aka 'long unsigned int '} [-Wformat=]
144 | sscanf(revision, "%llx", &rev);
| ~~~^ ~~~~
| | |
| | uint64_t * {aka long unsigned int }
| long long unsigned int *
| %lx
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/event_gpio.c -o build/temp.linux-aarch64-cpython-310/source/event_gpio.o
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/Python-3.10.12=Python-3.10.12 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.2.0_musl/include -fPIC -I/usr/include/python3.10 -c source/py_gpio.c -o build/temp.linux-aarch64-cpython-310/source/py_gpio.o
during GIMPLE pass: ivopts
source/py_gpio.c: In function 'py_cleanup':
source/py_gpio.c:74:18: internal compiler error: Segmentation fault
74 | static PyObject py_cleanup(PyObject self, PyObject args, PyObject kwargs)
| ^~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See https://dev.openwrt.org/ for instructions.
error: command '/usr/bin/gcc' failed with exit code 1
root@UAVroute:~/RPi.GPIO-0.7.1# python setup.py bdist_wheel > build.txt
source/c_gpio.c: In function 'setup':
source/c_gpio.c:170:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
170 | if ((uint32_t)gpio_mem % PAGE_SIZE)
| ^
source/c_gpio.c:171:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
171 | gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
| ^
source/cpuinfo.c: In function 'get_rpi_info':
source/cpuinfo.c:144:28: warning: format '%llx' expects argument of type 'long long unsigned int ', but argument 3 has type 'uint64_t ' {aka 'long unsigned int '} [-Wformat=]
144 | sscanf(revision, "%llx", &rev);
| ~~~^ ~~~~
| | |
| | uint64_t * {aka long unsigned int }
| long long unsigned int *
| %lx
during GIMPLE pass: ivopts
source/py_gpio.c: In function 'py_cleanup':
source/py_gpio.c:74:18: internal compiler error: Segmentation fault
74 | static PyObject py_cleanup(PyObject self, PyObject args, PyObject kwargs)
| ^~~~~~~~~~