Closed shr-project closed 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"
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
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
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.
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)
in some strange multilib configs we build lib32-image where 32bit libs are in /usr/lib32 and 64bit in /usr/lib64 but in such setup the clang search for GNU candidate installation doesn't check lib32 directory in sysroot and fails to find the installation there resulting in
lib32-compiler-rt build failure:
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.
I've tried to add:
because of:
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: