Message ID | 52A77837.9000108@linaro.org |
---|---|
State | Accepted |
Headers | show |
On 10/12/13 20:23, Kugan wrote: > gcc/ > > +2013-12-11 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. > + > Kugan, Thanks for sorting this out. OK to commit. /Marcus
Committed on Kugan's behalf as rev 205891. On 11 December 2013 13:27, Marcus Shawcroft <marcus.shawcroft@arm.com> wrote: > On 10/12/13 20:23, Kugan wrote: > >> gcc/ >> >> +2013-12-11 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. >> + >> > > Kugan, Thanks for sorting this out. OK to commit. > > /Marcus >
Looks good to me. Thanks for the fix. Yufeng On 06/30/14 10:44, Gerald Pfeifer wrote: > I applied the small patch on top of this, mostly triggered by the > markup issue. > > Let me know if there is anything you'd like to see differently; I > am thinking to push back to GCC 4.9 as well later. > > Gerald > > > 2014-06-30 Gerald Pfeifer<gerald@pfeifer.com> > > * doc/install.texi (Specific, aarch64*-*-*): Fix markup. Reword a bit. > > Index: doc/install.texi > =================================================================== > --- doc/install.texi (revision 212139) > +++ doc/install.texi (working copy) > @@ -3760,9 +3760,9 @@ > @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. > +Binutils pre 2.24 does not have support for selecting @option{-mabi} and > +does not support ILP32. If it is used to build GCC 4.9 or later, GCC will > +not support option @option{-mabi=ilp32}. > > @html > <hr /> >
On Mon, 30 Jun 2014, Yufeng Zhang wrote: > Looks good to me. Thanks for the fix. >> 2014-06-30 Gerald Pfeifer<gerald@pfeifer.com> >> >> * doc/install.texi (Specific, aarch64*-*-*): Fix markup. Reword a bit. I also pushed this to the GCC 4.9 branch now. Gerald
Hi! I was just building an aarch64 cross-compiler (indeed compiler only: 'make all-gcc'), and then wanted to check something in gimplification ('-S -fdump-tree-gimple'), with '-mabi=ilp32', which told me: "cc1: error: assembler does not support '-mabi=ilp32'". That's unexpected, as for '-S' GCC isn't even going to invoke the assembler. It's coming from this change: On Wed, 11 Dec 2013 13:57:59 +0100, Christophe Lyon <christophe.lyon@linaro.org> wrote: > Committed on Kugan's behalf as rev 205891. > > On 11 December 2013 13:27, Marcus Shawcroft <marcus.shawcroft@arm.com> wrote: > > On 10/12/13 20:23, Kugan wrote: > > > >> gcc/ > >> > >> +2013-12-11 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. > >> + > >> > > > > Kugan, Thanks for sorting this out. OK to commit. > > > > /Marcus Specifically: --- 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 Why is that necessary? Won't the assembler itself tell the user that it "does not support -mabi=ilp32", thus this check can be removed? If not, can a condition simply be added here to only emit this error if we're indeed going to invoke the assembler? (For my own testing, I just locally disabled that, of course.) Grüße Thomas
Hi Thomas, On Thu, 20 Jun 2019 at 20:04, Thomas Schwinge <thomas@codesourcery.com> wrote: > > Hi! > > I was just building an aarch64 cross-compiler (indeed compiler only: > 'make all-gcc'), and then wanted to check something in gimplification > ('-S -fdump-tree-gimple'), with '-mabi=ilp32', which told me: "cc1: > error: assembler does not support '-mabi=ilp32'". That's unexpected, as > for '-S' GCC isn't even going to invoke the assembler. It's coming from > this change: > > On Wed, 11 Dec 2013 13:57:59 +0100, Christophe Lyon <christophe.lyon@linaro.org> wrote: > > Committed on Kugan's behalf as rev 205891. > > > > On 11 December 2013 13:27, Marcus Shawcroft <marcus.shawcroft@arm.com> wrote: > > > On 10/12/13 20:23, Kugan wrote: > > > > > >> gcc/ > > >> > > >> +2013-12-11 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. > > >> + > > >> > > > > > > Kugan, Thanks for sorting this out. OK to commit. > > > > > > /Marcus > > Specifically: > > --- 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 > > Why is that necessary? Won't the assembler itself tell the user that it > "does not support -mabi=ilp32", thus this check can be removed? If not, > can a condition simply be added here to only emit this error if we're > indeed going to invoke the assembler? Current binutils will but binutils 2.23 and before didnt. Specifically, with 2.23.2, bootstrap was failing. That is why we needed this. Thanks, Kugan > > (For my own testing, I just locally disabled that, of course.) > > > Grüße > Thomas
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 <hr /> +@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 +<hr /> <!-- rs6000-ibm-aix*, powerpc-ibm-aix* --> @end html @anchor{x-ibm-aix}