From patchwork Tue May 6 14:25:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 346213 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 33C50141394 for ; Wed, 7 May 2014 00:25:40 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=ke9RqE6V9WpdUDErblCdmhv6OlWi11oycfpqzfP+nMG x6akEp3rumaAMkNNJm3WKaIUcgfy6XldIIOXLHSZbWYkJnSCtgJWp5MH6V1apPaL HA22qY2Uajfz4UzSM7mKXplpkjSSBNPfK725zjkPnIFjab8h9O4Vv8skGwNnC6UQ = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=rGaMk69EwlqL6t6yxM994kyvAFg=; b=YzbbEhBpmfmkLyDEL zJL15FATghqoQeU2jJsajEfMDhxcnyWjpFCwSPBLAJE5AOLFSQ/P0WU6N/NkAFcx EaoZtCb0tapdm4zZbd2pBXKJCNEf60tZvkdJCVK2D6qw4gNJ3xnylcC7oVHeGq4a 8IeQO/CK2x1Imu/b/bXvS9BZ/Y= Received: (qmail 11169 invoked by alias); 6 May 2014 14:25:33 -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 11115 invoked by uid 89); 6 May 2014 14:25:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 May 2014 14:25:31 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 06 May 2014 15:25:27 +0100 Received: from [10.1.208.24] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 6 May 2014 15:25:36 +0100 Message-ID: <5368F0D7.7080908@arm.com> Date: Tue, 06 May 2014 15:25:27 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: GCC Patches CC: Richard Earnshaw , Marcus Shawcroft Subject: [AArch64][4.8 backport] Fix default CPU architecture flags X-MC-Unique: 114050615252800201 X-IsSubscribed: yes Hi all, A latent issue was recently exposed in the 4.8 branch. Due to the recently fixed TARGET_FLOAT macro on that branch (r210004), we now hit the bug that the configure-time default architecture flags do not include FP and SIMD even though the default cpu target mandates them in aarch64-arches.def. The issue appears when trying to build gcc without any --with-cpu or --with-arch flags. My patch to fix that issue for trunk (then 4.9) was posted at http://gcc.gnu.org/ml/gcc-patches/2014-02/msg01487.html but was not backported to 4.8 This patch is a backport of the config.gcc change for that. This fixes the build by properly using the architecture flags in aarch64-arches.def when configuring gcc. Ok to propose upstream for backport? Tested aarch64-none-elf built with various combinations of --with-cpu and --with-arch. Note, this fixes a build error when no --with-cpu or --with-arch is given on the configure line. That variation has been tested as well. Ok to commit to the 4.8 branch? Thanks, Kyrill 2014-05-06 Kyrylo Tkachov * config.gcc (aarch64*-*-*): Use ISA flags from aarch64-arches.def. Do not define target_cpu_default2 to generic. diff --git a/gcc/config.gcc b/gcc/config.gcc index a4fb77d..2b54dd9 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -3150,6 +3150,11 @@ case "${target}" in ${srcdir}/config/aarch64/$def | \ sed -e 's/^[^,]*,[ ]*//' | \ sed -e 's/,.*$//'` + # Extract the architecture flags from aarch64-arches.def + ext_mask=`grep "^$pattern(\"$base_val\"," \ + ${srcdir}/config/aarch64/$def | \ + sed -e 's/)$//' | \ + sed -e 's/^.*,//'` else base_id=`grep "^$pattern(\"$base_val\"," \ ${srcdir}/config/aarch64/$def | \ @@ -3699,10 +3704,8 @@ esac target_cpu_default2= case ${target} in aarch64*-*-*) - if test x$target_cpu_cname = x + if test x"$target_cpu_cname" != x then - target_cpu_default2=TARGET_CPU_generic - else target_cpu_default2=$target_cpu_cname fi ;;