randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.55k stars 561 forks source link

GCC version detection fails on Fedora 26 with GCC 7.2.1 #1314

Closed securitykernel closed 6 years ago

securitykernel commented 6 years ago

I recently did a dnf upgrade on my Fedora 26 with German localization and now configure.py fails to detect my GCC's version. Output is:

$ ./configure.py --prefix=/usr --libdir=lib64 
   INFO: ./configure.py invoked with options "--prefix=/usr --libdir=lib64"
   INFO: Platform: OS="Linux" machine="x86_64" proc="x86_64"
   INFO: Guessing target OS is linux (use --os to set)
   INFO: Guessing to use compiler gcc (use --cc to set)
   INFO: Detected CPU model "Intel(R) Core(TM) i5-6440HQ CPU @ 2.60GHz" in /proc/cpuinfo
   INFO: Guessing target processor is a x86_64/x86_64 (use --cpu to set)
   INFO: Canonicalized CPU target x86_64 to x86_64/x86_64
WARNING: Tried to get gcc version, but output '
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Ziel: x86_64-redhat-linux
Konfiguriert mit: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread-Modell: posix
gcc-Version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC) 
' does not match expected version format
WARNING: Auto-detected compiler version failed. Use --cc-min-version to set manually. Falling back to version 0.0
   INFO: Target is gcc:0.0-linux-x86_64-x86_64
   INFO: Skipping (dependency failure): certstor_sqlite3 sessions_sqlite3
   INFO: Skipping (incompatible OS): darwin_secrandom getentropy win32_stats
   INFO: Skipping (incompatible compiler): aes_armv8 pmull sha1_armv8 sha1_x86 sha2_32_armv8 sha2_32_x86 shacal2_x86
   INFO: Skipping (no enabled compression schemes): compression
   INFO: Skipping (requires external dependency): bearssl boost bzip2 lzma openssl sqlite3 tpm zlib
   INFO: Loading modules: adler32 aead aes aes_ni aes_ssse3 aont aria asn1 auto_rng base base64 bcrypt bigint blake2 block blowfish camellia cascade cast cbc cbc_mac ccm cecpq1 certstor_sql cfb chacha chacha20poly1305 chacha_rng chacha_sse2 clmul clmul_ssse3 cmac codec_filt comb4p cpuid crc24 crc32 cryptobox ctr curve25519 des dev_random dh dl_algo dl_group dlies dsa dyn_load eax ec_gfp ec_group ecc_key ecdh ecdsa ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa1 emsa_pkcs1 emsa_pssr emsa_raw emsa_x931 entropy fd_unix ffi filters fpe_fe1 gcm gmac gost_28147 gost_3410 gost_3411 hash hash_id hex hkdf hmac hmac_drbg hotp http_util idea idea_sse2 iso9796 kasumi kdf kdf1 kdf1_iso18033 kdf2 keccak keypair lion locking_allocator mac mce mceies md4 md5 mdx_hash mgf1 misty1 mode_pad modes mp newhope nist_keywrap noekeon noekeon_simd numbertheory ocb ofb par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pem pgp_s2k pk_pad pkcs11 poly1305 poly_dbl prf_tls prf_x942 proc_walk pubkey rc4 rdrand rdrand_rng rdseed rfc3394 rfc6979 rmd160 rng rsa salsa20 seed serpent serpent_simd sessions_sql sha1 sha1_sse2 sha2_32 sha2_64 sha3 shacal2 shacal2_simd shake shake_cipher simd siphash siv skein sm2 sm3 sm4 sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng threefish threefish_avx2 tiger tls tls_cbc tss twofish utils whirlpool x509 x919_mac xmss xtea xts
   INFO: Assuming CPU is little endian
   INFO: Assuming unaligned memory access works
   INFO: Using symlink to link files into build dir (use --link-method to change)
   INFO: Botan 2.4.0 (revision git:37bfb85f612ad380686540f50c6fc5d3d3cccbc7) (unreleased undated) build setup is complete
randombit commented 6 years ago

Thanks I'll look at it

webmaster128 commented 6 years ago

Hmm, same issue as MSVC: localized output in gcc --version. This could be fixed the same way as we do for MSVC using preprocessor calls instead of gcc --version.

webmaster128 commented 6 years ago

@securitykernel do you know the workaround using an command line argument?

./configure.py --cc=gcc --cc-min-version=7.2 --prefix=/usr --libdir=lib64

This will skip auto-detection entirely

securitykernel commented 6 years ago

@webmaster128 Yes, I know the workaround, so I can continue for the moment.