Skip to contentSkip to conversation

package/gcc: fix powerpc toolchain issues

PATCH Applied Waldemar Brodkorb 2 participants 2 messages Aug 10, 2023 – Aug 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gcc: fix powerpc toolchain issues

Some of the powerpc CPU's supported by Buildroot are dual mode CPU's, which means 32 Bit and 64 Bit mode is supported.

See here the gcc documentation for details about --with-cpu-32:
https://gcc.gnu.org/install/configure.html

See here for a discussion on the musl mailinglist about the error:
https://inbox.vuxu.org/musl/[email protected]/

Fixes:
- http://autobuild.buildroot.net/results/450/4509d8cfb7d99beb4ef023f170490def1d90f92c
- http://autobuild.buildroot.net/results/654/6545a464d49f9f3c6740a5208cfad7f09ec4cb8b
- http://autobuild.buildroot.net/results/cf8/cf866d5320b069eb1e8b4f05e8e58de0ad2ec7b5

---

Thanks to Thomas Petazzoni for pointing me to the gcc docs and the --with-cpu-32 option via IRC.

---
 package/gcc/gcc.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/gcc/gcc.mk +8 -0
index 1ecbf7e9b4..3050229176 100644
@@ -225,9 +225,17 @@ endif
 ifneq ($(GCC_TARGET_FP32_MODE),)
 HOST_GCC_COMMON_CONF_OPTS += --with-fp-32="$(GCC_TARGET_FP32_MODE)"
 endif
+
+# musl/uClibc-ng does not work with biarch powerpc toolchains, we
+# need to configure gcc explicitely for 32 Bit for CPU's supporting
+# 64 Bit and 32 Bit
 ifneq ($(GCC_TARGET_CPU),)
+ifeq ($(BR2_powerpc),y)
+HOST_GCC_COMMON_CONF_OPTS += --with-cpu-32=$(GCC_TARGET_CPU)
+else
 HOST_GCC_COMMON_CONF_OPTS += --with-cpu=$(GCC_TARGET_CPU)
 endif
+endif
 
 ifneq ($(GCC_TARGET_FPU),)
 HOST_GCC_COMMON_CONF_OPTS += --with-fpu=$(GCC_TARGET_FPU)
Signature · 6 lines
2.39.2

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · On Thu, 10 Aug 2023 06:32:52 +0200 Waldemar Brodkorb <[email protected]> wrote:

Some of the powerpc CPU's supported by Buildroot are dual mode CPU's, which means 32 Bit and 64 Bit mode is supported.

See here the gcc documentation for details about --with-cpu-32:
https://gcc.gnu.org/install/configure.html

See here for a discussion on the musl mailinglist about the error:
https://inbox.vuxu.org/musl/[email protected]/

Quoted 7 lines

Fixes:
- http://autobuild.buildroot.net/results/450/4509d8cfb7d99beb4ef023f170490def1d90f92c
- http://autobuild.buildroot.net/results/654/6545a464d49f9f3c6740a5208cfad7f09ec4cb8b
- http://autobuild.buildroot.net/results/cf8/cf866d5320b069eb1e8b4f05e8e58de0ad2ec7b5

---

Applied to master with an improved commit log. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot