From nobody Thu May 15 10:44:47 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1699538998311208.93344880550467; Thu, 9 Nov 2023 06:09:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r15g6-0006lZ-Cp; Thu, 09 Nov 2023 09:06:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r15dA-0005fv-N5; Thu, 09 Nov 2023 09:03:38 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r15d8-0006xA-8e; Thu, 09 Nov 2023 09:03:36 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5913931BE2; Thu, 9 Nov 2023 16:59:57 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 601B534519; Thu, 9 Nov 2023 16:59:49 +0300 (MSK) Received: (nullmailer pid 1462906 invoked by uid 1000); Thu, 09 Nov 2023 13:59:47 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Akihiko Odaki , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Michael Tokarev Subject: [Stable-7.2.7 42/62] tests/tcg: Add -fno-stack-protector Date: Thu, 9 Nov 2023 16:59:10 +0300 Message-Id: <20231109135933.1462615-42-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZM-MESSAGEID: 1699539001891100003 From: Akihiko Odaki A build of GCC 13.2 will have stack protector enabled by default if it was configured with --enable-default-ssp option. For such a compiler, it is necessary to explicitly disable stack protector when linking without standard libraries. Signed-off-by: Akihiko Odaki Message-Id: <20230731091042.139159-3-akihiko.odaki@daynix.com> [AJB: fix comment string typo] Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20231029145033.592566-3-alex.bennee@linaro.org> (cherry picked from commit 580731dcc87eb27a2b0dc20ec331f1ce51864c97) Signed-off-by: Michael Tokarev diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 14bc013181..368a053392 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -123,7 +123,7 @@ else # For softmmu targets we include a different Makefile fragement as the # build options for bare programs are usually pretty different. They # are expected to provide their own build recipes. -EXTRA_CFLAGS +=3D -ffreestanding +EXTRA_CFLAGS +=3D -ffreestanding -fno-stack-protector -include $(SRC_PATH)/tests/tcg/minilib/Makefile.target -include $(SRC_PATH)/tests/tcg/multiarch/system/Makefile.softmmu-target -include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile= .target index fc8d90ed69..a72578fccb 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -38,7 +38,7 @@ endif # bti-1 tests the elf notes, so we require special compiler support. ifneq ($(CROSS_CC_HAS_ARMV8_BTI),) AARCH64_TESTS +=3D bti-1 bti-3 -bti-1 bti-3: CFLAGS +=3D -mbranch-protection=3Dstandard +bti-1 bti-3: CFLAGS +=3D -fno-stack-protector -mbranch-protection=3Dstanda= rd bti-1 bti-3: LDFLAGS +=3D -nostdlib endif # bti-2 tests PROT_BTI, so no special compiler support required. diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index b3b1504a1c..6b69672fcf 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -12,7 +12,7 @@ float_madds: CFLAGS+=3D-mfpu=3Dneon-vfpv4 =20 # Basic Hello World ARM_TESTS =3D hello-arm -hello-arm: CFLAGS+=3D-marm -ffreestanding +hello-arm: CFLAGS+=3D-marm -ffreestanding -fno-stack-protector hello-arm: LDFLAGS+=3D-nostdlib =20 # IWMXT floating point extensions diff --git a/tests/tcg/cris/Makefile.target b/tests/tcg/cris/Makefile.target index 372287bd03..ea1053236f 100644 --- a/tests/tcg/cris/Makefile.target +++ b/tests/tcg/cris/Makefile.target @@ -30,7 +30,7 @@ AS =3D $(CC) -x assembler-with-cpp LD =3D $(CC) =20 # we rely on GCC inline:ing the stuff we tell it to in many places here. -CFLAGS =3D -Winline -Wall -g -O2 -static +CFLAGS =3D -Winline -Wall -g -O2 -static -fno-stack-protector NOSTDFLAGS =3D -nostartfiles -nostdlib ASFLAGS +=3D -mcpu=3Dv10 -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/bare CRT_FILES =3D crt.o sys.o diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile= .target index 96a4d7a614..1b2b26e843 100644 --- a/tests/tcg/hexagon/Makefile.target +++ b/tests/tcg/hexagon/Makefile.target @@ -19,7 +19,7 @@ EXTRA_RUNS =3D =20 CFLAGS +=3D -Wno-incompatible-pointer-types -Wno-undefined-internal -CFLAGS +=3D -fno-unroll-loops +CFLAGS +=3D -fno-unroll-loops -fno-stack-protector =20 HEX_SRC=3D$(SRC_PATH)/tests/tcg/hexagon VPATH +=3D $(HEX_SRC) diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index bafd8c2180..3aec3bba77 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -35,7 +35,7 @@ run-plugin-test-i386-adcox-%: QEMU_OPTS +=3D -cpu max # # hello-i386 is a barebones app # -hello-i386: CFLAGS+=3D-ffreestanding +hello-i386: CFLAGS+=3D-ffreestanding -fno-stack-protector hello-i386: LDFLAGS+=3D-nostdlib =20 # test-386 includes a couple of additional objects that need to be diff --git a/tests/tcg/minilib/Makefile.target b/tests/tcg/minilib/Makefile= .target index c821d2806a..af0bf54be9 100644 --- a/tests/tcg/minilib/Makefile.target +++ b/tests/tcg/minilib/Makefile.target @@ -12,7 +12,7 @@ SYSTEM_MINILIB_SRC=3D$(SRC_PATH)/tests/tcg/minilib MINILIB_SRCS=3D$(wildcard $(SYSTEM_MINILIB_SRC)/*.c) MINILIB_OBJS=3D$(patsubst $(SYSTEM_MINILIB_SRC)/%.c, %.o, $(MINILIB_SRCS)) =20 -MINILIB_CFLAGS+=3D-nostdlib -ggdb -O0 +MINILIB_CFLAGS+=3D-nostdlib -fno-stack-protector -ggdb -O0 MINILIB_INC=3D-isystem $(SYSTEM_MINILIB_SRC) =20 .PRECIOUS: $(MINILIB_OBJS) diff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target index 1a994d5525..5d17c1706e 100644 --- a/tests/tcg/mips/Makefile.target +++ b/tests/tcg/mips/Makefile.target @@ -14,6 +14,6 @@ MIPS_TESTS=3Dhello-mips =20 TESTS +=3D $(MIPS_TESTS) =20 -hello-mips: CFLAGS+=3D-mno-abicalls -fno-PIC -mabi=3D32 +hello-mips: CFLAGS+=3D-mno-abicalls -fno-PIC -fno-stack-protector -mabi=3D= 32 hello-mips: LDFLAGS+=3D-nostdlib endif diff --git a/tests/tcg/mips/hello-mips.c b/tests/tcg/mips/hello-mips.c index 4e1cf501af..38e22d00e3 100644 --- a/tests/tcg/mips/hello-mips.c +++ b/tests/tcg/mips/hello-mips.c @@ -5,8 +5,8 @@ * http://www.linux-mips.org/wiki/MIPSABIHistory * http://www.linux.com/howtos/Assembly-HOWTO/mips.shtml * -* mipsel-linux-gcc -nostdlib -mno-abicalls -fno-PIC -mabi=3D32 \ -* -O2 -static -o hello-mips hello-mips.c +* mipsel-linux-gcc -nostdlib -mno-abicalls -fno-PIC -fno-stack-protector \ +* -mabi=3D32 -O2 -static -o hello-mips hello-mips.c * */ #define __NR_SYSCALL_BASE 4000 --=20 2.39.2