From patchwork Sat Jan 16 01:36:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1427440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=vdre+M+b; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DHgcz6RpHz9sWQ for ; Sat, 16 Jan 2021 12:36:33 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 28CC6398B440; Sat, 16 Jan 2021 01:36:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28CC6398B440 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1610760990; bh=lksM8BBwCPLIm0agpQPOiMDIMVhBx7PWPqrttPRvrTc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vdre+M+b27fOj7iH3YYIOO44tmBl/ePhRUjPrVTZRvxQQBJdI73GGh67nzxqQfscH OgusrsAY9WaR1o5YOGON9Dt7EGX3f/K6D54liUTMGWfclS+Ow60hB6A4kI/FqlUfh8 LYCySbLbilinvJyoeW4rwUJ4/HoREV3r4xNglj7o= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 92D153851C3C for ; Sat, 16 Jan 2021 01:36:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92D153851C3C Received: by mail-pf1-x42c.google.com with SMTP id 11so6601037pfu.4 for ; Fri, 15 Jan 2021 17:36:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=lksM8BBwCPLIm0agpQPOiMDIMVhBx7PWPqrttPRvrTc=; b=fy4kKdexnWfO24zDM5m38Vv505/gij95DQ5VYDg8rJJd3MOnoW/WIrbSSlT2VPR3JY 2E4EH09/hDe7UZkIRiYNpGbTuonYVNB1qGRuA6L2/Cgi3xsJy3PGbjS1aIogG247jbBQ uDzWYMtsmQFrSiiPPr9TpUw7ttyPmV3eMtqxIDF76xG/Mjy+zadFP91aM1kqX2262UBp Qdjkw8bVrabeOBejgmBPT47NshI2RQfng6BP1lkU5JB70g+7XgwA+Q8RAlGIqTZ0Tbv9 euIPg4FuaxH9iterll6gUs0j/qTCjgssaDFivbBY73xsdoFZTk+/tPYcYlPPJzRFtyQR +TRg== X-Gm-Message-State: AOAM532TF4nyzF+T9iv7k8vvOb2e6A/98EamJ0wXA+N/dg8IUUCF4ZLJ riQsOZphWt81FtzQbTiTefCjuJU6Auk= X-Google-Smtp-Source: ABdhPJzZKwJ/Av0VeCv8LOpaEH6J9+qglxef52NatZNiMTvxNCJ+C/6koeDYUej7PQDrXxopL4381w== X-Received: by 2002:a63:6806:: with SMTP id d6mr15292619pgc.205.1610760985065; Fri, 15 Jan 2021 17:36:25 -0800 (PST) Received: from gnu-cfl-2.localdomain (c-69-181-90-243.hsd1.ca.comcast.net. [69.181.90.243]) by smtp.gmail.com with ESMTPSA id w8sm5276264pjc.24.2021.01.15.17.36.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 17:36:24 -0800 (PST) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 350601A03E7 for ; Fri, 15 Jan 2021 17:36:22 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++-v3: Add -fcf-protection=none to -march=i486 Date: Fri, 15 Jan 2021 17:36:20 -0800 Message-Id: <20210116013620.248097-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-3039.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" -fcf-protection is automatically enabled in libstdc++ on Linux/x86. Starting from commit 77d372abec0fbf2cfe922e3140ee3410248f979e Author: H.J. Lu Date: Thu Jan 14 05:56:46 2021 -0800 x86: Error on -fcf-protection with incompatible target GCC issues an error on -fcf-protection with incompatible target: ... -fcf-protection ... libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc -m32 -O2 -g0 -fno-exceptions -fno-asynchronous-unwind-tables -march=i486 ... cc1plus: error: '-fcf-protection' is not compatible with this target FAIL: 29_atomics/atomic_flag/test_and_set/explicit-hle.cc (test for excess errors) Add -fcf-protection=none to -march=i486 to compile explicit-hle.cc. Checked it in as an obvious fix. * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc: Add -fcf-protection=none to -march=i486. --- .../29_atomics/atomic_flag/test_and_set/explicit-hle.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc index 0fd81709688..8ec46283208 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc @@ -1,6 +1,6 @@ // { dg-do compile { target i?86-*-* x86_64-*-* } } // { dg-options "-O2 -g0 -fno-exceptions -fno-asynchronous-unwind-tables" } -// { dg-additional-options "-march=i486" { target ia32 } } +// { dg-additional-options "-march=i486 -fcf-protection=none" { target ia32 } } // { dg-require-effective-target c++11 } // { dg-skip-if "scans fail with LTO" { lto } { "-flto" } } // { dg-final { scan-assembler-times "xacquire\|\.byte\[^\n\r]*0xf2" 14 } }