<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 211: Unable to build with gcc 11 - Segmentation fault</title><link>https://sourceforge.net/p/raspberry-gpio-python/tickets/211/</link><description>Recent changes to 211: Unable to build with gcc 11 - Segmentation fault</description><atom:link href="https://sourceforge.net/p/raspberry-gpio-python/tickets/211/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 22 Jun 2023 22:00:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/raspberry-gpio-python/tickets/211/feed.rss" rel="self" type="application/rss+xml"/><item><title>Unable to build with gcc 11 - Segmentation fault</title><link>https://sourceforge.net/p/raspberry-gpio-python/tickets/211/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The package can be built and/or 'pip install'ed under Python 3.10 and gcc 10.&lt;br/&gt;
However, trying to 'pip install' or build it from source under Python 3.10 and &lt;strong&gt;gcc 11 fails&lt;/strong&gt;. 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 &lt;strong&gt;OpenWrt 22.03.5&lt;/strong&gt;.&lt;br/&gt;
Error log:&lt;/p&gt;
&lt;p&gt;running bdist_wheel&lt;br/&gt;
running build&lt;br/&gt;
running build_py&lt;br/&gt;
running build_ext&lt;br/&gt;
building 'RPi._GPIO' extension&lt;br/&gt;
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 ""&lt;br/&gt;
source/c_gpio.c: In function 'setup':&lt;br/&gt;
source/c_gpio.c:170:9: warning: cast from pointer to integer of different size &lt;span&gt;[-Wpointer-to-int-cast]&lt;/span&gt;&lt;br/&gt;
  170 |     if ((uint32_t)gpio_mem % PAGE_SIZE)&lt;br/&gt;
      |         ^&lt;br/&gt;
source/c_gpio.c:171:34: warning: cast from pointer to integer of different size &lt;span&gt;[-Wpointer-to-int-cast]&lt;/span&gt;&lt;br/&gt;
  171 |         gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);&lt;br/&gt;
      |                                  ^&lt;br/&gt;
gcc: warning: : linker input file unused because linking not done&lt;br/&gt;
gcc: error: : linker input file not found: No such file or directory&lt;br/&gt;
error: command '/usr/bin/gcc' failed with exit code 1&lt;br/&gt;
root@UAVroute:~/RPi.GPIO-0.7.1# gcc --version&lt;br/&gt;
gcc (OpenWrt GCC 11.2.0) 11.2.0&lt;br/&gt;
Copyright (C) 2021 Free Software Foundation, Inc.&lt;br/&gt;
This is free software; see the source for copying conditions.  There is NO&lt;br/&gt;
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;
&lt;p&gt;root@UAVroute:~/RPi.GPIO-0.7.1# python --version&lt;br/&gt;
Python 3.10.12&lt;br/&gt;
root@UAVroute:~/RPi.GPIO-0.7.1# clear&lt;br/&gt;
root@UAVroute:~/RPi.GPIO-0.7.1# python setup.py bdist_wheel&lt;br/&gt;
running bdist_wheel&lt;br/&gt;
running build&lt;br/&gt;
running build_py&lt;br/&gt;
running build_ext&lt;br/&gt;
building 'RPi._GPIO' extension&lt;br/&gt;
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&lt;br/&gt;
source/c_gpio.c: In function 'setup':&lt;br/&gt;
source/c_gpio.c:170:9: warning: cast from pointer to integer of different size &lt;span&gt;[-Wpointer-to-int-cast]&lt;/span&gt;&lt;br/&gt;
  170 |     if ((uint32_t)gpio_mem % PAGE_SIZE)&lt;br/&gt;
      |         ^&lt;br/&gt;
source/c_gpio.c:171:34: warning: cast from pointer to integer of different size &lt;span&gt;[-Wpointer-to-int-cast]&lt;/span&gt;&lt;br/&gt;
  171 |         gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);&lt;br/&gt;
      |                                  ^&lt;br/&gt;
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&lt;br/&gt;
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&lt;br/&gt;
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&lt;br/&gt;
source/cpuinfo.c: In function 'get_rpi_info':&lt;br/&gt;
source/cpuinfo.c:144:28: warning: format '%llx' expects argument of type 'long long unsigned int &lt;em&gt;', but argument 3 has type 'uint64_t &lt;/em&gt;' {aka 'long unsigned int &lt;em&gt;'} &lt;span&gt;&lt;span&gt;[-Wformat=]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;
  144 |       sscanf(revision, "%llx", &amp;amp;rev);&lt;br/&gt;
      |                         ~~~^   ~~~~&lt;br/&gt;
      |                            |   |&lt;br/&gt;
      |                            |   uint64_t * {aka long unsigned int &lt;/em&gt;}&lt;br/&gt;
      |                            long long unsigned int *&lt;br/&gt;
      |                         %lx&lt;br/&gt;
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&lt;br/&gt;
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&lt;br/&gt;
during GIMPLE pass: ivopts&lt;br/&gt;
source/py_gpio.c: In function 'py_cleanup':&lt;br/&gt;
source/py_gpio.c:74:18: internal compiler error: Segmentation fault&lt;br/&gt;
   74 | static PyObject &lt;em&gt;py_cleanup(PyObject &lt;/em&gt;self, PyObject &lt;em&gt;args, PyObject &lt;/em&gt;kwargs)&lt;br/&gt;
      |                  ^~~~~~~~~~&lt;br/&gt;
Please submit a full bug report,&lt;br/&gt;
with preprocessed source if appropriate.&lt;br/&gt;
See &lt;a href="https://dev.openwrt.org/" rel="nofollow"&gt;https://dev.openwrt.org/&lt;/a&gt; for instructions.&lt;br/&gt;
error: command '/usr/bin/gcc' failed with exit code 1&lt;br/&gt;
root@UAVroute:~/RPi.GPIO-0.7.1# python setup.py bdist_wheel &amp;gt; build.txt&lt;br/&gt;
source/c_gpio.c: In function 'setup':&lt;br/&gt;
source/c_gpio.c:170:9: warning: cast from pointer to integer of different size &lt;span&gt;[-Wpointer-to-int-cast]&lt;/span&gt;&lt;br/&gt;
  170 |     if ((uint32_t)gpio_mem % PAGE_SIZE)&lt;br/&gt;
      |         ^&lt;br/&gt;
source/c_gpio.c:171:34: warning: cast from pointer to integer of different size &lt;span&gt;[-Wpointer-to-int-cast]&lt;/span&gt;&lt;br/&gt;
  171 |         gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);&lt;br/&gt;
      |                                  ^&lt;br/&gt;
source/cpuinfo.c: In function 'get_rpi_info':&lt;br/&gt;
source/cpuinfo.c:144:28: warning: format '%llx' expects argument of type 'long long unsigned int &lt;em&gt;', but argument 3 has type 'uint64_t &lt;/em&gt;' {aka 'long unsigned int &lt;em&gt;'} &lt;span&gt;&lt;span&gt;[-Wformat=]&lt;/span&gt;&lt;/span&gt;&lt;br/&gt;
  144 |       sscanf(revision, "%llx", &amp;amp;rev);&lt;br/&gt;
      |                         ~~~^   ~~~~&lt;br/&gt;
      |                            |   |&lt;br/&gt;
      |                            |   uint64_t * {aka long unsigned int &lt;/em&gt;}&lt;br/&gt;
      |                            long long unsigned int *&lt;br/&gt;
      |                         %lx&lt;br/&gt;
during GIMPLE pass: ivopts&lt;br/&gt;
source/py_gpio.c: In function 'py_cleanup':&lt;br/&gt;
source/py_gpio.c:74:18: internal compiler error: Segmentation fault&lt;br/&gt;
   74 | static PyObject &lt;em&gt;py_cleanup(PyObject &lt;/em&gt;self, PyObject &lt;em&gt;args, PyObject &lt;/em&gt;kwargs)&lt;br/&gt;
      |                  ^~~~~~~~~~&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bug Menot</dc:creator><pubDate>Thu, 22 Jun 2023 22:00:31 -0000</pubDate><guid>https://sourceforge.net5afb5f61ecba884de0d8b364c25ecbdbe26ab8d5</guid></item></channel></rss>