From patchwork Tue Oct 31 14:43:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 739568 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c47:0:b0:32d:baff:b0ca with SMTP id n7csp1687354wrt; Tue, 31 Oct 2023 07:45:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkMmeYvqARnNbyr0rbXLY7/v8SLnt8uh3c9NU8VwERNiu8X+IWUHasLiwh7fwGX8MJJGxB X-Received: by 2002:a05:6102:43:b0:44e:a18a:2507 with SMTP id k3-20020a056102004300b0044ea18a2507mr8686750vsp.0.1698763537240; Tue, 31 Oct 2023 07:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698763537; cv=none; d=google.com; s=arc-20160816; b=1KjWAbq8Or+IxT1AsKMfb9I55cPmJrDHjki92QxnZdkkMQYsay5iI5BUfXG6RWe4G3 N6eIqfqb5tJnL3oOA6pqEiwYoNye/GOYChaC+7OHOD0Dn7aQ5cLlwkNsgo7fEXv+TM0s lzrkxJBqnoiY1WiYFjWCjT24PkFpM4qDBXs9IjsigC/ZqyNFzV0KpXC5W1loGh+XHHyT 3WC/Fh652w0J772rPSFnDH8L1Hxu2m8fg4M8o7scTX0sFtQCpwUXE6P5zUNTtsK/04je +fErVh4yUTMb34w2ZRZG8fzhv9zPbIo5QiUY7C+twsudec5++2zXPN580VWXiTpIdMDe aVKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VBmCb5e2KSRUeOU8FwFvpTBYbtI3zUNWAXQPSJyYVSE=; fh=FYzXcw++6WbBMpOt4qAKNi3fUDxUgdsi690bo+Nhaqg=; b=NvbjRKJn8DREe1dfImNBrB4lvgUem1Eld3kAUr08QUgWvW9c1zqQBI9hm0htSqhGhP 2gMd0vP1cch13qGKuwpY/nzbNTcMx4eijUfFkWObS+Yj8jU+V0Cz3ZNCrJPditEZ0XYw T407Sp8nTYI6xR4c1XLxlDkAYc4FK/SjU02CFoKdqoHj1WR4DpHwmYQ9s5AzlEZZrN1D CkjHGKYMn5uQ6n5hu/PiSqhvJd26L3vNvI/FKa5ypSTZlxSZQMXgMq4hXtBQkHMl3ChZ X/z0GlNJygAVj1oAUGWWDExlr+FRCS+JuQBN1KlTHUxtlcMKBvVG+wY+0sJLY5J7UTR/ 45Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U/Wy+vZd"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x23-20020a67c097000000b0045819ff7c91si148101vsi.561.2023.10.31.07.45.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Oct 2023 07:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="U/Wy+vZd"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxpyS-0004mP-Ds; Tue, 31 Oct 2023 10:44:08 -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 1qxpyR-0004lo-3Q for qemu-devel@nongnu.org; Tue, 31 Oct 2023 10:44:07 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxpyO-000275-UU for qemu-devel@nongnu.org; Tue, 31 Oct 2023 10:44:06 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-409299277bbso36855155e9.2 for ; Tue, 31 Oct 2023 07:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698763443; x=1699368243; 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=VBmCb5e2KSRUeOU8FwFvpTBYbtI3zUNWAXQPSJyYVSE=; b=U/Wy+vZdJqhkkf5FqGlY/lUpYWXBwZCSB6/B9bYBej6o8vCqPDBBFwNQ7PUxv1VCPb cxjYp235BO1bNxllLnvTjovoZJUixHGKcTMc/zKlyc1rdNFPtQ/fnfn8pt11j5VSl9Yf o552BHKwsuIJxW6W0WH6FnJ6zberaIPw3w0o/SxLZoRhhKmbA/UeFtmBSft1zsMyM8uP tR6gDXwSAnQRsSHqICTSpQeIQxSV0ZJBfF11b+9V9hEGvYKsC2h35tq3frwJYd6kYn+D SWmjfNjnq/417tWBHGTT+3C/mtIqLOIIvKghzgxr8LO8kaMeJbD7yZqdq5LTUIKaghob mPgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698763443; x=1699368243; 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=VBmCb5e2KSRUeOU8FwFvpTBYbtI3zUNWAXQPSJyYVSE=; b=w31Dmy2gO02kNc50tUaW8rsFUNm4UeU3lvnfb+DN3VipIvghSVLR8L6HIsjlP/Oyoq HjqOtTUeM0/pUNyM9EQeYKtDWDpzD/I9YE2Oj9OlYgqP28NNHcrzALpEhdH3Ac5G0Z8R lqrAyqelWu6cjT0cCwmS01ubUUh4SzDCPJMBKuP48ASXNF0QK8i550SQrPfioquP37xE tsstet3nWoV0y5ObR4NTdWDLCzndj4xPUE4WAYt/aj6MvJgX2h4I2xQHzIVfW5m2w6M6 suyK3cw4w2KFffBq8WQBF5AIa/UdW0Pt7Yjr109p+WxSQEUc3En4Jdnie/qdtXtCAmy0 1jHg== X-Gm-Message-State: AOJu0Ywp2rbOLzp+dOZmkRntKrewzEZNpluXWRvXR9xS2j7OClWo/T2x iCQa6XjWOcOkqT2jBU3lZu5Ahw== X-Received: by 2002:a05:6000:186d:b0:32f:83e4:50e7 with SMTP id d13-20020a056000186d00b0032f83e450e7mr6168650wri.12.1698763443109; Tue, 31 Oct 2023 07:44:03 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id dk6-20020a0560000b4600b0032f7f4089b7sm1673586wrb.43.2023.10.31.07.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 07:44:02 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0183C65722; Tue, 31 Oct 2023 14:44:02 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Peter Maydell , "Edgar E. Iglesias" , Brian Cain , Paolo Bonzini , Eduardo Habkost , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , qemu-arm@nongnu.org (open list:ARM TCG CPUs) Subject: [PULL 02/19] tests/tcg: Add -fno-stack-protector Date: Tue, 31 Oct 2023 14:43:44 +0000 Message-Id: <20231031144401.1238210-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231031144401.1238210-1-alex.bennee@linaro.org> References: <20231031144401.1238210-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée Message-Id: <20231029145033.592566-3-alex.bennee@linaro.org> 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=32 \ -* -O2 -static -o hello-mips hello-mips.c +* mipsel-linux-gcc -nostdlib -mno-abicalls -fno-PIC -fno-stack-protector \ +* -mabi=32 -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 += -ffreestanding +EXTRA_CFLAGS += -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 += bti-1 bti-3 -bti-1 bti-3: CFLAGS += -mbranch-protection=standard +bti-1 bti-3: CFLAGS += -fno-stack-protector -mbranch-protection=standard bti-1 bti-3: LDFLAGS += -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+=-mfpu=neon-vfpv4 # Basic Hello World ARM_TESTS = hello-arm -hello-arm: CFLAGS+=-marm -ffreestanding +hello-arm: CFLAGS+=-marm -ffreestanding -fno-stack-protector hello-arm: LDFLAGS+=-nostdlib # 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 = $(CC) -x assembler-with-cpp LD = $(CC) # we rely on GCC inline:ing the stuff we tell it to in many places here. -CFLAGS = -Winline -Wall -g -O2 -static +CFLAGS = -Winline -Wall -g -O2 -static -fno-stack-protector NOSTDFLAGS = -nostartfiles -nostdlib ASFLAGS += -mcpu=v10 -g -Wa,-I,$(SRC_PATH)/tests/tcg/cris/bare CRT_FILES = 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 = CFLAGS += -Wno-incompatible-pointer-types -Wno-undefined-internal -CFLAGS += -fno-unroll-loops +CFLAGS += -fno-unroll-loops -fno-stack-protector HEX_SRC=$(SRC_PATH)/tests/tcg/hexagon VPATH += $(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 += -cpu max # # hello-i386 is a barebones app # -hello-i386: CFLAGS+=-ffreestanding +hello-i386: CFLAGS+=-ffreestanding -fno-stack-protector hello-i386: LDFLAGS+=-nostdlib # 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=$(SRC_PATH)/tests/tcg/minilib MINILIB_SRCS=$(wildcard $(SYSTEM_MINILIB_SRC)/*.c) MINILIB_OBJS=$(patsubst $(SYSTEM_MINILIB_SRC)/%.c, %.o, $(MINILIB_SRCS)) -MINILIB_CFLAGS+=-nostdlib -ggdb -O0 +MINILIB_CFLAGS+=-nostdlib -fno-stack-protector -ggdb -O0 MINILIB_INC=-isystem $(SYSTEM_MINILIB_SRC) .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=hello-mips TESTS += $(MIPS_TESTS) -hello-mips: CFLAGS+=-mno-abicalls -fno-PIC -mabi=32 +hello-mips: CFLAGS+=-mno-abicalls -fno-PIC -fno-stack-protector -mabi=32 hello-mips: LDFLAGS+=-nostdlib endif