From patchwork Thu Jan 14 21:04:30 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: 1426680 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=8.43.85.97; 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=fcq0C4/K; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4DGxdn2yl2z9sVn for ; Fri, 15 Jan 2021 08:04:45 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00E853951443; Thu, 14 Jan 2021 21:04:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00E853951443 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1610658281; bh=tKetC23CfJukxUTHtdBUDKUSzK0Lc+ILgROqU7SdRDc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fcq0C4/KBcS2ispa/dGA7hbRFhbk8Z/3IAk0sSpgr5tXXMu6cZPpaN/3EOPB8yL1/ ihVuhPsKe/8B5nnB6fdoaEKQWTl8tAhSbZOky/e8B1885sZR0uqVV9sqQblhKmnwLC geXLMo5zpMNToF9GMDqH8PRkq9s5o/GdzK/dkGDk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id AD29C3951443 for ; Thu, 14 Jan 2021 21:04:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AD29C3951443 Received: by mail-pl1-x630.google.com with SMTP id y8so3551959plp.8 for ; Thu, 14 Jan 2021 13:04:37 -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:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tKetC23CfJukxUTHtdBUDKUSzK0Lc+ILgROqU7SdRDc=; b=OBw+DQANjYbg/fiBIDQ5m+E/BP59hvvAYJlgOPBC3djCADSSqNXVodm4w3o9MKZQ8H u/Azk4O9pkc/mETF4Rt6aua9PNjM+x/I4uVH2K7Ca/rPFtHc9DpSgOAdyPm9Sg+lXFq6 Vk47KA72YqJWukro4Z1qgvwwCyU/F0WTJV3EnYi5fFwzfK3C93rwFb6Lq2C8hzrdzo4W LC3rB0CQOFMDEOOmPREH4j50zxGiWp0bsqXgRku5ZT8E1P2yXsWD4YLmsKTQqxNpav5k SmuWteL1YsAld+sOvWqXfBUjd3OjmbLvjs5OLFCGiGWbjcXFRKbUi7nBjXd3ITetTbe5 D6nQ== X-Gm-Message-State: AOAM5334cwlsu/1oEVEJ6ACQxRRcZuW8Cwvpf9+b9otRb8UaOhxg7V/S wiv0njF/NxEgcMtFBO18pYX3xtpBQEI= X-Google-Smtp-Source: ABdhPJzaxXqZ3rwfUtI1oUtZ5liA8iHsZ/UjChuNlaIx7Be4JdhLNq3/enW8RiHi/KNPyZCqy9hVng== X-Received: by 2002:a17:902:b109:b029:de:5aaa:e258 with SMTP id q9-20020a170902b109b02900de5aaae258mr4488221plr.75.1610658276329; Thu, 14 Jan 2021 13:04:36 -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 u12sm6332274pgi.91.2021.01.14.13.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 13:04:35 -0800 (PST) Received: from gnu-cfl-2.localdomain (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 2F18E1A08F3; Thu, 14 Jan 2021 13:04:34 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/3] Build x86 libgomp with -march=i486 or better Date: Thu, 14 Jan 2021 13:04:30 -0800 Message-Id: <20210114210431.463242-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210114210431.463242-1-hjl.tools@gmail.com> References: <20210114210431.463242-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3038.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, POKER_BODY, 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" Cc: Jakub Jelinek , Uros Bizjak Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" If x86 libgomp isn't compiled with -march=i486 or better, append -march=i486 XCFLAGS for x86 libgomp build. PR target/70454 * configure.tgt (XCFLAGS): Append -march=i486 to compile x86 libgomp if needed. --- libgomp/configure.tgt | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index 1863287fa0d..83b5f92727d 100644 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -73,28 +73,24 @@ if test x$enable_linux_futex = xyes; then ;; # Note that bare i386 is not included here. We need cmpxchg. - i[456]86-*-linux*) + i[456]86-*-linux* | x86_64-*-linux*) config_path="linux/x86 linux posix" - case " ${CC} ${CFLAGS} " in - *" -m64 "*|*" -mx32 "*) - ;; - *) - if test -z "$with_arch"; then - XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" + # Need i486 or better. + cat > conftestx.c < /dev/null 2>&1; then + if test "${target_cpu}" = x86_64; then + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" + else + XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}" fi - esac - ;; - - # Similar jiggery-pokery for x86_64 multilibs, except here we - # can't rely on the --with-arch configure option, since that - # applies to the 64-bit side. - x86_64-*-linux*) - config_path="linux/x86 linux posix" - case " ${CC} ${CFLAGS} " in - *" -m32 "*) - XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" - ;; - esac + fi + rm -f conftestx.c conftestx.o ;; # Note that sparcv7 and sparcv8 is not included here. We need cas.