randombit / botan

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

Regression: Amalgamation builds fails with 2.8.0 under Cygwin #1701

Closed SideChannel closed 5 years ago

SideChannel commented 5 years ago

The build command

./configure.py --prefix=/usr/local/botan --amalgamation --single-amalgamation-file; make

works fine with Botan 2.7.0, but fails to work under Botan 2.8.0. The command

./configure.py --prefix=/usr/local/botan; make

works with both versions. Build system: Windows 10, Cygwin 2.11.1, gcc 7.3.0 Here is the output of configure.py for the failing amalgamation build: ./configure.py --prefix=/usr/local/botan --amalgamation --single-amalgamation-file INFO: ./configure.py invoked with options "--prefix=/usr/local/botan --amalgamation --single-amalgamation-file" INFO: Autodetected platform information: OS="CYGWIN_NT-10.0" machine="x86_64" proc="" INFO: Guessing target OS is cygwin (use --os to set) INFO: Guessing to use compiler gcc (use --cc or CXX to set) INFO: Guessing target processor is a x86_64 (use --cpu to set) INFO: Found sphinx-build (use --without-sphinx to disable) INFO: Shared libs not supported on cygwin, disabling shared lib support INFO: Auto-detected compiler version 7.3 INFO: Auto-detected compiler arch x86_64 INFO: Target is gcc:7.3-cygwin-x86_64 INFO: Skipping (dependency failure): certstor_sqlite3 sessions_sqlite3 INFO: Skipping (incompatible CPU): aes_armv8 aes_power8 pmull sha1_armv8 sha2_32_armv8 sm4_armv8 INFO: Skipping (incompatible OS): commoncrypto getentropy proc_walk win32_stats INFO: Skipping (no enabled compression schemes): compression INFO: Skipping (requires external dependency): bearssl boost bzip2 lzma openssl sqlite3 tpm zlib INFO: Using SIMD module simd_avx2 INFO: Loading modules: adler32 aead aes aes_ni aes_ssse3 aont aria asn1 auto_rng base base32 base64 bcrypt bigint blake2 block blowfish camellia cascade cast128 cast256 cbc cbc_mac ccm cecpq1 certstor_sql cfb chacha chacha20poly1305 chacha_avx2 chacha_rng chacha_sse2 checksum 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_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 mem_pool 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 psk_db pubkey rc4 rdrand rdrand_rng rdseed rfc3394 rfc6979 rmd160 rng rsa salsa20 scrypt seed serpent serpent_avx2 serpent_simd sessions_sql sha1 sha1_sse2 sha1_x86 sha2_32 sha2_32_bmi2 sha2_32_x86 sha2_64 sha3 shacal2 shacal2_simd shacal2_x86 shake shake_cipher simd simd_avx2 siphash siv skein sm2 sm3 sm4 socket sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng thread_utils threefish_512 threefish_512_avx2 tiger tls tls_cbc tss twofish utils uuid whirlpool x509 x919_mac xmss xtea xts INFO: Defaulting to assuming little endian INFO: Using hardlink 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.8.0 (revision git:a792728e8941b62761052f5e0d288ba13a016c77) (release dated 20181001) build setup is complete

make starts with `$ make g++ -U__STRICT_ANSI__ -fstack-protector -m64 -pthread -std=c++11 -D_REENTRANT -O3 -momit-leaf-frame-pointer -Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor -Ibuild/include -Ibuild/include/external -c botan_all.cpp -o build/obj/lib/botan_all.o botan_all.cpp:62790:0: warning: "key_xor" redefined

define key_xor(round, B0, B1, B2, B3) \

botan_all.cpp:62638:0: note: this is the location of the previous definition

define key_xor(round, B0, B1, B2, B3) \

botan_all.cpp: In member function 'void Botan::Serpent::avx2_encrypt_8(const uint8_t, uint8_t) const': botan_all.cpp:62679:4: error: 'SIMD_8x32' was not declared in this scope SIMD_8x32 B0 = SIMD_8x32::load_le(in); ^~~~~ botan_all.cpp:62679:4: note: suggested alternative: 'SIMD_4x32' SIMD_8x32 B0 = SIMD_8x32::load_le(in);`

and stops after a while

randombit commented 5 years ago

Same issue as #1700. Fixed in 3746c08d094f97118a26d and abc8e0a5a1. Workaround is --disable-avx2.