From patchwork Wed Mar 30 13:01:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 603356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qZnqb3CsDz9syq for ; Thu, 31 Mar 2016 00:02:34 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=P/VeFchg; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=qvuVPy9sQPPHBpDOPL/Hug39wnFd/ XZycbyooHcrIiUaGEON++0FR1k0kVGd1JJ3VMOXjjS/ZDaGaaNbrTRFtr9fO7frZ ScmydAMFLg9CT05XJWs7XWD2yT0OhC7rgAQ6ITW8n0vj8sld7o2b4KkqOw01J6Lu Fhtyev/8OQ9ADw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=/Gb/1K280pwIiMTNfECT7FNHlbY=; b=P/V eFchg/Vb8DaHi5qTFI9uiqcSdCydo37/dKblv8vdFepAo/oDsHl0I984kNiDdi8W d5yxU6Q5B6W046wuPxNDUFnyMb7wkQR/Ad1t7TbD+iUmeyE1f7KBWXavey6dSv06 mxP/+PhqkkwCEQWks3U3TjwtuOHKVP886SUSZLtM= Received: (qmail 36971 invoked by alias); 30 Mar 2016 13:02:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 36951 invoked by uid 89); 30 Mar 2016 13:02:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=XCFLAGS, xcflags, i486, target_cpu X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Mar 2016 13:02:14 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 30 Mar 2016 06:01:33 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.218]) by orsmga001.jf.intel.com with ESMTP; 30 Mar 2016 06:01:32 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id AC40220010A; Wed, 30 Mar 2016 06:01:32 -0700 (PDT) Date: Wed, 30 Mar 2016 06:01:32 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: ubizjak@gmail.com Subject: [PATCH] PR target/70454: Check --with-arch=/--with-arch-32= for 32-bit x86 libatomic library Message-ID: <20160330130132.GA18988@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) If --with-arch-32= is used to configure GCC, it should be used to compile 32-bit x86 libatomic library. Since --with-arch for 64-bit > i486, we can use it for 32-bit target library. Tested on x86-64, with and without --with-arch=. OK for stage 1? H.J. --- PR target/70454 * configure.tgt: Use --with-arch=/--with-arch-32= for 32-bit x86 target library. --- libatomic/configure.tgt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index c5470d7..345c02b 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -83,8 +83,12 @@ case "${target_cpu}" in x86_64) case " ${CC} ${CFLAGS} " in *" -m32 "*) - XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" - XCFLAGS="${XCFLAGS} -fomit-frame-pointer" + # Since --with-arch for 64-bit > i486, we can use it for + # for 32-bit. + if test -z "$with_arch_32" && test -z "$with_arch"; then + XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic" + XCFLAGS="${XCFLAGS} -fomit-frame-pointer" + fi ;; *) ;;