Skip to contentSkip to conversation

tclibc-baremetal.inc: fix gcc-cross EXTRA_OECONF

PATCH In review Joerg Vehlow 3 participants 4 messages Sep 29 – Oct 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tclibc-baremetal.inc: fix gcc-cross EXTRA_OECONF

Using EXTRA_OECONF:pn-gcc-cross-${TARGET_ARCH}:append created a new override for EXTRA_OECONF, which led to almost all EXTRA_OECONF switches to be ignored. Furthermore, setting --without-headers here is not required, because it is set in gcc-cross.inc.

---
 meta/conf/distro/include/tclibc-baremetal.inc | 1 -
 1 file changed, 1 deletion(-)
meta/conf/distro/include/tclibc-baremetal.inc +0 -1
index abea5a7162..6043cb6654 100644
@@ -18,7 +18,6 @@ USE_NLS ?= "no"
 IMAGE_LINGUAS = ""
 LIBC_DEPENDENCIES = ""
 
-EXTRA_OECONF:pn-gcc-cross-${TARGET_ARCH}:append = " --without-headers"
 DEPENDS:remove:pn-meta-toolchain = "virtual/libc virtual/compilerlibs"
 
 # certain compiler libs cannot be used without libc, avoid the dependence on compilerlibs
#1 lore raw
Quoted 4 lines · Joerg Vehlow via lists.openembedded.org

Using EXTRA_OECONF:pn-gcc-cross-${TARGET_ARCH}:append created a new override for EXTRA_OECONF, which led to almost all EXTRA_OECONF switches to be ignored. Furthermore, setting --without-headers here is not required, because it is set in gcc-cross.inc.

I fully realize this change has good intentions, but it actually breaks baremetal. We've been trying to debug this for the past couple of days.

While we run our baremetal in a multiconfig, you don't need that to reproduce the breakage only with OE-Core by adding these 2 lines to local.conf:

TCLIBC = "baremetal"
MACHINE = "qemuarm"

$ bitbake libgcc
| checking whether we are using the GNU C compiler... yes
| checking whether arm-oe-eabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 -no-pie -fno-PIE --sysroot=/OE/core-master/build/tmp/work/cortexa15t2hf-neon-oe-eabi/libgcc/16.2.0/recipe-sysroot accepts -g... yes
| checking for arm-oe-eabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 -no-pie -fno-PIE --sysroot=/OE/core-master/build/tmp/work/cortexa15t2hf-neon-oe-eabi/libgcc/16.2.0/recipe-sysroot option to accept ISO C89... unsupported
| checking how to run the C preprocessor... arm-oe-eabi-gcc -E --sysroot=/OE/core-master/build/tmp/work/cortexa15t2hf-neon-oe-eabi/libgcc/16.2.0/recipe-sysroot  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 -no-pie -fno-PIE
| configure: error: in `/OE/core-master/build/tmp/work/cortexa15t2hf-neon-oe-eabi/libgcc/16.2.0/gcc-16.2.0/build.arm-oe-eabi.arm-oe-eabi/libgcc':
| configure: error: C preprocessor "arm-oe-eabi-gcc -E --sysroot=/OE/core-master/build/tmp/work/cortexa15t2hf-neon-oe-eabi/libgcc/16.2.0/recipe-sysroot  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a15 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 -no-pie -fno-PIE" fails sanity check
| See `config.log' for more details

Reverting this single commit restores the working behavior.

I don't see anything suspicious in the config.log yet, but I'll keep digging.

Here's EXTRA_OECONF for gcc-cross-arm before and after the change:

EXTRA_OECONF=" \
--without-headers \
--disable-static \
--disable-nls \
--enable-initfini-array \
--without-headers \
"

EXTRA_OECONF=" \
--enable-clocale=generic \
--with-gnu-ld \
--enable-shared \
--enable-languages=c,c++ \
--disable-multilib \
--enable-default-pie \
--enable-c99 \
--enable-long-long \
--enable-symvers=gnu \
--enable-libstdcxx-pch \
--program-prefix=arm-oe-eabi- \
--without-local-prefix \
--disable-install-libiberty \
--disable-libssp \
--enable-libitm \
--enable-lto \
--disable-bootstrap \
--with-system-zlib \
--with-linker-hash-style=sysv \
--enable-linker-build-id \
--with-ppl=no \
--with-cloog=no \
--enable-checking=release \
--enable-cheaders=c_global \
--without-isl \
--with-gxx-include-dir=/not/exist/usr/include/c++/16.2.0 \
--with-gxx-libcxx-include-dir=/not/exist/usr/include/c++/v1 \
--with-sysroot=/not/exist \
--with-build-sysroot=/OE/core-master/build/tmp/work/x86_64-linux/gcc-cross-arm/16.2.0/recipe-sysroot \
--enable-poison-system-directories=error \
--with-system-zlib \
--disable-static \
--disable-nls \
--enable-initfini-array \
--without-headers \
"

Quoted 17 lines
---
 meta/conf/distro/include/tclibc-baremetal.inc | 1 -
 1 file changed, 1 deletion(-)
meta/conf/distro/include/tclibc-baremetal.inc +0 -1
index abea5a7162..6043cb6654 100644
@@ -18,7 +18,6 @@ USE_NLS ?= "no"
 IMAGE_LINGUAS = ""
 LIBC_DEPENDENCIES = ""
 
-EXTRA_OECONF:pn-gcc-cross-${TARGET_ARCH}:append = " --without-headers"
 DEPENDS:remove:pn-meta-toolchain = "virtual/libc virtual/compilerlibs"
 
 # certain compiler libs cannot be used without libc, avoid the dependence on compilerlibs
#2 lore raw
Quoted 14 lines · Denys Dmytriyenko
Quoted 6 lines · Joerg Vehlow via lists.openembedded.org

Using EXTRA_OECONF:pn-gcc-cross-${TARGET_ARCH}:append created a new override
for EXTRA_OECONF, which led to almost all EXTRA_OECONF switches to be ignored.
Furthermore, setting --without-headers here is not required, because it is set in gcc-cross.inc.

I fully realize this change has good intentions, but it actually breaks
baremetal. We've been trying to debug this for the past couple of days.

Quoted 6 lines

While we run our baremetal in a multiconfig, you don't need that to reproduce
the breakage only with OE-Core by adding these 2 lines to local.conf:

TCLIBC = "baremetal"
MACHINE = "qemuarm"

Sorry, please send a revert. I'd checked it looked like it did the right thing but it clearly doesn't. I suspect some "interesting" operator interaction :/

We may also want to consider better baremetal testing on the AB. I'm open to help with configs there...

Cheers,

Richard

#3 lore raw

Hi,

Quoted 10 lines · Richard Purdie
Quoted 9 lines · Denys Dmytriyenko
Quoted 6 lines · Joerg Vehlow via lists.openembedded.org

Using EXTRA_OECONF:pn-gcc-cross-${TARGET_ARCH}:append created a new override
for EXTRA_OECONF, which led to almost all EXTRA_OECONF switches to be ignored.
Furthermore, setting --without-headers here is not required, because it is set in gcc-cross.inc.

Quoted 4 lines
Quoted 4 lines

I fully realize this change has good intentions, but it actually breaks
baremetal. We've been trying to debug this for the past couple of days.

Sorry for the inconvenience.>>

Quoted 6 lines
Quoted 6 lines

While we run our baremetal in a multiconfig, you don't need that to reproduce
the breakage only with OE-Core by adding these 2 lines to local.conf:

TCLIBC = "baremetal"
MACHINE = "qemuarm"

We are building a baremetal multiconfig with a custom arm v7 machine and it was working without any problems (though not oe core master). I knew that this change severely changes the EXTRA_OECONF, but that was the whole point of the patch.>

Quoted 3 lines

Sorry, please send a revert. I'd checked it looked like it did the right thing but it clearly doesn't. I suspect some "interesting" operator interaction :/

Not really. The reason this has such a big impact is that

FOO = "foobar"
OVVERIDES = "bar"
FOO:bar:append = "foo"

results in FOO = "bar" instead of the expected FOO = "foobar foo".
But that must have been the original intention (and maybe) it was even what it was doing before the syntax change for overrides?

I would say the bug is no in the gcc recipe, which should remove all unsupported flags on baremetal, so the fix should be done there and not by reverting this patch. There is absolutely no reason to fiddle with EXTRA_OECONF in the baremetal config, when the recipe clearly also tries to accommodate baretmal.

Jörg

Quoted 7 lines

We may also want to consider better baremetal testing on the AB. I'm open to help with configs there...

Cheers,

Richard

Signature · 12 lines
emlix GmbH
Headquarters: Berliner Str. 12, 37073 Göttingen, Germany
Phone +49 (0)551 30664-0, e-mail [email protected]
District Court of Göttingen, Registry Number HR B 3160
Managing Directors: Heike Jordan, Dr. Uwe Kracke
VAT ID No. DE 205 198 055
Office Berlin: Panoramastr. 1, 10178 Berlin, Germany
Office Bonn: Bachstr. 6, 53115 Bonn, Germany
Office München: Am Knie 16, 81241 München, Germany
http://www.emlix.com

emlix - your embedded Linux partner