[Buildroot] [PATCH] package/kvm-unit-tests: disable SSP

Matthew Weber matthew.weber at collins.com
Fri Aug 20 13:32:32 UTC 2021


kvm-unit-tests shouldn't use stack-protector as the test suite is
building free standing binaries to test QEMU. There is no guarantee
that GCC has set a spec to filter out stack protector enabling with
-ffreestanding so disabling explicitly to prevent a series of build
failures.

Fixes:
http://autobuild.buildroot.net/results/780/780c8c70ea7015113714cbd3841d96b08bd2f2aa/

Signed-off-by: Matthew Weber <matthew.weber at collins.com>
---
 package/kvm-unit-tests/kvm-unit-tests.mk | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/package/kvm-unit-tests/kvm-unit-tests.mk b/package/kvm-unit-tests/kvm-unit-tests.mk
index 2637066701..23241b453a 100644
--- a/package/kvm-unit-tests/kvm-unit-tests.mk
+++ b/package/kvm-unit-tests/kvm-unit-tests.mk
@@ -35,15 +35,14 @@ KVM_UNIT_TESTS_CONF_OPTS =\
 # compiler. However, for x86-64, we use the host compiler, as
 # kvm-unit-tests builds 32 bit code, which Buildroot toolchains for
 # x86-64 cannot do.
-ifeq ($(BR2_x86_64),y)
-# Arch Linux adds -fstack-protector even when building with -ffreestanding, but
-# it doesn't link with the stack-protector library when -nostdlib is passed,
-# which leads to a link error. Therefore, disable it explicitly to work around
-# this bug in Arch Linux. https://bugs.archlinux.org/task/64270
-KVM_UNIT_TESTS_MAKE_OPTS += EXTRA_CFLAGS=-fno-stack-protector
-else
+ifneq ($(BR2_x86_64),y)
 KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)"
 endif
+# kvm-unit-tests shouldn't use stack-protector as the test suite is building
+# free standing binaries to test QEMU. There is no guarantee that GCC has
+# set a spec to filter out stack protector enabling with -ffreestanding so
+# disabling explicitly to prevent a series of build failures.
+KVM_UNIT_TESTS_MAKE_OPTS += EXTRA_CFLAGS=-fno-stack-protector
 
 define KVM_UNIT_TESTS_CONFIGURE_CMDS
 	cd $(@D) && ./configure $(KVM_UNIT_TESTS_CONF_OPTS)
-- 
2.17.1



More information about the buildroot mailing list