]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Fix build fail when add option "-fstack-protector-all"
authorDuy Nguyen Van <ngyenduy9271@gmail.com>
Tue, 7 Oct 2025 04:09:19 +0000 (13:09 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 13 Oct 2025 08:27:28 +0000 (10:27 +0200)
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

index 61c8be218cf01690d68b8264d4bebd86220f86e6..ee86af274eb657c17c08b539a136931f4f11f775 100644 (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.