[Bug target/72737] New: warning: switch -mcpu=cortex-a53 conflicts with -march=armv8-a switch

noloader at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jul 28 07:49:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72737

            Bug ID: 72737
           Summary: warning: switch -mcpu=cortex-a53 conflicts with
                    -march=armv8-a switch
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: noloader at gmail dot com
  Target Milestone: ---

This looks like an issue similar to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57907. It also appears similar to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=70210. My apologies if it has
already been fixed.

Raspberry recently welcomed the Raspberry Pi 3. Its an ARMv8 SoC by Broadcom
based on the A-53 core. Raspberry is resisting an 64-bit Aarch64 image, so we
have to use a 32-bit image and toolchain. Fortunately, Aarch32 has the
necessary instructions, too (but with a different encoding). Also see
https://community.arm.com/groups/android-community/blog/2015/03/27/arm-neon-programming-quick-reference
.

Attempting to compile in this configuration results in:

$ cat test.cc
int main(int argc, char* argv[])
{
  return 0;
}

$ gcc -march=armv8-a -mcpu=cortex-a53 test.cc -o test.exe
test.cc:1:0: warning: switch -mcpu=cortex-a53 conflicts with -march=armv8-a
switch
 int main(int argc, char* argv[])
 ^

The same thing applies as in the 57907. The manual seems to indicate its a
supported configuration. And the same comments apply as well. There are some
optional instructions that may not be present in a baseline A53.

**********

What I am ultimately after here is access to the PMULL, PMULL2, AES, SHA1 and
SHA2 intrinsics. But alas, that does not want to compile:

$ gcc -march=armv8-a+crc+crypto -mcpu=cortex-a53 test.cc -o test.exe

gcc: error: unrecognized argument in option ‘-march=armv8-a+crc+crypto’
gcc: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4
armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2
armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv7ve armv8-a
armv8-a+crc iwmmxt iwmmxt2 native

**********

And here's another attempt to enable CRC and Crypto. I'm probably going to have
to take this to the GCC mailing list for help.

raspberrypi:cryptopp-gcm$ gcc -D__ARM_FEATURE_CRYPTO -D__ARM_FEATURE_CRC
-march=armv8-a -mcpu=cortex-a53 -mfpu=neon test.cc -o test.exe
test.cc:1:0: warning: switch -mcpu=cortex-a53 conflicts with -march=armv8-a
switch
 #include <arm_neon.h>
 ^
In file included from test.cc:1:0:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint8x16_t vaeseq_u8(uint8x16_t, uint8x16_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13707:50: error:
‘__builtin_arm_crypto_aese’ was not declared in this scope
   return __builtin_arm_crypto_aese (__data, __key);
                                                  ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint8x16_t vaesdq_u8(uint8x16_t, uint8x16_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13713:50: error:
‘__builtin_arm_crypto_aesd’ was not declared in this scope
   return __builtin_arm_crypto_aesd (__data, __key);
                                                  ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint8x16_t vaesmcq_u8(uint8x16_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13719:44: error:
‘__builtin_arm_crypto_aesmc’ was not declared in this scope
   return __builtin_arm_crypto_aesmc (__data);
                                            ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint8x16_t vaesimcq_u8(uint8x16_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13725:45: error:
‘__builtin_arm_crypto_aesimc’ was not declared in this scope
   return __builtin_arm_crypto_aesimc (__data);
                                             ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function ‘uint32_t
vsha1h_u32(uint32_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13733:40: error:
‘__builtin_arm_crypto_sha1h’ was not declared in this scope
   __t = __builtin_arm_crypto_sha1h (__t);
                                        ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha1cq_u32(uint32x4_t, uint32_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13742:60: error:
‘__builtin_arm_crypto_sha1c’ was not declared in this scope
   return __builtin_arm_crypto_sha1c (__hash_abcd, __t, __wk);
                                                            ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha1pq_u32(uint32x4_t, uint32_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13750:60: error:
‘__builtin_arm_crypto_sha1p’ was not declared in this scope
   return __builtin_arm_crypto_sha1p (__hash_abcd, __t, __wk);
                                                            ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha1mq_u32(uint32x4_t, uint32_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13758:60: error:
‘__builtin_arm_crypto_sha1m’ was not declared in this scope
   return __builtin_arm_crypto_sha1m (__hash_abcd, __t, __wk);
                                                            ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha1su0q_u32(uint32x4_t, uint32x4_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13764:63: error:
‘__builtin_arm_crypto_sha1su0’ was not declared in this scope
   return __builtin_arm_crypto_sha1su0 (__w0_3, __w4_7, __w8_11);
                                                               ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha1su1q_u32(uint32x4_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13770:57: error:
‘__builtin_arm_crypto_sha1su1’ was not declared in this scope
   return __builtin_arm_crypto_sha1su1 (__tw0_3, __w12_15);
                                                         ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha256hq_u32(uint32x4_t, uint32x4_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13776:70: error:
‘__builtin_arm_crypto_sha256h’ was not declared in this scope
   return __builtin_arm_crypto_sha256h (__hash_abcd, __hash_efgh, __wk);
                                                                      ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha256h2q_u32(uint32x4_t, uint32x4_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13782:71: error:
‘__builtin_arm_crypto_sha256h2’ was not declared in this scope
   return __builtin_arm_crypto_sha256h2 (__hash_abcd, __hash_efgh, __wk);
                                                                       ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha256su0q_u32(uint32x4_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13788:56: error:
‘__builtin_arm_crypto_sha256su0’ was not declared in this scope
   return __builtin_arm_crypto_sha256su0 (__w0_3, __w4_7);
                                                        ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function
‘uint32x4_t vsha256su1q_u32(uint32x4_t, uint32x4_t, uint32x4_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13794:68: error:
‘__builtin_arm_crypto_sha256su1’ was not declared in this scope
   return __builtin_arm_crypto_sha256su1 (__tw0_3, __w8_11, __w12_15);
                                                                    ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function ‘poly128_t
vmull_p64(poly64_t, poly64_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13800:83: error:
‘__builtin_arm_crypto_vmullp64’ was not declared in this scope
   return (poly128_t) __builtin_arm_crypto_vmullp64 ((uint64_t) __a, (uint64_t)
__b);
                                                                               
   ^
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h: In function ‘poly128_t
vmull_high_p64(poly64x2_t, poly64x2_t)’:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/arm_neon.h:13809:85: error:
‘__builtin_arm_crypto_vmullp64’ was not declared in this scope
   return (poly128_t) __builtin_arm_crypto_vmullp64 ((uint64_t) __t1,
(uint64_t) __t2);
                                                                               
     ^

**********

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10'
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm
--disable-libquadmath --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf
--with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6
--with-fpu=vfp --with-float=hard --enable-checking=release
--build=arm-linux-gnueabihf --host=arm-linux-gnueabihf
--target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Raspbian 4.9.2-10)


More information about the Gcc-bugs mailing list