Message ID | 20250509115800.3929803-1-hongxu.jia@windriver.com |
---|---|
State | New |
Headers | show |
Series | compiler-rt-sanitizers, compiler-rt: skip for armv5 | expand |
On Fri, May 9, 2025 at 4:58 AM hongxu via lists.openembedded.org <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote: > > $ echo 'MACHINE = "qemuarmv5"' >> conf/local.conf > $ bitbake compiler-rt compiler-rt-sanitizers > ... > tmp/work-shared/llvm-project-source-20.1.2-r0/llvm-project-20.1.2.src/compiler-rt/lib/builtins/arm/sync-ops.h:22:2: error: #error DMB is only supported on ARMv6+ > | 22 | #error DMB is only supported on ARMv6+ > | | ^~~~~ > > Due to upstream commit [[compiler-rt][builtins] Move DMB definition > to syn-ops.h][1], compiler-rt cross-compile for ARMv5 fails. > > [1] https://github.com/llvm/llvm-project/commit/1c9415806ba6d0d48a160637eea7d1b70efaae69 > while it might be fine to have it disabled for armv5, I think there is a compilation problem we are seeing here due to misconfiguration. qemuarmv5 is using armv5te for DEFAULTTUNE which also shows up in -march=armv5te in TUNE_CCARGS, compiler-rt build system skips compiling the sync_fetch_and_* routines if its armv5te and those routines are the only one's using DMB macro, now I wonder why compiler-rt cmake thinks it should be compiling for armv7 as it seems to be the case here, perhaps we are missing to feed the right value through configure arguments to cmake. We are passing HOST_ARCH to -DCOMPILER_RT_DEFAULT_TARGET_ARCH=${HOST_ARCH} Perhaps it should be more qualified for qemuarmv5 case, it should be deduced from DEFAULTTUNE can you try building for qemuarmv5 using -DCOMPILER_RT_DEFAULT_TARGET_ARCH="${@bb.utils.contains('TUNE_FEATURES', 'armv5 thumb dsp', 'armv5te', '${HOST_ARCH}', d)}" if this works then we need to define it more comprehensively we will need similar mapping for armv4t and armv6 as well. > Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> > --- > meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 1 + > meta/recipes-devtools/clang/compiler-rt_git.bb | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb > index b3c4bfcffdc..8b591b757e3 100644 > --- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb > +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb > @@ -129,3 +129,4 @@ COMPATIBLE_HOST:libc-musl:x86-64 = "(.*)" > COMPATIBLE_HOST:libc-musl:riscv64 = "(.*)" > COMPATIBLE_HOST:libc-musl:riscv32 = "(.*)" > COMPATIBLE_HOST:libc-musl = "null" > +COMPATIBLE_HOST:armv5 = "null" > diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb > index 93928541273..d634c148508 100644 > --- a/meta/recipes-devtools/clang/compiler-rt_git.bb > +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb > @@ -119,3 +119,5 @@ BBCLASSEXTEND = "native nativesdk" > ALLOW_EMPTY:${PN} = "1" > > SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" > + > +COMPATIBLE_HOST:armv5 = "null" > -- > 2.34.1 > > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#216201): https://lists.openembedded.org/g/openembedded-core/message/216201 > Mute This Topic: https://lists.openembedded.org/mt/112897300/1997914 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com] > -=-=-=-=-=-=-=-=-=-=-=- >
diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index b3c4bfcffdc..8b591b757e3 100644 --- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb @@ -129,3 +129,4 @@ COMPATIBLE_HOST:libc-musl:x86-64 = "(.*)" COMPATIBLE_HOST:libc-musl:riscv64 = "(.*)" COMPATIBLE_HOST:libc-musl:riscv32 = "(.*)" COMPATIBLE_HOST:libc-musl = "null" +COMPATIBLE_HOST:armv5 = "null" diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb index 93928541273..d634c148508 100644 --- a/meta/recipes-devtools/clang/compiler-rt_git.bb +++ b/meta/recipes-devtools/clang/compiler-rt_git.bb @@ -119,3 +119,5 @@ BBCLASSEXTEND = "native nativesdk" ALLOW_EMPTY:${PN} = "1" SYSROOT_DIRS:append:class-target = " ${nonarch_libdir}" + +COMPATIBLE_HOST:armv5 = "null"
$ echo 'MACHINE = "qemuarmv5"' >> conf/local.conf $ bitbake compiler-rt compiler-rt-sanitizers ... tmp/work-shared/llvm-project-source-20.1.2-r0/llvm-project-20.1.2.src/compiler-rt/lib/builtins/arm/sync-ops.h:22:2: error: #error DMB is only supported on ARMv6+ | 22 | #error DMB is only supported on ARMv6+ | | ^~~~~ Due to upstream commit [[compiler-rt][builtins] Move DMB definition to syn-ops.h][1], compiler-rt cross-compile for ARMv5 fails. [1] https://github.com/llvm/llvm-project/commit/1c9415806ba6d0d48a160637eea7d1b70efaae69 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 1 + meta/recipes-devtools/clang/compiler-rt_git.bb | 2 ++ 2 files changed, 3 insertions(+)