botan: Build fails on AArch64 when configured with "configure.py --cpu=arm32". Error: unrecognized command line option ‘-mfpu=neon’
INFO: ./configure.py invoked with options "--cpu=arm32 --minimized-build --enable-modules=x509,ecdsa,rsa,emsa_pkcs1,sha2_64,aes --disable-shared-library --amalgamation --single-amalgamation-file"
INFO: Guessing target OS is linux (use --os to set)
INFO: Guessing to use compiler gcc (use --cc or CXX to set)
INFO: Auto-detected compiler version 5.4
INFO: Target is gcc:5.4-linux-arm32
INFO: Skipping (incompatible CPU): aes_ni aes_ssse3 chacha_sse2 clmul clmul_ssse3 idea_sse2 rdrand_rng rdseed sha1_sse2 sha1_x86 sha2_32_x86 shacal2_x86 threefish_avx2
INFO: Skipping (incompatible OS): darwin_secrandom getentropy win32_stats
INFO: Skipping (incompatible compiler): aes_armv8 pmull sha1_armv8 sha2_32_armv8
INFO: Skipping (not requested): adler32 aead aont aria auto_rng bcrypt blake2 blowfish camellia cascade cast cbc cbc_mac ccm cecpq1 certstor_sql certstor_sqlite3 cfb chacha chacha20poly1305 chacha_rng checksum cmac codec_filt comb4p compression crc24 crc32 cryptobox ctr curve25519 des dev_random dh dl_algo dl_group dlies dsa dyn_load eax ecdh ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa_raw emsa_x931 fd_unix ffi filters fpe_fe1 gcm gmac gost_28147 gost_3410 gost_3411 hkdf hmac hmac_drbg hotp http_util idea iso9796 kasumi kdf1 kdf1_iso18033 kdf2 keccak lion locking_allocator mce mceies md4 md5 misty1 mode_pad modes newhope nist_keywrap noekeon noekeon_simd ocb ofb par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pgp_s2k pkcs11 poly1305 poly_dbl prf_tls prf_x942 proc_walk psk_db rc4 rdrand rfc3394 rfc6979 rmd160 salsa20 seed serpent serpent_simd sessions_sql sessions_sqlite3 sha3 shacal2 shacal2_simd shake shake_cipher simd siphash siv skein sm2 sm3 sm4 socket sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng thread_utils threefish tiger tls tls_cbc tss twofish whirlpool x919_mac xmss xtea xts
INFO: Skipping (requires external dependency): bearssl boost bzip2 lzma openssl sqlite3 tpm zlib
INFO: Loading modules: aes asn1 base base64 bigint block cpuid ec_gfp ec_group ecc_key ecdsa emsa1 emsa_pkcs1 emsa_pssr entropy hash hash_id hex kdf keypair mac mdx_hash mgf1 mp numbertheory pem pk_pad pubkey rng rsa sha1 sha2_32 sha2_64 utils x509
INFO: Using symlink to link files into build dir (use --link-method to change)
INFO: Writing amalgamation header to botan_all.h
INFO: Writing amalgamation header to botan_all_internal.h
INFO: Writing amalgamation source to botan_all.cpp
INFO: Botan 2.5.0 (revision git:0d63e98483e304a385013a4568312ab94dff3822) (unreleased undated) build setup is complete
make
...
...
...
g++ -fstack-protector -pthread -mfpu=neon -std=c++11 -D_REENTRANT -O3 -Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor -Ibuild/include -c src/tests/test_simd.cpp -o build/obj/test/test_simd.o
g++: error: unrecognized command line option ‘-mfpu=neon’
Makefile:326: recipe for target 'build/obj/test/test_simd.o' failed
make: *** [build/obj/test/test_simd.o] Error 1
The solution should be this.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Detect compiler architecture at configure time Avoids build confusions like #1442 — committed to randombit/botan by randombit 6 years ago
- Detect compiler architecture at configure time Avoids build confusions like #1442 — committed to randombit/botan by randombit 6 years ago
We have a compile-time check for x86-32 vs x86-64 cross-configuration because that’s a common misconfiguration but for everwhere else, we just assume $CXX is going to produce binaries matching the CPU specified by
--cpuwithout any verification. You compiled with an Aarch64 compiler, so that’s the binaries you got, and it happened that ARMv7 is sufficiently like Aarch64 that - given the current source - it happened to work. But you could have said say--cpu=mips64and that would also work, unless you happened to hit a stray bit of inline asm or whatever and one or two files would fail to build.We could/should have a better compile time check here, but fundamentally you need a different build of GCC for 32-bit ARM binaries.
You’ll need a compiler for 32-bit ARM, which will come in a completely different package from Aarch64. Eg on Ubuntu 16.04, gcc-5-aarch64-linux-gnu for 64-bit vs gcc-5-arm-linux-gnueabihf for 32-bit. It doesn’t work like x86-32 vs x86-64, which share a backend in GCC and a simple -m32/-m64 flag to switch targets.
I am confused. You indicate your GCC is configured for Aarch64. So, it is not possible to build for a standard 32-bit ARM target (which is what
arm32is). Is your intention here to build for Aarch32?