From patchwork Tue Dec 10 06:21:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 22201 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B88423908 for ; Tue, 10 Dec 2013 06:21:21 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id 6sf9810100qea.5 for ; Mon, 09 Dec 2013 22:21:20 -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=ejwJuqbQ5m5Kwe7kl5+cocKet2Cf44WPkD+fp7IPtKM=; b=YQ//Z9BQMIXjX24Ko0icTeLOKLH1giK3XJisgvIqBYt9fXN96hFACPiIK7l8rVa5Sy dXCUA/aDw3LkNuuLvIK11WKNqzllZ0OHZOYqxQmlk/Cd4nrZPRpx4Q2KwqUoqyByrpyf 1tLTBSbdIvr28EfklaUzYKzCjMIeZTLNDWiL2abCIuRYBQo9n+05yQw70z8cieK1aicd iplRXnOfBwvoErfIYtpswS1bWAhi2D0gnuhOjsonchVcGelvVR0DTrm2ul1jGbwymW4U tDUnGs0+VT9pB84GouJeXzErTkWtTQIiZ4X1psrY9vEDdlyQMxyObdg3U9nrt+WBwBsC dVSQ== X-Gm-Message-State: ALoCoQnMe9Q6lvFJCPNaUECuxpCyWxeo7VbXIiVOlpRJxiyuIiewk/ffh8pFuO7kwIAZvA2GyNcR X-Received: by 10.58.187.197 with SMTP id fu5mr182821vec.34.1386656480709; Mon, 09 Dec 2013 22:21:20 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.76 with SMTP id gc12ls2481137qeb.44.gmail; Mon, 09 Dec 2013 22:21:20 -0800 (PST) X-Received: by 10.221.54.65 with SMTP id vt1mr52977vcb.46.1386656480605; Mon, 09 Dec 2013 22:21:20 -0800 (PST) Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43]) by mx.google.com with ESMTPS id ef6si4768312ved.47.2013.12.09.22.21.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 22:21:20 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.43 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.43; Received: by mail-vb0-f43.google.com with SMTP id p6so239952vbe.16 for ; Mon, 09 Dec 2013 22:21:20 -0800 (PST) X-Received: by 10.58.255.233 with SMTP id at9mr68354ved.20.1386656480372; Mon, 09 Dec 2013 22:21:20 -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 u4csp163679vcz; Mon, 9 Dec 2013 22:21:19 -0800 (PST) X-Received: by 10.66.250.163 with SMTP id zd3mr25661264pac.109.1386656478008; Mon, 09 Dec 2013 22:21:18 -0800 (PST) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id ph10si9472147pbb.229.2013.12.09.22.21.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 22:21:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of kugan.vivekanandarajah@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id md12so6955932pbc.7 for ; Mon, 09 Dec 2013 22:21:17 -0800 (PST) X-Received: by 10.68.125.198 with SMTP id ms6mr25420994pbb.98.1386656477503; Mon, 09 Dec 2013 22:21:17 -0800 (PST) Received: from [192.168.0.100] ([120.158.35.38]) by mx.google.com with ESMTPSA id nn6sm22759748pbc.29.2013.12.09.22.21.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 22:21:16 -0800 (PST) Message-ID: <52A6B2D4.3080105@linaro.org> Date: Tue, 10 Dec 2013 17:21:08 +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" , "config-patches@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> In-Reply-To: <52A63CA3.9000304@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.212.43 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: , Hi Yufeng, Thanks for the quick response. >> +#define ASM_MABI_SPEC "%{mabi=lp64*:}" > > Is '*' necessary here? Removed it. >> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c >> index b1b4eef..c1a9cbd 100644 >> --- a/gcc/config/aarch64/aarch64.c >> +++ b/gcc/config/aarch64/aarch64.c >> @@ -5186,6 +5186,10 @@ aarch64_override_options (void) >> { >> aarch64_parse_tune (); >> } >> +#ifndef HAVE_AS_MABI_OPTION >> + if (TARGET_ILP32) >> + error ("Assembler does not supprt -mabi=ilp32"); >> +#endif > > A blank line before #ifndef and some comment to explain the reason please. Blank line and comments are added. >> + aarch64*-*-*) > > Alphabetically, this should be placed before alpha*. Moved it up. > > It is not sufficient to only check with_abi itself. By default, > aarch64*-*-elf builds both ilp32 and lp64 libraries (e.g. libgcc). This > needs to be turned off if test x$gcc_cv_as_aarch64_mabi = xno. We also > need to detect the situation where users explicitly configure the > toolchain with --with-multilib-list=lp64,ilp32 > > Here is an incremental diff based on your change to gcc/configure.ac to > give an example on a more thorough check: > > diff --git a/gcc/configure.ac b/gcc/configure.ac > index c8cf274..c590ad7 100644 > --- a/gcc/configure.ac > +++ b/gcc/configure.ac > @@ -3488,12 +3488,27 @@ case "$target" in > gcc_GAS_CHECK_FEATURE([-mabi option], > gcc_cv_as_aarch64_mabi,, > [-mabi=lp64], [.text],,,) > - if test $gcc_cv_as_aarch64_mabi = yes ; then > + 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.]) > - fi > - if test x$gcc_cv_as_aarch64_mabi = xno && test x$with_abi = xilp32; > then > - AC_MSG_ERROR([Assembler doesnot support -mabi=ilp32. Upgrade the > Assembler.]) > + 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 > ;; Updated it and tested with 1. binutils 2.23.2 a. bootstrapped with defaults and tested gcc for -mabi=lp64 (compiles) and -mabi=ilp32 gives error b. Trying to boottsrap with --with-multilibs-list=lp64,ilp32 fails with error msg c. Trying to bootstrap with --with-multilibs-list=ilp32 fails with error msg d. Bootstrap with --with-multilibs-list=lp64 works. 2. binutils 2.24.51 a. bootstrapped with defaults and tested gcc for -mabi=lp64 (compiles) and -mabi=ilp32 (compiles) b. Bootstrap with --with-multilibs-list=lp64,ilp32 works and tested gcc for -mabi=lp64 compiles and -mabi=ilp32 compiles(* gives linker error in my setup - aarch64:ilp32 architecture of input file `/tmp/ccIFqSxU.o' is incompatible with aarch64 output; I believe this is not related to what I am testing) c. Bootstrap with default works Thanks, kugan gcc/ +2013-12-09 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 + assebler 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..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. */ +#ifndef HAVE_AS_MABI_OPTION + if (TARGET_ILP32) + error ("Assembler does not supprt -mabi=ilp32"); +#endif + initialize_aarch64_code_model (); aarch64_build_bitmask_table (); diff --git a/gcc/configure.ac b/gcc/configure.ac index 91a22d5..a951b82 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}