From patchwork Tue Dec 10 20:23:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 22229 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6BACA23908 for ; Tue, 10 Dec 2013 20:23:30 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f11sf10330277qae.11 for ; Tue, 10 Dec 2013 12:23:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=+7UTUevUqd5RWVDSrbiJur7qv7I5O8qgm3iLU19u1D4=; b=PtRZihc83goJzTaapWX+yodvwyQTXBm/y/Jjn7yxG8j2VsTK7i4VvqQWAzNEN5w21w 9AEsFhnvBSE3Xp4+cNRfX8HAXK+dByRaWrLwPzu1+pbhnECUFratKja5REEBK9ERFgOx mWjukeWNCCHcY8PIaUs3j2McQWUlncMtKF3pcsCKC8R/KxYb7tJ86BxhwHkwIo2ADWaW aYYRqWBakwwTF/MwXN9qgtwCSrLssnKwOPg4LjH4OFLYjBUqNuL8JBxdET4eh+/F9Vzi tgzN4rxHgvufIZBZW39Ch5Js7kzeTrymw8+4qWT4jZnGPXoaJqOCvCcaybTzRPbCHAZg SNpg== X-Gm-Message-State: ALoCoQmw0KxxPdgihgbAMcdN1cwjkWsmJa1JYkUZ2SfstVIodFxRkR29eStrwUvPSoTlj3kdf7n/ X-Received: by 10.236.228.170 with SMTP id f40mr17834494yhq.43.1386707009507; Tue, 10 Dec 2013 12:23:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.228 with SMTP id k4ls2603802qer.93.gmail; Tue, 10 Dec 2013 12:23:29 -0800 (PST) X-Received: by 10.52.164.16 with SMTP id ym16mr793712vdb.39.1386707009405; Tue, 10 Dec 2013 12:23:29 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id qw3si5462870vcb.139.2013.12.10.12.23.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 12:23:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id la4so1941945vcb.29 for ; Tue, 10 Dec 2013 12:23:29 -0800 (PST) X-Received: by 10.58.246.136 with SMTP id xw8mr767151vec.41.1386707009238; Tue, 10 Dec 2013 12:23:29 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp216703vcz; Tue, 10 Dec 2013 12:23:28 -0800 (PST) X-Received: by 10.66.145.166 with SMTP id sv6mr30438058pab.31.1386707006945; Tue, 10 Dec 2013 12:23:26 -0800 (PST) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id ts1si11387242pbc.20.2013.12.10.12.23.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 12:23:26 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of kugan.vivekanandarajah@linaro.org) client-ip=209.85.160.54; Received: by mail-pb0-f54.google.com with SMTP id un15so8353670pbc.41 for ; Tue, 10 Dec 2013 12:23:26 -0800 (PST) X-Received: by 10.66.121.164 with SMTP id ll4mr30469250pab.48.1386707006470; Tue, 10 Dec 2013 12:23:26 -0800 (PST) Received: from [192.168.0.100] ([1.144.61.107]) by mx.google.com with ESMTPSA id qf7sm38058943pac.14.2013.12.10.12.23.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 12:23:24 -0800 (PST) Message-ID: <52A77837.9000108@linaro.org> Date: Wed, 11 Dec 2013 07:23:19 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Yufeng Zhang CC: "gcc-patches@gcc.gnu.org" , Marcus Shawcroft , "patches@linaro.org" Subject: Re: AARCH64 configure check for gas -mabi support References: <529F98A0.8020503@linaro.org> <52A1F8C0.70302@arm.com> <52A5A765.7000106@linaro.org> <52A63CA3.9000304@arm.com> <52A6B2D4.3080105@linaro.org> <52A6FB03.4050500@arm.com> In-Reply-To: <52A6FB03.4050500@arm.com> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , [snip] >> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c >> index b1b4eef..a53febc 100644 >> --- a/gcc/config/aarch64/aarch64.c >> +++ b/gcc/config/aarch64/aarch64.c >> @@ -5187,6 +5187,13 @@ aarch64_override_options (void) >> aarch64_parse_tune (); >> } >> >> +/* Issue error if assembler does not support -mabi and option ilp32 >> + is selected. */ > >I'd prefer the comment to be "The compiler may have been configured >with 2.23.* binutils, which does not have support for ILP32." >> +#ifndef HAVE_AS_MABI_OPTION >> + if (TARGET_ILP32) >> + error ("Assembler does not supprt -mabi=ilp32"); >> +#endif > > supprt/support > [snip] > I'm not very sure about the indent rules for configury files, but in > other areas of configure.ac, it seems using a similar indent convention > as in .c files. > Thanks Yufeng. I have updated the patch based on the comments above. Marcus, is this OK for trunk now? Thanks, Kugan gcc/ +2013-12-11 Kugan Vivekanandarajah + * configure.ac: Add check for aarch64 assembler -mabi support. + * configure: Regenerate. + * config.in: Regenerate. + * config/aarch64/aarch64-elf.h (ASM_MABI_SPEC): New define. + (ASM_SPEC): Update to substitute -mabi with ASM_MABI_SPEC. + * config/aarch64/aarch64.h (aarch64_override_options): Issue error if + assembler does not support -mabi and option ilp32 is selected. + * doc/install.texi: Added note that building gcc 4.9 and after with pre + 2.24 binutils will not support -mabi=ilp32. + diff --git a/gcc/config/aarch64/aarch64-elf.h b/gcc/config/aarch64/aarch64-elf.h index 4757d22..a66c3db 100644 --- a/gcc/config/aarch64/aarch64-elf.h +++ b/gcc/config/aarch64/aarch64-elf.h @@ -134,13 +134,19 @@ " %{!mbig-endian:%{!mlittle-endian:" ENDIAN_SPEC "}}" \ " %{!mabi=*:" ABI_SPEC "}" +#ifdef HAVE_AS_MABI_OPTION +#define ASM_MABI_SPEC "%{mabi=*:-mabi=%*}" +#else +#define ASM_MABI_SPEC "%{mabi=lp64:}" +#endif + #ifndef ASM_SPEC #define ASM_SPEC "\ %{mbig-endian:-EB} \ %{mlittle-endian:-EL} \ %{mcpu=*:-mcpu=%*} \ -%{march=*:-march=%*} \ -%{mabi=*:-mabi=%*}" +%{march=*:-march=%*}" \ +ASM_MABI_SPEC #endif #undef TYPE_OPERAND_FMT diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index b1b4eef..01dbe23 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5187,6 +5187,13 @@ aarch64_override_options (void) aarch64_parse_tune (); } +#ifndef HAVE_AS_MABI_OPTION + /* The compiler may have been configured with 2.23.* binutils, which does + not have support for ILP32. */ + if (TARGET_ILP32) + error ("Assembler does not support -mabi=ilp32"); +#endif + initialize_aarch64_code_model (); aarch64_build_bitmask_table (); diff --git a/gcc/configure.ac b/gcc/configure.ac index 91a22d5..0a3b97b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3495,6 +3495,35 @@ AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin, AC_MSG_RESULT($gcc_cv_lto_plugin) case "$target" in + aarch64*-*-*) + gcc_GAS_CHECK_FEATURE([-mabi option], gcc_cv_as_aarch64_mabi,, + [-mabi=lp64], [.text],,,) + if test x$gcc_cv_as_aarch64_mabi = xyes; then + AC_DEFINE(HAVE_AS_MABI_OPTION, 1, + [Define if your assembler supports the -mabi option.]) + else + if test x$with_abi = xilp32; then + AC_MSG_ERROR([Assembler does not support -mabi=ilp32.\ + Upgrade the Assembler.]) + fi + if test x"$with_multilib_list" = xdefault; then + TM_MULTILIB_CONFIG=lp64 + else + aarch64_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'` + for aarch64_multilib in ${aarch64_multilibs}; do + case ${aarch64_multilib} in + ilp32) + AC_MSG_ERROR([Assembler does not support -mabi=ilp32.\ + Upgrade the Assembler.]) + ;; + *) + ;; + esac + done + fi + fi + ;; + # All TARGET_ABI_OSF targets. alpha*-*-linux* | alpha*-*-*bsd*) gcc_GAS_CHECK_FEATURE([explicit relocation support], diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index a8f9f8a..00c4f0d 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -3735,6 +3735,15 @@ removed and the system libunwind library will always be used. @html
+@end html +@anchor{aarch64-x-x} +@heading aarch64*-*-* +Pre 2.24 binutils does not have support for selecting -mabi and does not +support ILP32. If GCC 4.9 or later is built with pre 2.24, GCC will not +support option -mabi=ilp32. + +@html +
@end html @anchor{x-ibm-aix}