Bug 104144 - [12 Regression] build fails due to: Error: unknown architecture `armv9-a'
Summary: [12 Regression] build fails due to: Error: unknown architecture `armv9-a'
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: 12.0
Assignee: Przemyslaw Wirkus
URL:
Keywords: build, documentation
Depends on:
Blocks:
 
Reported: 2022-01-20 12:26 UTC by Martin Liška
Modified: 2022-04-12 09:46 UTC (History)
3 users (show)

See Also:
Host: x86_64-linux-gnu
Target: arm-linux-gnueabi
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-01-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2022-01-20 12:26:25 UTC
Since g:32ba7860ccaddd5219e6dae94a3d0653e124c9dd, Armv9 is included in runtime library versions, however, gas configure detection is missing:

../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++ --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/12 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --disable-plugin --with-bugurl=https://bugs.opensuse.org/ '--with-pkgversion=SUSE Linux' --with-slibdir=/usr/arm-suse-linux-gnueabi/sys-root/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-12 --program-prefix=arm-none-eabi- --target=arm-none-eabi --disable-nls --with-sysroot=/usr/arm-suse-linux-gnueabi/sys-root --with-build-sysroot=/usr/arm-suse-linux-gnueabi/sys-root --with-build-time-tools=/usr/arm-suse-linux-gnueabi/bin --with-newlib --enable-multilib --with-multilib-list=aprofile,rmprofile --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-shared --disable-threads --disable-tls --disable-libsanitizer --build=x86_64-suse-linux --host=x86_64-suse-linux
...
[  255s] checking for arm-none-eabi-nm... /home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/nm
[  255s] checking for arm-none-eabi-ranlib... /usr/arm-suse-linux-gnueabi/bin/ranlib
[  255s] checking for arm-none-eabi-strip... /usr/arm-suse-linux-gnueabi/bin/strip
[  255s] checking whether ln -s works... yes
[  255s] checking for arm-none-eabi-gcc... /home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include --sysroot=/usr/arm-suse-linux-gnueabi/sys-root  -mthumb -march=armv9-a -mfloat-abi=soft
[  255s] checking for suffix of object files... configure: error: in `/home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/arm-none-eabi/thumb/v9-a/nofp/libgcc':
[  255s] configure: error: cannot compute suffix of object files: cannot compile
[  255s] See `config.log' for more details
[  255s] make[1]: *** [Makefile:12902: configure-target-libgcc] Error 1
[  255s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux'


Due to:
configure:3566: /home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include --sysroot=/usr/arm-suse-linux-gnueabi/sys-root  -mthumb -march=armv9-a -mfloat-abi=soft -o conftest -g -O2   conftest.c  >&5
Assembler messages:
Error: unknown architecture `armv9-a'

Error: unrecognized option -march=armv9-a
configure:3569: $? = 1
configure:3782: checking for suffix of object files
configure:3804: /home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/xgcc -B/home/abuild/rpmbuild/BUILD/gcc-12.0.1+git191144/obj-x86_64-suse-linux/./gcc/ -B/usr/arm-none-eabi/bin/ -B/usr/arm-none-eabi/lib/ -isystem /usr/arm-none-eabi/include -isystem /usr/arm-none-eabi/sys-include --sysroot=/usr/arm-suse-linux-gnueabi/sys-root  -mthumb -march=armv9-a -mfloat-abi=soft -c -g -O2  conftest.c >&5
Assembler messages:
Error: unknown architecture `armv9-a'
Comment 1 Richard Biener 2022-01-20 12:31:13 UTC
binutils used in question is 2.37, install.texi does not mention any binutils requirement for arm.
Comment 2 Christophe Lyon 2022-01-20 12:35:03 UTC
For background, I reported this some time ago: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584556.html
Comment 3 Richard Biener 2022-01-20 12:48:59 UTC
Is there a way to disable a specific multilib at configure time?
Comment 4 Richard Earnshaw 2022-01-20 13:38:51 UTC
This sort of problem is going to keep occurring while we continue to have separate distributions of GCC and binutils.  There's no way around the fact that support for a new architecture in GCC needs an assembler that understands the new architecture.  This is true for all architectures, not just Arm.

If a users asks for all the architectural libraries to be built, then I don't see it as unreasonable to require an assembler that can support this as well, so the issue becomes one of documentation, where we might as well just say that the minimum requirements may be increased if you try to use anything beyond the default configuration of the compiler.  Anything more is going to result in a completely unwieldy mess of impenetrable dependencies.

I don't think there's a way to make the current multilib infrastructure ignore specific sub-architectures.  t-multilib is already extremely complex due to the need to reduce the number of variants to something just about tractable for the build system; adding yet more complexity to it would make it almost impossible to manage.

I guess it might be possible to make the multilib configure machinery rip out variants that fail during configure, but you'd still need to deal with the mappings and decide what to do if the compiler needed an unbuilt library version.  Dropping back to the default multilib would often be completely wrong as it might be an ABI change.
Comment 5 Richard Biener 2022-01-20 14:10:02 UTC
Note I don't see we are asking for "all the architectural libraries to be built",
we are using --enable-multilib --with-multilib-list=aprofile,rmprofile which
worked before (in GCC 11).  Maybe it's possible to split up aprofile more?
I guess we could patch in our own t-*profile...

Anyway, can you amend install.texi, specifically the section about
--with-multilib-list to mention the minimum required version of binutils
when using aprofile (I think rmprofile is happy w/o armv9 support)?
Comment 6 Przemyslaw Wirkus 2022-01-20 14:12:11 UTC
Yes, I will update docs, cheers!
Comment 7 Martin Liška 2022-02-25 13:06:14 UTC
(In reply to Przemyslaw Wirkus from comment #6)
> Yes, I will update docs, cheers!

Any update on this, please?
Comment 8 Przemyslaw Wirkus 2022-02-25 14:58:59 UTC
> Subject: [Bug target/104144] [12 Regression] build fails due to: Error: unknown
> architecture `armv9-a'
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104144
>
> --- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to
> Przemyslaw Wirkus from comment #6)
> > Yes, I will update docs, cheers!
>
> Any update on this, please?

Apologies,
Was recently ill (it's that famous thing) and still digging through TODOs.
Please give me a day or two to sort this out.

Kind regards,
Przemyslaw

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Comment 9 GCC Commits 2022-04-12 09:41:53 UTC
The master branch has been updated by Richard Earnshaw <rearnsha@gcc.gnu.org>:

https://gcc.gnu.org/g:1210fd6e69e51516c935acc49e223fce14a0dd86

commit r12-8106-g1210fd6e69e51516c935acc49e223fce14a0dd86
Author: Przemyslaw Wirkus <Przemyslaw.Wirkus@arm.com>
Date:   Mon Apr 11 13:14:01 2022 +0100

    arm: remove unnecessary armv9-a multilib variant [PR104144]
    
    Remove the armv9-a specific multilib variants.  Instead, arrange to
    use either the armv8-a multilibs or the armv7-a versions, depeding on
    the configuration.  This eliminates the need to have a version of gas
    that understands --march=armv9-a when building GCC.  Very little, if
    anything in the standard libraries directly uses Armv9-a features
    anyway.
    
    Also remove the +crc variant rules for Armv9-a.  CRC is an implicit
    part of Armv9-a, so doesn't have a explicit feature to handle it.
    
    gcc/ChangeLog:
    
            PR target/104144
            * config/arm/t-aprofile (MULTI_ARCH_OPTS_A): Remove Armv9-a options.
            (MULTI_ARCH_DIRS_A): Remove Armv9-a diretories.
            (MULTILIB_REQUIRED): Don't require Armv9-a libraries.
            (MULTILIB_MATCHES): Treat Armv9-a as equivalent to Armv8-a.
            (MULTILIB_REUSE): Remove remap rules for Armv9-a.
            * config/arm/t-multilib (v9_a_nosimd_variants): Delete.
            (MULTILIB_MATCHES): Remove mappings for v9_a_nosimd_variants.
    
    gcc/testsuite/ChangeLog:
    
            PR target/104144
            * gcc.target/arm/multilib.exp: Updated tests.
Comment 10 Richard Earnshaw 2022-04-12 09:46:42 UTC
Fixed, by adjusting the selection of multilibs that are needed.  There's no benefit to building armv9-a multilibs, so use those built for armv8-a.