diff --git a/debian/changelog b/debian/changelog index 72ce7b1a..336ea732 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ llvm-toolchain-snapshot (1:18~++20231203101651+e3b3c91dd0bb-1~exp2) UNRELEASED; - armel: arm926ej-s. Addresses: #1056115. - armhf: cortex-a8. Thanks to Arnd Bergmann and Ard Biesheuvel for the fixes. + * Apply the proposed fix for D158491, build failure on mips64el, still + unreviewed upstream. Addresses: #1056116. -- Sylvestre Ledru Tue, 05 Dec 2023 07:43:43 +0100 diff --git a/debian/patches/D158491.diff b/debian/patches/D158491.diff new file mode 100644 index 00000000..1ce768e1 --- /dev/null +++ b/debian/patches/D158491.diff @@ -0,0 +1,53 @@ +see https://reviews.llvm.org/D158491, still unreviewed upstream + +--- a/compiler-rt/lib/interception/interception.h ++++ b/compiler-rt/lib/interception/interception.h +@@ -199,8 +199,9 @@ + ".type " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", %function\n" \ + SANITIZER_STRINGIFY(TRAMPOLINE(func)) ":\n" \ + SANITIZER_STRINGIFY(CFI_STARTPROC) "\n" \ +- SANITIZER_STRINGIFY(ASM_TAIL_CALL) " __interceptor_" \ +- SANITIZER_STRINGIFY(ASM_PREEMPTIBLE_SYM(func)) "\n" \ ++ C_ASM_TAIL_CALL(SANITIZER_STRINGIFY(TRAMPOLINE(func)), \ ++ "__interceptor_" \ ++ SANITIZER_STRINGIFY(ASM_PREEMPTIBLE_SYM(func))) "\n" \ + SANITIZER_STRINGIFY(CFI_ENDPROC) "\n" \ + ".size " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", " \ + ".-" SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n" \ +--- a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h +@@ -44,6 +44,8 @@ + + #if defined(__x86_64__) || defined(__i386__) || defined(__sparc__) + # define ASM_TAIL_CALL jmp ++#elif defined(__mips__) && __mips_isa_rev >= 6 ++# define ASM_TAIL_CALL bc + #elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || \ + defined(__powerpc__) || defined(__loongarch_lp64) + # define ASM_TAIL_CALL b +@@ -53,6 +55,25 @@ + # define ASM_TAIL_CALL tail + #endif + ++#if defined(__mips64) && __mips_isa_rev < 6 ++# define C_ASM_TAIL_CALL(tfunc, ifunc) \ ++ "lui $t8, %hi(%neg(%gp_rel(" tfunc ")))\n" \ ++ "daddu $t8, $t8, $t9\n" \ ++ "daddu $t8, $t8, %lo(%neg(%gp_rel(" tfunc ")))\n" \ ++ "ld $t9, %got_disp(" ifunc ")($t8)\n" \ ++ "jr $t9\n" ++#elif defined(__mips__) && __mips_isa_rev < 6 ++# define C_ASM_TAIL_CALL(tfunc, ifunc) \ ++ ".set noreorder\n" \ ++ ".cpload $t9\n" \ ++ ".set reorder\n" \ ++ "lw $t9, %got(" ifunc ")($gp)\n" \ ++ "jr $t9\n" ++#elif defined(ASM_TAIL_CALL) ++# define C_ASM_TAIL_CALL(tfunc, ifunc) \ ++ SANITIZER_STRINGIFY(ASM_TAIL_CALL) " " ifunc ++#endif ++ + #if defined(__ELF__) && defined(__x86_64__) || defined(__i386__) || \ + defined(__riscv) + # define ASM_PREEMPTIBLE_SYM(sym) sym@plt diff --git a/debian/patches/series b/debian/patches/series index dcad68f3..ddd0f6dd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -148,3 +148,4 @@ link-grpc.diff libclang-major-version-only.diff D148945-revert.diff arm32-defaults.diff +D158491.diff