Fix build fail when add option "-fstack-protector-all"

When using canary check with "-fstack-protector-all" option. It causes a configure
error in systemd-boot when meson.build executes compile simple code to test linker option
"-static-pie" because -nolibstd option prevents using libc. It need for
canary to provide some function as "__stack_chk_guard". So need to turn off
canary check when compile sanity check.
This commit is contained in:
Duy Nguyen Van
2025-10-07 13:09:19 +09:00
committed by Zbigniew Jędrzejewski-Szmek
parent e867eeaf2b
commit 7ae7c014c3

View File

@@ -207,7 +207,7 @@ efi_c_ld_args = [
]
linker_sanity_code = 'void a(void) {}; void _start(void) { a(); }'
linker_sanity_args = ['-nostdlib', '-Wl,--fatal-warnings']
linker_sanity_args = ['-nostdlib', '-Wl,--fatal-warnings', '-fno-stack-protector']
# Check if libgcc is available and then use it. It is needed for gcc builds
# and for ia32 builds with clang.