]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
syslinux: Use -idirafter to add back path for system stdarg.h
authorKhem Raj <raj.khem@gmail.com>
Mon, 24 Mar 2025 16:33:41 +0000 (09:33 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 26 Mar 2025 18:45:14 +0000 (18:45 +0000)
commit40413233429ceb902d8eb30ccc56aa7a182db772
treeaff2b129329bdd7102f0c2bb9b337ce0256edb32
parent565bfe5d2af9fe8d70886d5ac529d62dd0bc055c
syslinux: Use -idirafter to add back path for system stdarg.h

syslinux uses -nostdinc to build freestanding, which makes sense, however
it also tried to latch its own copy of stdarg.h to include system stdarg.h
via "include_next" compiler magic, so it poses to provide own stdarg.h but
then secretly include system version behind the scenes :)

It uses -nostdinc -iwithprefix include

hoping that gcc is uses and gcc has its include-fixed abstraction which
also contains stdarg.h so in the end it will find a version of stdarg.h
from system (even though it is from the compiler install ) and things will
work.

On musl, include-fixed is not expected and system includes are simplified
so that everyone can look into <sysroot>/usr/include to find them. This
can throw syslinux compilation into problems as now it does not find
the header from -iprefix and ends up with errors like

/mnt/b/yoe/master/sources/poky/build/tmp/work/core2-32-poky-linux-musl/syslinux/6.04-pre2/syslinux-6.04-pre2/com32/lib/../include/stdarg.h:9:15: fatal error: stdarg.h: No such file or directory
    9 | #include_next <stdarg.h>
      |               ^~~~~~~~~~
compilation terminated.

Therefore, we use -idirafter to point it into target sysroot as fallback
for system headers if it needs them, its added at the very last in search
order. It also keeps working with glibc based toolchains as usual and
also works with musl toolchains.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb