From patchwork Mon Dec 9 11:20:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 298995 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EE3352C0096 for ; Mon, 9 Dec 2013 22:20:29 +1100 (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:references :in-reply-to:content-type; q=dns; s=default; b=GtRGgrBGVmALjiyu0 30leOY9G0CMX7CwMyXimKrvtpWtgLK/y7ObSItgjSiQFsEflUzg/Z+C49sGYj80B V41doLU0QxDYJE6RROqr47iLi59xrg10psnyKe1db/njSn0s09ogY3exP2PY9Ww8 BfXKULBAkEfZuxhPsh76DDQlp4= 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:references :in-reply-to:content-type; s=default; bh=La0/g2RLBXbkCF0fM50Klxq 0XqI=; b=QyoL43vnAMc19m1QUKk8d6TFpaG+Sa2LjFUu9rDCKEnQ9qgJLd5TuCn mrvWqt5oM/p0OAeoNjFwqz7IBzQP78j3Ay0SLOR/zkj23bCzE9WQh+7O5MClJ4ES eD12VIqQZdqaLPWVV4MWwsMY9+OC6dInKwbxQSzmY3vKgqR+3mbQ= Received: (qmail 9160 invoked by alias); 9 Dec 2013 11:20: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 9143 invoked by uid 89); 9 Dec 2013 11:20:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-pd0-f170.google.com Received: from Unknown (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 09 Dec 2013 11:20:20 +0000 Received: by mail-pd0-f170.google.com with SMTP id g10so5104238pdj.1 for ; Mon, 09 Dec 2013 03:20:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=tHm8/QjoIwB8Zi3LpvPOuIsUmN9L2bOb/2tFnQ7KjMU=; b=k4On8TQweEBvUA7MVIQAEiusnWk+F+3rkGGKfF3OqzgFy0wEmMlRrgLWGNc0bG/vER pnTZYCIuqyAqNACi5GGCnJNCIKXDbl2RkO/gicigTZRw0Lf6jZYvZT68dmoV/kb5PsmB fp/B4GvQA33sZl8CIf18hiBfWY0Psvor4he+wjk/aQWWkq+6rejFuaB5UL0UEYw0VFDy Sy4f8ynb/WbKbRTmJ8vGRUp+S9JmE3Kp+MerTY5hkQL303xFxyeZq85CNNm+LDquy+cX c2p/1M3QkFZMYMBMI6heUd4wpGbKWriX7kvAkBGfiJ6+d6d5AwT+1/neUYE/4vEL1Rc0 rBGw== X-Gm-Message-State: ALoCoQnVB0CsF/xSRAANaOmGTfupu0lSCzjpsbOUNnV7iCkLzbWebYERmdcRTjNw8taSzQJUiEan X-Received: by 10.68.89.162 with SMTP id bp2mr7996419pbb.151.1386588012625; Mon, 09 Dec 2013 03:20:12 -0800 (PST) Received: from [192.168.0.100] ([120.158.35.38]) by mx.google.com with ESMTPSA id y9sm24024262pas.10.2013.12.09.03.20.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 03:20:11 -0800 (PST) Message-ID: <52A5A765.7000106@linaro.org> Date: Mon, 09 Dec 2013 22:20:05 +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> In-Reply-To: <52A1F8C0.70302@arm.com> X-IsSubscribed: yes Thanks Yufeng for the review. On 07/12/13 03:18, Yufeng Zhang wrote: >> gcc trunk aarch64 bootstrapping fails with gas version 2.23.2 (with >> error message similar to cannot compute suffix of object files) as this >> particular version does not support -mabi=lp64. It succeeds with later >> versions of gas that supports -mabi. > > The -mabi option was introduced to gas when the support for ILP32 was > added. Initially the options were named -milp32 and -mlp64: > > http://sourceware.org/ml/binutils/2013-06/msg00178.html > > and later on they were change to -mabi=ilp32 and -mabi=lp64 for > consistency with those in the aarch64 gcc: > > http://sourceware.org/ml/binutils/2013-07/msg00180.html > > The following gcc patch made the driver use the explicit option to drive > gas: > > http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00083.html > > It is a neglect of the backward compatibility with binutils 2.23. > >> >> Attached patch add checking for -mabi=lp64 and prompts upgradation. Is >> this Ok? > > I think instead of mandating the support for the -mabi option, the > compiler shall be changed able to work with binutils 2.23. The 2.23 > binutils have a good support for aarch64 and the main difference from > 2.24 is the ILP32 support. I think it is necessary to maintain the > backward compatibility, and it should be achieved by suppressing the > compiler's support for ILP32 when the -mabi option is not found > available in gas during the configuration time. > > I had a quick look at areas need to be updated: > > * multilib support > > In gcc/config.gcc, the default and the only accepted value for > --with-multilib-list and --with-abi shall be lp64 when -mabi is not > available. > > * -mabi option > > I suggest we keep the -mabi option, but reject -mabi=ilp32 in > gcc/config/aarch64/aarch64.c:aarch64_override_options () > > * driver spec > > In gcc/config/aarch64/aarch64-elf.h, the DRIVER_SELF_SPECS and ASM_SPEC > shall be updated to not pass/specify -mabi for gas. > > * documentation > > I think it needs to be mentioned in gcc/doc/install.texi the constraint > of using pre-2.24 binutils with aarch64 gcc that is 4.9 or later. > > It is a quick scouting, but hopefully it has provided provide some > guidance. If you need more help, just let me know. > > > Yufeng > > P.s. some minor comments on the attached patch. > >> >> diff --git a/gcc/configure b/gcc/configure >> index fdf0cd0..17b6e85 100755 >> --- a/gcc/configure >> +++ b/gcc/configure > > Diff result of auto-generation is usually excluded from a patch. > >> diff --git a/gcc/configure.ac b/gcc/configure.ac >> index 91a22d5..730ada0 100644 >> --- a/gcc/configure.ac >> +++ b/gcc/configure.ac >> @@ -3532,6 +3532,15 @@ case "$target" in >> [Define if your assembler supports the -no-mul-bug-abort >> option.])]) >> ;; >> >> + aarch64-*-*) > > aarch64*-*-* > >> + gcc_GAS_CHECK_FEATURE([-mabi option], >> + gcc_cv_as_aarch64_mabi,, >> + [-mabi=lp64], [.text],,,) >> + if test x$gcc_cv_as_aarch64_mabi = xno; then >> + AC_MSG_ERROR([Assembler support for -mabi=lp64 is required. >> Upgrade the Assembler.]) >> + fi >> + ;; >> + >> sparc*-*-*) >> gcc_GAS_CHECK_FEATURE([.register], gcc_cv_as_sparc_register_op,,, >> [.register %g2, #scratch],, >> > > Here is an attempt to do it the way you have suggested. 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 + 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..b260b7c 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..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 initialize_aarch64_code_model (); diff --git a/gcc/configure.ac b/gcc/configure.ac index 91a22d5..fcfdbdb 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3532,6 +3532,19 @@ case "$target" in [Define if your assembler supports the -no-mul-bug-abort option.])]) ;; + aarch64*-*-*) + gcc_GAS_CHECK_FEATURE([-mabi option], + gcc_cv_as_aarch64_mabi,, + [-mabi=lp64], [.text],,,) + if test $gcc_cv_as_aarch64_mabi = yes ; 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.]) + fi + ;; + sparc*-*-*) gcc_GAS_CHECK_FEATURE([.register], gcc_cv_as_sparc_register_op,,, [.register %g2, #scratch],, diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index a8f9f8a..e4de2d2 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}