From 7ae7c014c37ba1cc7948c1ab2db8a79091bb2cc0 Mon Sep 17 00:00:00 2001 From: Duy Nguyen Van Date: Tue, 7 Oct 2025 13:09:19 +0900 Subject: [PATCH] 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. --- src/boot/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/meson.build b/src/boot/meson.build index 61c8be218c..ee86af274e 100644 --- a/src/boot/meson.build +++ b/src/boot/meson.build @@ -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.