randombit / botan

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

Fails to compile/build: src/cli/pubkey.cpp rng object #387

Closed mouse07410 closed 8 years ago

mouse07410 commented 8 years ago

Xcode-7.2 (latest)

./configure.py --prefix=/opt/local --with-boost --with-bzip2 --with-lzma --with-openssl --with-zlib --with-sqlite3 --with-python-version=2.7 --with-sphinx --cc=clang --cc-abi-flags='-maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include'
   INFO: Platform: OS="Darwin" machine="x86_64" proc="i386"
   INFO: Guessing target OS is darwin (use --os to set)
   INFO: Guessing target processor is a x86_64/x86_64 (use --cpu to set)
   INFO: Target is clang-darwin-x86_64-x86_64
   INFO: Skipping, by request only - cvc
   INFO: Skipping, incompatible CPU - mp_x86_32 simd_altivec
   INFO: Skipping, incompatible OS - beos_stats cryptoapi_rng dyn_load win32_stats
   INFO: Skipping, incompatible compiler - mp_x86_32_msvc
# Compiler Options
   INFO: Skipping, loaded only if needed by dependency - mp_generic simd_scalar
   INFO: Skipping, requires external dependency - tpm
   INFO: Using MP module mp_x86_64
   INFO: Using SIMD module simd_sse2
   INFO: Loading modules adler32 aead aes aes_ni aes_ssse3 aont asn1 auto_rng base base64 bcrypt bigint block blowfish boost bzip2 camellia cascade cast cbc cbc_mac ccm cfb chacha chacha20poly1305 clmul cmac codec_filt comb4p compression crc24 crc32 cryptobox ctr curve25519 darwin_secrandom datastor des dev_random dh dl_algo dl_group dlies dsa eax ec_gfp ec_group ecb ecc_key ecdh ecdsa egd elgamal eme_oaep eme_pkcs1 eme_raw emsa1 emsa1_bsi emsa_pkcs1 emsa_pssr emsa_raw emsa_x931 entropy fd_unix ffi filters fpe_fe1 gcm gost_28147 gost_3410 gost_3411 has160 hash hash_id hex hkdf hmac hmac_drbg hmac_rng hres_timer http_util idea idea_sse2 if_algo kasumi kdf kdf1 kdf2 keccak keypair lion locking_allocator lzma mac mars mce mceies md2 md4 md5 mdx_hash mgf1 misty1 mode_pad modes mp mp_x86_64 noekeon noekeon_simd nr numbertheory ocb ofb oid_lookup openpgp openssl par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pem pk_pad poly1305 prf_tls prf_x942 proc_walk pubkey rc2 rc4 rc5 rc6 rdrand rdseed rfc3394 rfc6979 rmd128 rmd160 rng rsa rw safer salsa20 seed serpent serpent_simd sessions_sql sessions_sqlite3 sha1 sha1_sse2 sha2_32 sha2_64 simd simd_sse2 siphash siv skein sqlite3 srp6 stream system_rng tea threefish threefish_avx2 tiger tls tss twofish unix_procs utils whirlpool x509 x919_mac x931_rng xtea xtea_simd xts zlib
   INFO: Enabling use of external dependency boost
   INFO: Enabling use of external dependency bzip2
   INFO: Enabling use of external dependency lzma
   INFO: Enabling use of external dependency openssl
   INFO: Enabling use of external dependency sqlite3
   INFO: Enabling use of external dependency zlib
   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 1.11.26 (unreleased undated) build setup is complete
$ make
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -fPIC -fvisibility=hidden -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/lib/asn1/alg_id.cpp -o build/obj/lib/asn1_alg_id.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -fPIC -fvisibility=hidden -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/lib/asn1/asn1_alt_name.cpp -o build/obj/lib/asn1_alt_name.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -fPIC -fvisibility=hidden -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/lib/asn1/asn1_attribute.cpp -o build/obj/lib/asn1_attribute.o
.........
clang: warning: argument unused during compilation: '-pthread'
ln -fs libbotan-1.11.26.26.dylib ./libbotan-1.11.26.dylib
ln -fs libbotan-1.11.26.26.dylib ./libbotan-1.11.dylib
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/asn1.cpp -o build/obj/cli/asn1.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/bench.cpp -o build/obj/cli/bench.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/cc_enc.cpp -o build/obj/cli/cc_enc.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/compress.cpp -o build/obj/cli/compress.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/main.cpp -o build/obj/cli/main.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/math.cpp -o build/obj/cli/math.o
clang++  -m64 -pthread -maes -mpclmul -mssse3 -msse4.2 -mrdrnd -I/opt/local/include -std=c++11 -D_REENTRANT -fstack-protector -O3 -Wall -Wextra -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wunreachable-code -Ibuild/include -c ./src/cli/pubkey.cpp -o build/obj/cli/pubkey.o
./src/cli/pubkey.cpp:132:60: error: reference to non-static member function must be
      called; did you mean to call it with no arguments?
               write_output(Botan::PKCS8::BER_encode(*key, rng, pass, pbe_mi...
                                                           ^~~
                                                              ()
./src/cli/pubkey.cpp:143:59: error: reference to non-static member function must be
      called; did you mean to call it with no arguments?
               output() << Botan::PKCS8::PEM_encode(*key, rng, pass, pbe_mil...
                                                          ^~~
                                                             ()
./src/cli/pubkey.cpp:189:60: error: reference to non-static member function must be
      called; did you mean to call it with no arguments?
         output() << Botan::base64_encode(signer.signature(rng)) << "\n";
                                                           ^~~
                                                              ()
3 errors generated.
make: *** [build/obj/cli/pubkey.o] Error 1
randombit commented 8 years ago

Yes, also once those are fixed there are also some lifetime issues around the CLI code; creating all of the Command objects at init time is trouble when one has a member variable which creates memory, as the order of destruction of the memory pool and the command object is indeterminate. Need to do other things right now, but should be resolved tonight.

mouse07410 commented 8 years ago

Thank you!

randombit commented 8 years ago

Should be good now

mouse07410 commented 8 years ago

I confirm: it is good. ;-)