This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: AARCH64 configure check for gas -mabi support


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  <kuganv@linaro.org>
+	* 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.
+


Attachment: p.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]