kraj / meta-clang

Clang C/C++ cross compiler and runtime for OpenEmbedded/Yocto Project
MIT License
153 stars 198 forks source link

clang: ToolChains/Gnu.cpp: search also in lib32 #851

Closed shr-project closed 1 year ago

shr-project commented 1 year ago

Draft, because this is still just part of the fix, now the GCC installation is found, but the default libdir still doesn't allow to find Scrt1.o or libgcc_s.so.

    FAILED: cmTC_7752d 
    : && /OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --target=arm-oemllib32-linux-gnueabi --sysroot=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot -target arm-oemllib32-linux-gnueabi  -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64  --sysroot=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types   -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -target arm-oemllib32-linux-gnueabi  -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64  --sysroot=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native=  -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++   -fuse-ld=lld -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed   -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native=  -Wl,-z,relro,-z,now -unwindlib=libgcc -rtlib=libgcc -stdlib=libstdc++   -fuse-ld=lld CMakeFiles/cmTC_7752d.dir/testCCompiler.c.o -o cmTC_7752d   && :
    arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open Scrt1.o: No such file or directory
    arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crti.o: No such file or directory
    arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s
    arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lc
    arm-oemllib32-linux-gnueabi-ld.lld: error: unable to find library -lgcc_s
    arm-oemllib32-linux-gnueabi-ld.lld: error: cannot open crtn.o: No such file or directory
    clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.

I've tried to add:

-DLLVM_LIBDIR_SUFFIX=${@d.getVar('BASELIB').replace('lib', '')}

because of:

clang/CMakeLists.txt:set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
clang/CMakeLists.txt:set(CLANG_INSTALL_LIBDIR_BASENAME "lib${CLANG_LIBDIR_SUFFIX}")

which seems to be added to default search paths in most places.

I've added it to native build as well (it was only in target build - just to verify, because we don't want to have different clang-native for different MACHINEs with different BASELIB (lowercase baselib is set to "lib" in native.bbclass).

But that also doesn't work well:

    FAILED: CMakeFiles/cmTC_640df.dir/testCCompiler.c.o 
    /OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang   -target arm-oemllib32-linux-gnueabi  -march=armv7ve -mthumb -mfpu=neon-vfpv4 -mfloat-abi=softfp -mlittle-endian --dyld-prefix=/usr -Qunused-arguments -funwind-tables -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64  --sysroot=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot  -O2 -pipe -g -feliminate-unused-debug-types   -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fmacro-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot=  -fdebug-prefix-map=/OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native= -o CMakeFiles/cmTC_640df.dir/testCCompiler.c.o -c /OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build/CMakeFiles/CMakeScratch/TryCompile-ZZX0oo/testCCompiler.c
    /OE/lge/build/apollo/nanbield/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang: error while loading shared libraries: libclang-cpp.so.16: cannot open shared object file: No such file or directory
    ninja: build stopped: subcommand failed.
shr-project commented 1 year ago

http://errors.yoctoproject.org/Errors/Build/170648/

reproduced with just oe-core + meta-clang and:

oe-core $ cat openembedded-core/meta/conf/machine/qemuarm64-multilib.conf 
#@TYPE: Machine
#@NAME: QEMU ARMv8 machine
#@DESCRIPTION: Machine configuration for running an ARMv8 system on QEMU

require qemuarm64.conf

MACHINEOVERRIDES .= ":qemuarm64"

require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE:virtclass-multilib-lib32 = "armv7at-neon"

LIB32_PREFIX = "lib32-"

# Set 64-bit libs path to lib instead of lib64
# and 32-bit libs path to lib32 instead of lib
# It will have more advantages to use /lib, /lib32 instead of /lib, /lib64 in webOS platform
BASELIB = "lib32"
BASE_LIB:tune-aarch64 = "lib"
BASE_LIB:tune-aarch64_be = "lib"
BASE_LIB:tune-aarch64_le = "lib"
shr-project commented 1 year ago

Before this PR:

martin@jama /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build $ /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --verbose
clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
Target: arm-oemllib32-linux-gnueabi
Thread model: posix
InstalledDir: /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi
martin@jama /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build $ /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/
bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang --verbose --gcc-install-dir=/OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-lin
ux-gnueabi/13.2.0/
clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
Target: arm-oemllib32-linux-gnueabi
Thread model: posix
InstalledDir: /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi
Selected GCC installation: /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0
Candidate multilib: .;@m32
Selected multilib: .;@m32
martin@jama /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build $ /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/
bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang -print-search-dirs
programs: =/OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi:/OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/li
b32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin
libraries: =/OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/lib/clang/16:/OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16
.0.6/recipe-sysroot-native/usr/bin/../lib/arm-oemllib32-linux-gnueabi:/lib/../lib:/usr/lib/../lib:/lib:/usr/lib
martin@jama /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build $ /OE/build/oe-core/tmp-glibc/work/armv7at2-neon-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/
bin/arm-oemllib32-linux-gnueabi/arm-oemllib32-linux-gnueabi-clang -print-runtime-dir
/usr/lib/clang/16.0.6/lib/linux
shr-project commented 1 year ago

with x86 and such mulilib setting it seemingly works, but uses GCC installation from host not target sysroot:

martin@jama /OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6 $ ./recipe-sysroot-native/usr/bin/i686-oemllib32-linux/i686-oemllib32-linux-clang --verbose
clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
Target: i686-oemllib32-linux
Thread model: posix
InstalledDir: /OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6/./recipe-sysroot-native/usr/bin/i686-oemllib32-linux
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/13
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: 32;@m32
martin@jama /OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6 $ ./recipe-sysroot-native/usr/bin/i686-oemllib32-linux/i686-oemllib32-linux-clang -print-search-dirs
programs: =/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6/./recipe-sysroot-native/usr/bin/i686-oemllib32-linux:/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6/recipe-sysroot-n
ative/usr/bin:/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin
libraries: =/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/lib/clang/16:/OE/build/oe-core/tmp-glibc/work/i586-oemllib32-linux/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin
/../lib/i686-oemllib32-linux:/usr/lib/gcc/x86_64-pc-linux-gnu/13/32:/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/lib:/lib:/usr/lib
shr-project commented 1 year ago

Latest version builds libcompiler-rt fine and finds right libs:

InstalledDir: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/arm-oemllib32-linux-gnueabi
Found candidate GCC installation: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0
Selected GCC installation: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0
 "/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/bin/clang-16" -cc1 -triple thumbv7ve-oemllib32-linux-gnueabi -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-v
erifier -discard-value-names -main-file-name testCCompiler.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=1 -target-cpu generic
 -target-feature +soft-float-abi -target-feature +vfp2 -target-feature +vfp2sp -target-feature +vfp3 -target-feature +vfp3d16 -target-feature +vfp3d16sp -target-feature +vfp3sp -target-feature +fp16 -target-feature +vfp4 -target-feature +
vfp4d16 -target-feature +vfp4d16sp -target-feature +vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature +fp64 -target-feature +
d32 -target-feature +neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-abi aapcs-linux -mfloat-abi soft -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-t
uning=gdb -v -fcoverage-compilation-dir=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt -resource-dir /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/u
sr/lib/clang/16 -dependency-file testCCompiler.c.o.d -MT testCCompiler.c.o -sys-header-deps -D _FORTIFY_SOURCE=2 -D _TIME_BITS=64 -D _FILE_OFFSET_BITS=64 -isysroot /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-
rt/16.0.6/lib32-recipe-sysroot -internal-isystem /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/lib/clang/16/include -internal-isystem /TOPDIR/BUILD/work/raspberrypi4_64-oemll
ib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/local/include -internal-isystem /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gn
ueabi/13.2.0/../../../arm-oemllib32-linux-gnueabi/include -internal-externc-isystem /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/include -internal-externc-isystem /TOPDIR/BUILD/w
ork/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/include -fmacro-prefix-map=/TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix
-map=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fmacro-prefix-map=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0
.6/lib32-recipe-sysroot= -source-date-epoch 1302044400 -O2 -Wformat -Wformat-security -Werror=format-security -Werror=return-type -fdebug-compilation-dir=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt -fdebug
-prefix-map=/TOPDIR/BUILD/work-shared/llvm-project-source-16.0.6-r0/git=/usr/src/debug/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/build=/usr/src/debug
/lib32-compiler-rt/16.0.6-r0 -fdebug-prefix-map=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot= -fdebug-prefix-map=/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-
compiler-rt/16.0.6/recipe-sysroot-native= -ferror-limit 19 -stack-protector 2 -fno-signed-char -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o testCCompiler.c.o -x c /TOPDIR/BUILD/work/raspb
errypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/testCCompiler.c
ignoring nonexistent directory "/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/local/include"
ignoring nonexistent directory "/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../arm-oemllib32-linux-gnueabi/include"
ignoring nonexistent directory "/TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/include"
 /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/recipe-sysroot-native/usr/lib/clang/16/include
 /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/include
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/Scrt1.o
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/crti.o
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/crtbeginS.o
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/libgcc.a
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/libgcc_s.so
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/libgcc_s.so.1
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/libgcc.a
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/libc.so
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/libc.so.6
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/libc_nonshared.a
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/ld-linux.so.3
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/libgcc.a
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/libgcc_s.so
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/libgcc_s.so.1
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/libgcc.a
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/crtendS.o
arm-oemllib32-linux-gnueabi-ld.lld: /TOPDIR/BUILD/work/raspberrypi4_64-oemllib32-linux-gnueabi/lib32-compiler-rt/16.0.6/lib32-recipe-sysroot/usr/lib32/arm-oemllib32-linux-gnueabi/13.2.0/../../../lib32/crtn.o

Will keep it in my branch for a bit longer to test full image build and also build with arm and aarch64 without multilib to see if there are some unexpected side-effects.

shr-project commented 1 year ago

lgtm. Can you also port them to clang-17 which is in yoe/mut branch releasing in a weeks time

I've checked that the issue is still reproducible with clang-17: lib32-compiler-rt-17.0.0-r0 do_configure: http://errors.yoctoproject.org/Errors/Details/736239/

lib32-libclc-17.0.0-r0 do_compile: http://errors.yoctoproject.org/Errors/Details/736240/

The same changes work for clang-17, I've cherry-picked them on top of yoe/mut and pushed to jansa/mut (or your yoe/mut branch rebased on top of this PR as jansa/lib32-clang-17)