Re: [PATCH] x86/stackprotector: fix build failure with CONFIG_STACKPROTECTOR=n

From: Ard Biesheuvel
Date: Mon Mar 10 2025 - 18:19:27 EST


On Mon, 10 Mar 2025 at 22:44, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> Just to report this, bisection tomorrow unless someone figures it out in the
> meantime...
>
> This is 64-bit, allmodconfig, clang:
>
> clang --version
> Ubuntu clang version 15.0.7
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> InstalledDir: /usr/bin
>
> This guy:
>
> Ubuntu clang version 18.1.3 (1ubuntu1)
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> InstalledDir: /usr/bin
>
> on the other box builds fine.
>
> tip/master:
>
> commit bc6bc2e1d7fa7e950c5ffb1ddf19bbaf15ad8863 (HEAD, refs/remotes/tip/master)
> Merge: f00b8d0b903a 72dafb567760
> Author: Ingo Molnar <mingo@xxxxxxxxxx>
> Date: Mon Mar 10 21:57:15 2025 +0100
>
> Merge branch into tip/master: 'x86/sev'
>
> # New commits in x86/sev:
> 72dafb567760 ("x86/sev: Add missing RIP_REL_REF() invocations during sme_enable()")
>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
>
>
> vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x30: relocation to !ENDBR: .text+0x180475
> Absolute reference to symbol '__ref_stack_chk_guard' not permitted in .head.text
> make[3]: *** [arch/x86/Makefile.postlink:28: vmlinux] Error 1
> make[2]: *** [scripts/Makefile.vmlinux:77: vmlinux] Error 2
> make[2]: *** Deleting file 'vmlinux'
> make[1]: *** [/home/amd/kernel/linux/Makefile:1234: vmlinux] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:251: __sub-make] Error 2
>

I tried building allmodconfig from the same commit using

$ clang-15 -v
Debian clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

but it does not reproduce for me.

$ make LLVM=-15 bzImage -j100 -s
drivers/spi/spi-amd.o: warning: objtool: amd_set_spi_freq() falls
through to next function amd_spi_busy_wait()
vmlinux.o: warning: objtool: screen_info_fixup_lfb+0x562: stack state
mismatch: reg1[12]=-2-48 reg2[12]=-1+0
vmlinux.o: warning: objtool: set_ftrace_ops_ro+0x30: relocation to
!ENDBR: .text+0x17f535

and no error.

Could you capture the output of

objdump -dr .tmp_vmlinux2 --section .head.text

and share it somewhere please?