You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build utils package on Gentoo, and I have following error:
/usr/bin/aarch64-unknown-linux-gnu-gcc` -O2 -pipe -march=native -flto -Wl,-O1 -Wl,--as-needed pinctrl/CMakeFiles/pinctrl.dir/pinctrl.c.o pinctrl/CMakeFiles/pinctrl.dir/gpiolib.c.o pinctrl/CMakeFiles/pinctrl.dir/util.c.o pinctrl/CMakeFiles/pinctrl.dir/gpiochip_bcm2835.c.o pinctrl/CMakeFiles/pinctrl.dir/gpiochip_bcm2712.c.o pinctrl/CMakeFiles/pinctrl.dir/gpiochip_rp1.c.o -o pinctrl/pinctrl && :
/usr/lib/gcc/aarch64-unknown-linux-gnu/13/../../../../aarch64-unknown-linux-gnu/bin/ld: /var/tmp/portage/dev-embedded/raspberrypi-utils-0_p20240203/temp/cc7W9zU1.ltrans0.ltrans.o: in function `gpio_find_chip':
<artificial>:(.text+0x630): undefined reference to `__start_gpiochips'
/usr/lib/gcc/aarch64-unknown-linux-gnu/13/../../../../aarch64-unknown-linux-gnu/bin/ld: <artificial>:(.text+0x634): undefined reference to `__start_gpiochips'
/usr/lib/gcc/aarch64-unknown-linux-gnu/13/../../../../aarch64-unknown-linux-gnu/bin/ld: <artificial>:(.text+0x63c): undefined reference to `__stop_gpiochips'
/usr/lib/gcc/aarch64-unknown-linux-gnu/13/../../../../aarch64-unknown-linux-gnu/bin/ld: <artificial>:(.text+0x640): undefined reference to `__stop_gpiochips'
collect2: error: ld returned 1 exit status
It seems like LTO forces to remove "gpiochips" section from files.
Following patch fixes the issue: lto-fix.patch by adding __attribute__((used)) to force gcc to keep necessary sections.
GCC's Link Time Optimisation feature can cause the link-to-register
feature of gpiolib to fail - without an explicit reference to the data
it is assumed to be unused, and dropped. Add the "used" attribute to
prevent this.
See: #75
Signed-off-by: Phil Elwell <[email protected]>
GCC's Link Time Optimisation feature can cause the link-to-register
feature of gpiolib to fail - without an explicit reference to the data
it is assumed to be unused, and dropped. Add the "used" attribute to
prevent this.
See: raspberrypi#75
Signed-off-by: Phil Elwell <[email protected]>
I'm trying to build
utils
package on Gentoo, and I have following error:It seems like LTO forces to remove "gpiochips" section from files.
Following patch fixes the issue: lto-fix.patch by adding
__attribute__((used))
to force gcc to keep necessary sections.Gentoo bug: https://bugs.gentoo.org/926264
The text was updated successfully, but these errors were encountered: