From patchwork Fri Dec 8 18:13:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 175991 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5632132vqy; Fri, 8 Dec 2023 10:13:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuIThmTDV43lLYheP0UsFLGCYVZR5m/xvjHx+r88XWuYfB/WwCG2s7ReM/mCe8itGXarTl X-Received: by 2002:a05:6a20:4417:b0:18f:97c:5b7a with SMTP id ce23-20020a056a20441700b0018f097c5b7amr455662pzb.72.1702059216221; Fri, 08 Dec 2023 10:13:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702059216; cv=none; d=google.com; s=arc-20160816; b=cOx7hVjlxekGxV/OEoPmSflPzmiZF50bqF+XQv4VNH7z7TvIgX3VUQbhYR/JySh6XM esb2DJliYHpZkc4cQZFitrwZ8NWzucgZS7/FE33rOSeASzmsxwdu+P5cFRXWSaqDKYt3 lydJ3LH1a9Yf3K3QxiY820GsGH/2kq9u/g2VrJsSAVQ7gDaWhNTjHJOGho7A7JaDJJrp Wjrhhi+v1dsWOxVk8C9LOAtunssHsslOxP2EY9mVwNVVD73lA1Yq8HArDKYkcIDrteJ6 NgcAJwKRioaQ0sHBpbA/65jVogmp5mdfwyPMsj6RgHT7Kz6akPXjT4jRV1NBCuKzT8HB KXtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=JgRl1YckNu9AO65EXo8Bm075gAidFqIf9saLES6tuQE=; fh=NdptIAQysOQlidYXeN2I+7Z8M3wdEdDWch6LHJ8uuCQ=; b=jFNQnWMttUAa37ITHRXjVg3R+STQ/E4EL9tlMYY9rrTdkYzzL3eyHAX3tzdfeBcztC Bt2Jd8vyB4WqyRQ0MKcFfbAK7U/uIjm/PpJC8D1Prr0pZLVF3avixL3MR0tJZLTdLVlr RU3Uvb7qiGMumobROm0PshNWKwCMP0CXyBWDAkkflcEOJb+QxW2WoYoG55zCmqSH5JYa ygu9/8m1uNqgMUDom8UejJtiG4VHGY4TIQpUQOwK2aFWdXGOI47LRrWxsRsi21Ulbxlj AHjLe5AfKZNV5wIybonvj4lDzrrxm1zvC32XSuhT7F0R3S5VOkgg6Nz474Ta2Pw2n5F5 GcZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NvuCypa6; dkim=neutral (no key) header.i=@linutronix.de header.b=VLCdbRZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id f21-20020a056a00239500b006cb8cf06613si1891119pfc.2.2023.12.08.10.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 10:13:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NvuCypa6; dkim=neutral (no key) header.i=@linutronix.de header.b=VLCdbRZb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id EE8928266386; Fri, 8 Dec 2023 10:13:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235972AbjLHSNO (ORCPT + 99 others); Fri, 8 Dec 2023 13:13:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574516AbjLHSM5 (ORCPT ); Fri, 8 Dec 2023 13:12:57 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F1F4E9; Fri, 8 Dec 2023 10:13:03 -0800 (PST) Date: Fri, 08 Dec 2023 18:13:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702059182; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JgRl1YckNu9AO65EXo8Bm075gAidFqIf9saLES6tuQE=; b=NvuCypa6ECU3uFtOiIQ6LVTsB142ORjYQLiX8vKY9mW+dwJGswDGx6YKwfPWPYmHnhcTkk zgYjXt/RGs2X1VJeB+TvsfUFD+E4aQ2g/YgkRuzrNHacft84YhlbUTUF/TW6QvrmMVJ0or 12n05BkeFXUD8Tqshvmvj9COjq63T8pAXU8GtzRv6m8jqNdXHL2/WW9gl/P6wlChnb2Ufd puvnK58JO2wLe9jMDTn3mtys9CsQ0IjoTL8ClwPt+XjqZvttac1hbFBzH8vi9IqWluwBtx uWWLq/zyzLElkS9OXe0Byl/iT3lAFnM+MHlLsFBso9AA/pcNwZv2Gena6JDhJg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702059182; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JgRl1YckNu9AO65EXo8Bm075gAidFqIf9saLES6tuQE=; b=VLCdbRZbcNsL2u6afzsgQRjrrJBs3ugMIc+PYBnfoq7TOgnwpDPWo5wdUtw4wC8/A+nm9f /RdJIuLWmpof3aDg== From: "tip-bot2 for Jo Van Bulck" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/sgx] selftests/sgx: Specify freestanding environment for enclave compilation Cc: Jo Van Bulck , Dave Hansen , Jarkko Sakkinen , Kai Huang , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <170205918152.398.15533995692034132041.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 08 Dec 2023 10:13:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784738444641976440 X-GMAIL-MSGID: 1784738444641976440 The following commit has been merged into the x86/sgx branch of tip: Commit-ID: 304b259e63b94c4f825e0648b33b15f8962955c7 Gitweb: https://git.kernel.org/tip/304b259e63b94c4f825e0648b33b15f8962955c7 Author: Jo Van Bulck AuthorDate: Thu, 05 Oct 2023 17:38:46 +02:00 Committer: Dave Hansen CommitterDate: Fri, 08 Dec 2023 10:05:27 -08:00 selftests/sgx: Specify freestanding environment for enclave compilation Use -ffreestanding to assert the enclave compilation targets a freestanding environment (i.e., without "main" or standard libraries). This fixes clang reporting "undefined reference to `memset'" after erroneously optimizing away the provided memset/memcpy implementations. Still need to instruct the linker from using standard system startup functions, but drop -nostartfiles as it is implied by -nostdlib. Signed-off-by: Jo Van Bulck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Acked-by: Kai Huang Link: https://lore.kernel.org/all/20231005153854.25566-6-jo.vanbulck%40cs.kuleuven.be --- tools/testing/selftests/sgx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile index dcdd04b..7eb890b 100644 --- a/tools/testing/selftests/sgx/Makefile +++ b/tools/testing/selftests/sgx/Makefile @@ -14,7 +14,7 @@ endif INCLUDES := -I$(top_srcdir)/tools/include HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC HOST_LDFLAGS := -z noexecstack -lcrypto -ENCL_CFLAGS += -Wall -Werror -static -nostdlib -nostartfiles -fPIC \ +ENCL_CFLAGS += -Wall -Werror -static -nostdlib -ffreestanding -fPIC \ -fno-stack-protector -mrdrnd $(INCLUDES) ENCL_LDFLAGS := -Wl,-T,test_encl.lds,--build-id=none