From nobody Wed Nov 27 15:40:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698489433; cv=none; d=zohomail.com; s=zohoarc; b=e6AuAmOjQLEFh0Gc6aXlkVTN5K2emM3slede++DBkcq5UPnSjKZECKK8doZned13C77thyfIMEllxQBzceK7j7SX9smqEcNYHDpMVwsJougGCCAyqC6dMwHDmqH0coJr7K0kHDIC9oGvWzQipSoMo388kT7hZX/9KSFcYopv5FA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698489433; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=maGo4SQ2Nh/uMnXYztWkxCmfjY3u1YXmSOVeK9kBr3c=; b=OpDWKYYyldD0Xhp0Hcbm3hkc4mR+gx+XiLi7Bi5FivHit7MpffiMBAAIPSBWLp9KfBwkkMCGTBEIbABdLOtN+jRSnJUyi32HtqIZ6MwITwxfl/ZqmJes6uDtlKEzfKkVb+Rrf6+zmyRBJC3d+ArujB5ONzQYjvGnCzds3OKhfEU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698489433890881.0230578216565; Sat, 28 Oct 2023 03:37:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwgdM-0006L5-1i; Sat, 28 Oct 2023 06:33:36 -0400 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 1qwgdF-0006El-FX for qemu-devel@nongnu.org; Sat, 28 Oct 2023 06:33:29 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwgd6-00038s-7f for qemu-devel@nongnu.org; Sat, 28 Oct 2023 06:33:29 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4083740f92dso22744745e9.3 for ; Sat, 28 Oct 2023 03:33:14 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y20-20020a1c4b14000000b0040588d85b3asm7021327wma.15.2023.10.28.03.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 03:33:13 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2E37F5F798; Sat, 28 Oct 2023 11:33:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698489193; x=1699093993; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=maGo4SQ2Nh/uMnXYztWkxCmfjY3u1YXmSOVeK9kBr3c=; b=BvCtYU81hoRd6YnGZtDkgSxAwQ6Qjd7EEKG16HQTINlyaALDCW0AeU+0pdPH/s+oG3 4ePw2bjVBYdLp/TLC3HELS6C0wPNIqn/SvMRClMt8I1IMj0JdpiH7btIGyCYD5gYVOca fAL3rHn4mYa35tmPs1B7Iw/JsVfbD5+geomBFtAFq0MNeLo+xmp4LD77QdEIEAUUziSq cKLnI1z/SVDoJRubaIdLjeodi1sUeVeSBQVe+xYUyZUDMy5FFdq4/J9btfA63o7r4YOf f4rpOBTPh5mBdCVNiXbgIt0Z1eiK31bTrcLd6CbjS4q1go3bWqo4XqED1N5e3PQvItIG 2jDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698489193; x=1699093993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=maGo4SQ2Nh/uMnXYztWkxCmfjY3u1YXmSOVeK9kBr3c=; b=I/Fbo31A+nX0o/ZqQ8Bvapzn9K2GL0FkS1tSNmMu3JVHkj07MbUy6R/G6i7x4LUj4n 5pSTyTcn+RtfhnaM4hBfXAI0lymwtnKHwhArreYVrnERbaFA3NtfAxWrb9L7dZNCfvEZ TIYXXHKgiFKXWED3Ol0eEYpzKWIP8HDQwdt3Yl+WxoQAsIlH4jeSZJswgvkN+amkDvuO ttF1p+49hT82b7T18Labu8UXQHUXm6Obabd5KHOdLSq09KPbAF+dYKIyGBBJS5uAhU3T vQqETD8WrKm/LnudHoeh9yMxcgHWf4MZdwSy3Ayqmy4hNusQe8TPw9wBjN1jkj3hHqUT v/HA== X-Gm-Message-State: AOJu0YwRJcEWuVPmAN6akrf9oS71s0evmyvU1Nw9tuGL5OLKYYaw3hMw aMNdDfXqMaRpoq51Z6nBFDaLUQ== X-Google-Smtp-Source: AGHT+IHVH7/HpmcT43Xx6v23xY/KY74bDdGKTB01AdWue0o0TBQm3NfGPmbiWoKutecEt9iWDYxSGw== X-Received: by 2002:a05:600c:4f55:b0:408:3707:b199 with SMTP id m21-20020a05600c4f5500b004083707b199mr4073665wmq.3.1698489193301; Sat, 28 Oct 2023 03:33:13 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Beraldo Leal , Mahmoud Mandour , Brian Cain , Paolo Bonzini , Warner Losh , Eduardo Habkost , Alexandre Iooss , "Edgar E. Iglesias" , Kyle Evans , qemu-arm@nongnu.org, Aleksandar Rikalo , Aurelien Jarno , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Wainer dos Santos Moschetta , Peter Maydell , Brad Smith , Jiaxun Yang , Thomas Huth , Akihiko Odaki Subject: [PATCH 02/17] tests/tcg: Add -fno-stack-protector Date: Sat, 28 Oct 2023 11:32:56 +0100 Message-Id: <20231028103311.347104-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231028103311.347104-1-alex.bennee@linaro.org> References: <20231028103311.347104-1-alex.bennee@linaro.org> 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698489435585100001 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] Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- tests/tcg/mips/hello-mips.c | 4 ++-- tests/tcg/Makefile.target | 2 +- tests/tcg/aarch64/Makefile.target | 2 +- tests/tcg/arm/Makefile.target | 2 +- tests/tcg/cris/Makefile.target | 2 +- tests/tcg/hexagon/Makefile.target | 2 +- tests/tcg/i386/Makefile.target | 2 +- tests/tcg/minilib/Makefile.target | 2 +- tests/tcg/mips/Makefile.target | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) 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 diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index f3a189c9d4..8cf65f68dd 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -123,7 +123,7 @@ else # For system targets we include a different Makefile fragment 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 62b38c792f..0c84b61ae0 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -53,7 +53,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 0038cef02c..3473f4619e 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 43587d2769..713e2a5b6c 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 87ed2c90b9..f839b2c0d5 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 fdf757c6ce..3dec7c6c42 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -35,7 +35,7 @@ run-test-aes: 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 --=20 2.39.2