From f89943d822384e0454f77624dc0b92ac454af7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 9 Oct 2021 17:26:22 +0200 Subject: [PATCH] build/x86: also test the stack protector on x86 secondary arch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on x86, gcc emits a local reference to __stack_chk_fail_local which can only be provided by a static library. as we don't have a libroot_nonshared, we use libgcc from gcc, in which libssp_nonshared was merged, from version 8.3.0_2019_05_24-11. Change-Id: I22bf26dec5c1fe69a3915a923bd716a494f846ce Reviewed-on: https://review.haiku-os.org/c/haiku/+/4564 Reviewed-by: Jérôme Duval --- src/system/libroot/stubbed/libroot_stubs.c | 2 ++ src/tests/system/libroot/os/Jamfile | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/system/libroot/stubbed/libroot_stubs.c b/src/system/libroot/stubbed/libroot_stubs.c index bd06db4de3..6fcce6135c 100644 --- a/src/system/libroot/stubbed/libroot_stubs.c +++ b/src/system/libroot/stubbed/libroot_stubs.c @@ -2739,6 +2739,8 @@ void srand48() {} void srand48_r() {} void srandom() {} void srandom_r() {} +void __stack_chk_fail() {} +void __stack_chk_fail_local() {} void sscanf() {} void statvfs() {} void stime() {} diff --git a/src/tests/system/libroot/os/Jamfile b/src/tests/system/libroot/os/Jamfile index b6028376e9..91034ef79a 100644 --- a/src/tests/system/libroot/os/Jamfile +++ b/src/tests/system/libroot/os/Jamfile @@ -30,10 +30,14 @@ SimpleTest get_cpu_num_test : CCFLAGS += -fstack-protector ; -SimpleTest stack_protector_test : - stack_protector_test.c -; - +local architectureObject ; +for architectureObject in [ MultiArchSubDirSetup ] { + on $(architectureObject) { + SimpleTest [ MultiArchDefaultGristFiles stack_protector_test ] : + stack_protector_test.c + ; + } +} # Tell Jam where to find these sources