New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate callbr destination! #1163
Comments
So, both GCC and Clang will prevent duplicate label operands for void foo(void) {
asm goto (""::::bar, bar);
bar:;
} produces an error in both compilers. What is permitted though is: void foo(void) {
asm goto (""::::bar, baz);
bar:
baz:;
} For LLVM IR, it seems that we should be creating a new |
Interestingly, I'm not able to trigger this with upstream LLVM: diff --git a/build.config.common b/build.config.common
index c73f0e74cfa0..52a9984aa8a3 100644
--- a/build.config.common
+++ b/build.config.common
@@ -4,6 +4,7 @@ KMI_GENERATION=0
LLVM=1
DEPMOD=depmod
CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r383902/bin
+CLANG_PREBUILT_BIN=/android0/llvm-project/llvm/build/bin/clang
BUILDTOOLS_PREBUILT_BIN=build/build-tools/path/linux-x86
EXTRA_CMDS='' Instead, I hit:
So we succeed in linking vmlinux with LTO, but fail for a kernel module. That sounds like we might be closer to linking vmlinux 32b x86 with a newer compiler. cc @samitolvanen That looks like #579 aosp/1437431. Though I do have that applied, so I'm not immediately sure why we'd still see that error. I should still probably relax the constraint about duplicate destinations. It's not invalid IR, just stupid/inefficient. It kind of bakes in constraints from the source language which I don't like. |
I cannot reproduce this with the following diff on top of Linux 5.12 with i386_defconfig + diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2792879d398e..b653842e7d59 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -97,7 +97,7 @@ config X86
select ARCH_SUPPORTS_DEBUG_PAGEALLOC
select ARCH_SUPPORTS_NUMA_BALANCING if X86_64
select ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP if NR_CPUS <= 4096
- select ARCH_SUPPORTS_LTO_CLANG if X86_64
+ select ARCH_SUPPORTS_LTO_CLANG
select ARCH_SUPPORTS_LTO_CLANG_THIN if X86_64
select ARCH_USE_BUILTIN_BSWAP
select ARCH_USE_QUEUED_RWLOCKS Closing for now. |
@nathanchance want to send that diff upstream? |
Yes, further testing then sending that patch is on my TODO. |
Repro with:
Before building though, apply this hack:
At link time, you will see:
The text was updated successfully, but these errors were encountered: