Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building CLI Target using Emscripten compiler. #3836

Closed
Satancito opened this issue Dec 14, 2023 · 4 comments
Closed

Error building CLI Target using Emscripten compiler. #3836

Satancito opened this issue Dec 14, 2023 · 4 comments

Comments

@Satancito
Copy link

Satancito commented Dec 14, 2023

Configure command in powershell
prompt> & "/home/x/.emsdk/upstream/emscripten/emconfigure" python "$BOTAN_UNZIPPED_DIR/configure.py" $options $BotanOptions

Generated Makefile

# Makefile for Botan 3.2.0 generated using
# 'configure.py --debug-mode --with-debug-info --no-optimizations --link-method=copy --cpu=wasm --os=emscripten --cc=emcc --disable-shared-library --prefix=/mnt/c/Users/Megam/.CppLibs/Botan-3.2.0-Debug-Emscripten-Full'

# Paths to relevant programs
CXX            = /home/x/.emsdk/upstream/emscripten/em++
LINKER         = /home/x/.emsdk/upstream/emscripten/em++
AR             = /home/x/.emsdk/upstream/emscripten/emar
AR_OPTIONS     = cr
PYTHON_EXE     = /usr/bin/python

# Compiler Flags
ABI_FLAGS      =  
LANG_FLAGS     = -s DISABLE_EXCEPTION_CATCHING=0 -std=c++20 -D_REENTRANT 
LANG_EXE_FLAGS = -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s NO_DISABLE_EXCEPTION_CATCHING
CXXFLAGS       = -g -DBOTAN_IS_BEING_BUILT
WARN_FLAGS     = -Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wshorten-64-to-32
LIB_FLAGS      = 
LDFLAGS        = 

EXE_LINK_CMD   = em++

LIB_LINKS_TO        =  
BUILD_DIR_LINK_PATH = -L.
EXE_LINKS_TO        = -lbotan-3 $(LIB_LINKS_TO) 

# Note: Remember to adapt the generation of compile_commands.json, when changing
#       any of those variables or their associations to compilation units.
#       See compile_commands.json.in and configure.py (generate_build_info)
BUILD_FLAGS    = $(ABI_FLAGS) $(LANG_FLAGS) $(CXXFLAGS) $(WARN_FLAGS)

SCRIPTS_DIR    = /home/x/.PsBotan/Botan-3.2.0/src/scripts
INSTALLED_LIB_DIR = /mnt/c/Users/Megam/.CppLibs/Botan-3.2.0-Debug-Emscripten-Full/lib

# The primary target
all: libs docs cli tests

# Executable targets
CLI           = ./botan.html
TEST          = ./botan-test.html
LIBRARIES     = ./libbotan-3.a

cli: $(CLI)
tests: $(TEST)
libs: $(LIBRARIES)
docs: build/doc.stamp

# Misc targets

.PHONY: all cli libs tests check docs clean distclean install fmt tidy

build/doc.stamp: /home/x/.PsBotan/Botan-3.2.0/doc/*.rst /home/x/.PsBotan/Botan-3.2.0/doc/api_ref/*.rst /home/x/.PsBotan/Botan-3.2.0/doc/dev_ref/*.rst
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/build_docs.py" --build-dir="build"

clean:
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="build"

distclean:
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/cleanup.py" --build-dir="build" --distclean

install: libs cli docs
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/install.py" --build-dir="build"

check: tests
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/check.py" --build-dir="build"

fmt:
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/dev_tools/run_clang_format.py"

tidy:
	"$(PYTHON_EXE)" "$(SCRIPTS_DIR)/dev_tools/run_clang_tidy.py" --only-changed-files

# Object Files
LIBOBJS = build/obj/lib/asn1_alg_id.o build/obj/lib/asn1_obj.o build/obj/lib/asn1_oid.o build/obj/lib/asn1_print.o build/obj/lib/asn1_str.o build/obj/lib/asn1_time.o build/obj/lib/asn1_ber_dec.o build/obj/lib/asn1_der_enc.o build/obj/lib/asn1_oid_map.o build/obj/lib/asn1_oid_maps.o build/obj/lib/asn1_oids.o build/obj/lib/asn1_pss_params.o build/obj/lib/base_buf_comp.o build/obj/lib/base_sym_algo.o build/obj/lib/base_symkey.o build/obj/lib/block_aes.o build/obj/lib/block_aria.o build/obj/lib/block_cipher.o build/obj/lib/block_blowfish.o build/obj/lib/block_camellia.o build/obj/lib/block_cascade.o build/obj/lib/block_cast128.o build/obj/lib/block_des.o build/obj/lib/block_gost_28147.o build/obj/lib/block_idea.o build/obj/lib/block_kuznyechik.o build/obj/lib/block_lion.o build/obj/lib/block_noekeon.o build/obj/lib/block_seed.o build/obj/lib/block_serpent.o build/obj/lib/block_shacal2.o build/obj/lib/block_sm4.o build/obj/lib/block_threefish_512.o build/obj/lib/block_twofish.o build/obj/lib/block_twofish_tab.o build/obj/lib/codec_base32.o build/obj/lib/codec_base58.o build/obj/lib/codec_base64.o build/obj/lib/codec_hex.o build/obj/lib/compat_sodium_25519.o build/obj/lib/compat_sodium_aead.o build/obj/lib/compat_sodium_auth.o build/obj/lib/compat_sodium_box.o build/obj/lib/compat_sodium_chacha.o build/obj/lib/compat_sodium_salsa.o build/obj/lib/compat_sodium_secretbox.o build/obj/lib/compat_sodium_utils.o build/obj/lib/entropy_srcs.o build/obj/lib/ffi.o build/obj/lib/ffi_block.o build/obj/lib/ffi_cert.o build/obj/lib/ffi_cipher.o build/obj/lib/ffi_fpe.o build/obj/lib/ffi_hash.o build/obj/lib/ffi_hotp.o build/obj/lib/ffi_kdf.o build/obj/lib/ffi_keywrap.o build/obj/lib/ffi_mac.o build/obj/lib/ffi_mp.o build/obj/lib/ffi_pk_op.o build/obj/lib/ffi_pkey.o build/obj/lib/ffi_pkey_algs.o build/obj/lib/ffi_rng.o build/obj/lib/ffi_srp6.o build/obj/lib/ffi_totp.o build/obj/lib/ffi_zfec.o build/obj/lib/filters_algo_filt.o build/obj/lib/filters_b64_filt.o build/obj/lib/filters_basefilt.o build/obj/lib/filters_buf_filt.o build/obj/lib/filters_cipher_filter.o build/obj/lib/filters_comp_filter.o build/obj/lib/filters_data_snk.o build/obj/lib/filters_fd_unix.o build/obj/lib/filters_filter.o build/obj/lib/filters_hex_filt.o build/obj/lib/filters_out_buf.o build/obj/lib/filters_pipe.o build/obj/lib/filters_pipe_io.o build/obj/lib/filters_pipe_rw.o build/obj/lib/filters_secqueue.o build/obj/lib/filters_threaded_fork.o build/obj/lib/hash_blake2_blake2b.o build/obj/lib/hash_checksum_adler32.o build/obj/lib/hash_checksum_crc24.o build/obj/lib/hash_checksum_crc32.o build/obj/lib/hash_comb4p.o build/obj/lib/hash_gost_3411.o build/obj/lib/hash.o build/obj/lib/hash_keccak.o build/obj/lib/hash_md4.o build/obj/lib/hash_md5.o build/obj/lib/hash_par_hash.o build/obj/lib/hash_rmd160.o build/obj/lib/hash_sha1.o build/obj/lib/hash_sha2_32.o build/obj/lib/hash_sha2_64.o build/obj/lib/hash_sha3.o build/obj/lib/hash_shake.o build/obj/lib/hash_skein_512.o build/obj/lib/hash_sm3.o build/obj/lib/hash_streebog.o build/obj/lib/hash_streebog_precalc.o build/obj/lib/hash_trunc_hash.o build/obj/lib/hash_whirlpool.o build/obj/lib/kdf_hkdf.o build/obj/lib/kdf.o build/obj/lib/kdf_kdf1.o build/obj/lib/kdf_kdf1_iso18033.o build/obj/lib/kdf_kdf2.o build/obj/lib/kdf_prf_tls.o build/obj/lib/kdf_prf_x942.o build/obj/lib/kdf_sp800_108.o build/obj/lib/kdf_sp800_56a.o build/obj/lib/kdf_sp800_56c.o build/obj/lib/mac_blake2mac_blake2bmac.o build/obj/lib/mac_cmac.o build/obj/lib/mac_gmac.o build/obj/lib/mac_hmac.o build/obj/lib/mac_kmac.o build/obj/lib/mac.o build/obj/lib/mac_poly1305.o build/obj/lib/mac_siphash.o build/obj/lib/mac_x919_mac.o build/obj/lib/math_bigint_big_code.o build/obj/lib/math_bigint_big_io.o build/obj/lib/math_bigint_big_ops2.o build/obj/lib/math_bigint_big_ops3.o build/obj/lib/math_bigint_big_rand.o build/obj/lib/math_bigint.o build/obj/lib/math_bigint_divide.o build/obj/lib/math_mp_comba.o build/obj/lib/math_mp_karat.o build/obj/lib/math_mp_monty.o build/obj/lib/math_mp_monty_n.o build/obj/lib/math_numbertheory_dsa_gen.o build/obj/lib/math_numbertheory_make_prm.o build/obj/lib/math_numbertheory_mod_inv.o build/obj/lib/math_numbertheory_monty.o build/obj/lib/math_numbertheory_monty_exp.o build/obj/lib/math_numbertheory_nistp_redc.o build/obj/lib/math_numbertheory_numthry.o build/obj/lib/math_numbertheory_primality.o build/obj/lib/math_numbertheory_primes.o build/obj/lib/math_numbertheory_reducer.o build/obj/lib/misc_cryptobox.o build/obj/lib/misc_fpe_fe1.o build/obj/lib/misc_hotp.o build/obj/lib/misc_hotp_totp.o build/obj/lib/misc_nist_keywrap.o build/obj/lib/misc_rfc3394.o build/obj/lib/misc_roughtime.o build/obj/lib/misc_srp6.o build/obj/lib/misc_tss.o build/obj/lib/misc_zfec.o build/obj/lib/modes_aead.o build/obj/lib/modes_aead_ccm.o build/obj/lib/modes_aead_chacha20poly1305.o build/obj/lib/modes_aead_eax.o build/obj/lib/modes_aead_gcm.o build/obj/lib/modes_aead_ocb.o build/obj/lib/modes_aead_siv.o build/obj/lib/modes_cbc.o build/obj/lib/modes_cfb.o build/obj/lib/modes_cipher_mode.o build/obj/lib/modes_mode_pad.o build/obj/lib/modes_xts.o build/obj/lib/passhash_argon2fmt.o build/obj/lib/passhash_bcrypt.o build/obj/lib/passhash_passhash9.o build/obj/lib/pbkdf_argon2.o build/obj/lib/pbkdf_argon2_argon2pwhash.o build/obj/lib/pbkdf_bcrypt_pbkdf.o build/obj/lib/pbkdf.o build/obj/lib/pbkdf_pbkdf2.o build/obj/lib/pbkdf_pgp_s2k.o build/obj/lib/pbkdf_pgp_s2k_rfc4880.o build/obj/lib/pbkdf_pwdhash.o build/obj/lib/pbkdf_scrypt.o build/obj/lib/permutations_keccak_perm_keccak_helpers.o build/obj/lib/permutations_keccak_perm.o build/obj/lib/pk_pad_eme.o build/obj/lib/pk_pad_eme_oaep_oaep.o build/obj/lib/pk_pad_eme_pkcs1_eme_pkcs.o build/obj/lib/pk_pad_eme_raw.o build/obj/lib/pk_pad_emsa.o build/obj/lib/pk_pad_emsa_pkcs1.o build/obj/lib/pk_pad_emsa_pssr_pssr.o build/obj/lib/pk_pad_emsa_raw.o build/obj/lib/pk_pad_emsa_x931.o build/obj/lib/pk_pad_hash_id.o build/obj/lib/pk_pad_iso9796.o build/obj/lib/pk_pad_mgf1.o build/obj/lib/pk_pad_raw_hash.o build/obj/lib/prov_pkcs11_p11.o build/obj/lib/prov_pkcs11_p11_ecc_key.o build/obj/lib/prov_pkcs11_p11_ecdh.o build/obj/lib/prov_pkcs11_p11_ecdsa.o build/obj/lib/prov_pkcs11_p11_mechanism.o build/obj/lib/prov_pkcs11_p11_module.o build/obj/lib/prov_pkcs11_p11_object.o build/obj/lib/prov_pkcs11_p11_randomgenerator.o build/obj/lib/prov_pkcs11_p11_rsa.o build/obj/lib/prov_pkcs11_p11_session.o build/obj/lib/prov_pkcs11_p11_slot.o build/obj/lib/prov_pkcs11_p11_x509.o build/obj/lib/psk_db.o build/obj/lib/psk_db_psk_db_sql.o build/obj/lib/pubkey_blinding.o build/obj/lib/pubkey_curve25519.o build/obj/lib/pubkey_curve25519_donna.o build/obj/lib/pubkey_dh.o build/obj/lib/pubkey_dilithium_common_dilithium.o build/obj/lib/pubkey_dilithium_common_dilithium_symmetric_primitives.o build/obj/lib/pubkey_dl_algo_dl_scheme.o build/obj/lib/pubkey_dl_group.o build/obj/lib/pubkey_dl_group_dl_named.o build/obj/lib/pubkey_dlies.o build/obj/lib/pubkey_dsa.o build/obj/lib/pubkey_ec_group_curve_gfp.o build/obj/lib/pubkey_ec_group.o build/obj/lib/pubkey_ec_group_ec_named.o build/obj/lib/pubkey_ec_group_ec_point.o build/obj/lib/pubkey_ec_group_point_mul.o build/obj/lib/pubkey_ec_h2c.o build/obj/lib/pubkey_ecc_key.o build/obj/lib/pubkey_ecdh.o build/obj/lib/pubkey_ecdsa.o build/obj/lib/pubkey_ecgdsa.o build/obj/lib/pubkey_ecies.o build/obj/lib/pubkey_eckcdsa.o build/obj/lib/pubkey_ed25519.o build/obj/lib/pubkey_ed25519_fe.o build/obj/lib/pubkey_ed25519_key.o build/obj/lib/pubkey_ed25519_ge.o build/obj/lib/pubkey_ed25519_sc_muladd.o build/obj/lib/pubkey_ed25519_sc_reduce.o build/obj/lib/pubkey_elgamal.o build/obj/lib/pubkey_gost_3410.o build/obj/lib/pubkey_keypair.o build/obj/lib/pubkey_kyber_common_kyber.o build/obj/lib/pubkey_mce_code_based_key_gen.o build/obj/lib/pubkey_mce_gf2m_rootfind_dcmp.o build/obj/lib/pubkey_mce_gf2m_small_m.o build/obj/lib/pubkey_mce_goppa_code.o build/obj/lib/pubkey_mce_workfactor.o build/obj/lib/pubkey_mce_mceliece.o build/obj/lib/pubkey_mce_mceliece_key.o build/obj/lib/pubkey_mce_polyn_gf2m.o build/obj/lib/pubkey_pbes2.o build/obj/lib/pubkey_pem.o build/obj/lib/pubkey_pk_algs.o build/obj/lib/pubkey_pk_keys.o build/obj/lib/pubkey_pk_ops.o build/obj/lib/pubkey_pkcs8.o build/obj/lib/pubkey.o build/obj/lib/pubkey_rfc6979.o build/obj/lib/pubkey_rsa.o build/obj/lib/pubkey_sm2.o build/obj/lib/pubkey_sm2_enc.o build/obj/lib/pubkey_sphincsplus_common_sp_fors.o build/obj/lib/pubkey_sphincsplus_common_sp_hash.o build/obj/lib/pubkey_sphincsplus_common_sp_hypertree.o build/obj/lib/pubkey_sphincsplus_common_sp_parameters.o build/obj/lib/pubkey_sphincsplus_common_sp_treehash.o build/obj/lib/pubkey_sphincsplus_common_sp_wots.o build/obj/lib/pubkey_sphincsplus_common_sp_xmss.o build/obj/lib/pubkey_sphincsplus_common_sphincsplus.o build/obj/lib/pubkey_workfactor.o build/obj/lib/pubkey_x509_key.o build/obj/lib/pubkey_xmss_common_ops.o build/obj/lib/pubkey_xmss_hash.o build/obj/lib/pubkey_xmss_index_registry.o build/obj/lib/pubkey_xmss_parameters.o build/obj/lib/pubkey_xmss_privatekey.o build/obj/lib/pubkey_xmss_publickey.o build/obj/lib/pubkey_xmss_signature.o build/obj/lib/pubkey_xmss_signature_operation.o build/obj/lib/pubkey_xmss_verification_operation.o build/obj/lib/pubkey_xmss_wots.o build/obj/lib/pubkey_xmss_wots_parameters.o build/obj/lib/rng_auto_rng.o build/obj/lib/rng_chacha_rng.o build/obj/lib/rng_hmac_drbg.o build/obj/lib/rng.o build/obj/lib/rng_stateful_rng.o build/obj/lib/rng_system_rng.o build/obj/lib/stream_chacha.o build/obj/lib/stream_ctr.o build/obj/lib/stream_ofb.o build/obj/lib/stream_rc4.o build/obj/lib/stream_salsa20.o build/obj/lib/stream_shake_cipher.o build/obj/lib/stream_cipher.o build/obj/lib/tls_credentials_manager.o build/obj/lib/tls_msg_cert_req.o build/obj/lib/tls_msg_cert_verify.o build/obj/lib/tls_msg_client_hello.o build/obj/lib/tls_msg_finished.o build/obj/lib/tls_msg_server_hello.o build/obj/lib/tls_msg_session_ticket.o build/obj/lib/tls_sessions_sql_tls_session_manager_sql.o build/obj/lib/tls_tls12_msg_cert_status.o build/obj/lib/tls_tls12_msg_certificate_12.o build/obj/lib/tls_tls12_msg_client_kex.o build/obj/lib/tls_tls12_msg_hello_verify.o build/obj/lib/tls_tls12_msg_server_kex.o build/obj/lib/tls_tls12_tls_cbc.o build/obj/lib/tls_tls12_tls_channel_impl_12.o build/obj/lib/tls_tls12_tls_client_impl_12.o build/obj/lib/tls_tls12_tls_handshake_hash.o build/obj/lib/tls_tls12_tls_handshake_io.o build/obj/lib/tls_tls12_tls_handshake_state.o build/obj/lib/tls_tls12_tls_record.o build/obj/lib/tls_tls12_tls_server_impl_12.o build/obj/lib/tls_tls12_tls_session_key.o build/obj/lib/tls_tls13_msg_certificate_13.o build/obj/lib/tls_tls13_msg_certificate_req_13.o build/obj/lib/tls_tls13_msg_encrypted_extensions.o build/obj/lib/tls_tls13_msg_key_update.o build/obj/lib/tls_tls13_tls_channel_impl_13.o build/obj/lib/tls_tls13_tls_cipher_state.o build/obj/lib/tls_tls13_tls_client_impl_13.o build/obj/lib/tls_tls13_tls_extensions_key_share.o build/obj/lib/tls_tls13_tls_extensions_psk.o build/obj/lib/tls_tls13_tls_handshake_layer_13.o build/obj/lib/tls_tls13_tls_handshake_state_13.o build/obj/lib/tls_tls13_tls_psk_identity_13.o build/obj/lib/tls_tls13_tls_record_layer_13.o build/obj/lib/tls_tls13_tls_server_impl_13.o build/obj/lib/tls_tls13_tls_transcript_hash_13.o build/obj/lib/tls_tls13_pqc_hybrid_public_key.o build/obj/lib/tls_tls13_pqc_kex_to_kem_adapter.o build/obj/lib/tls_alert.o build/obj/lib/tls_algos.o build/obj/lib/tls_callbacks.o build/obj/lib/tls_ciphersuite.o build/obj/lib/tls_client.o build/obj/lib/tls_extensions.o build/obj/lib/tls_extensions_cert_status_req.o build/obj/lib/tls_handshake_transitions.o build/obj/lib/tls_policy.o build/obj/lib/tls_server.o build/obj/lib/tls_session.o build/obj/lib/tls_session_manager.o build/obj/lib/tls_session_manager_hybrid.o build/obj/lib/tls_session_manager_memory.o build/obj/lib/tls_session_manager_noop.o build/obj/lib/tls_session_manager_stateless.o build/obj/lib/tls_signature_scheme.o build/obj/lib/tls_suite_info.o build/obj/lib/tls_text_policy.o build/obj/lib/tls_version.o build/obj/lib/utils_assert.o build/obj/lib/utils_calendar.o build/obj/lib/utils_charset.o build/obj/lib/utils_cpuid.o build/obj/lib/utils_cpuid_aarch64.o build/obj/lib/utils_cpuid_arm32.o build/obj/lib/utils_cpuid_ppc.o build/obj/lib/utils_cpuid_x86.o build/obj/lib/utils_ct_utils.o build/obj/lib/utils_data_src.o build/obj/lib/utils_dyn_load.o build/obj/lib/utils_exceptn.o build/obj/lib/utils_filesystem.o build/obj/lib/utils_ghash.o build/obj/lib/utils_http_util.o build/obj/lib/utils_locking_allocator.o build/obj/lib/utils_mem_ops.o build/obj/lib/utils_mem_pool.o build/obj/lib/utils_os_utils.o build/obj/lib/utils_parsing.o build/obj/lib/utils_poly_dbl.o build/obj/lib/utils_prefetch.o build/obj/lib/utils_read_cfg.o build/obj/lib/utils_read_kv.o build/obj/lib/utils_scan_name.o build/obj/lib/utils_socket.o build/obj/lib/utils_socket_udp.o build/obj/lib/utils_socket_uri.o build/obj/lib/utils_timer.o build/obj/lib/utils_uuid.o build/obj/lib/utils_version.o build/obj/lib/x509_asn1_alt_name.o build/obj/lib/x509_cert_status.o build/obj/lib/x509_certstor.o build/obj/lib/x509_certstor_flatfile.o build/obj/lib/x509_certstor_sql.o build/obj/lib/x509_certstor_system.o build/obj/lib/x509_crl_ent.o build/obj/lib/x509_key_constraint.o build/obj/lib/x509_name_constraint.o build/obj/lib/x509_ocsp.o build/obj/lib/x509_ocsp_types.o build/obj/lib/x509_pkcs10.o build/obj/lib/x509_attribute.o build/obj/lib/x509_ca.o build/obj/lib/x509_crl.o build/obj/lib/x509_dn.o build/obj/lib/x509_dn_ub.o build/obj/lib/x509_ext.o build/obj/lib/x509_obj.o build/obj/lib/x509_x509cert.o build/obj/lib/x509_x509opt.o build/obj/lib/x509_x509path.o build/obj/lib/x509_x509self.o build/obj/lib/xof_aes_crystals_xof.o build/obj/lib/xof_cshake_xof.o build/obj/lib/xof_shake_xof.o build/obj/lib/xof.o

CLIOBJS = build/obj/cli/argon2.o build/obj/cli/asn1.o build/obj/cli/bcrypt.o build/obj/cli/cc_enc.o build/obj/cli/cipher.o build/obj/cli/cli.o build/obj/cli/cli_rng.o build/obj/cli/codec.o build/obj/cli/compress.o build/obj/cli/entropy.o build/obj/cli/hash.o build/obj/cli/hmac.o build/obj/cli/main.o build/obj/cli/math.o build/obj/cli/pbkdf.o build/obj/cli/pk_crypt.o build/obj/cli/psk.o build/obj/cli/pubkey.o build/obj/cli/roughtime.o build/obj/cli/sandbox.o build/obj/cli/speed.o build/obj/cli/timing_tests.o build/obj/cli/tls_client.o build/obj/cli/tls_http_server.o build/obj/cli/tls_proxy.o build/obj/cli/tls_server.o build/obj/cli/tls_utils.o build/obj/cli/tss.o build/obj/cli/utils.o build/obj/cli/x509.o build/obj/cli/zfec.o

TESTOBJS = build/obj/test/main.o build/obj/test/runner_test_reporter.o build/obj/test/runner_test_runner.o build/obj/test/runner_test_stdout_reporter.o build/obj/test/runner_test_xml_reporter.o build/obj/test/test_aead.o build/obj/test/test_asn1.o build/obj/test/test_bigint.o build/obj/test/test_block.o build/obj/test/test_blowfish.o build/obj/test/test_bufcomp.o build/obj/test/test_c25519.o build/obj/test/test_certstor.o build/obj/test/test_certstor_flatfile.o build/obj/test/test_certstor_system.o build/obj/test/test_certstor_utils.o build/obj/test/test_codec.o build/obj/test/test_compression.o build/obj/test/test_cryptobox.o build/obj/test/test_dh.o build/obj/test/test_dilithium.o build/obj/test/test_dl_group.o build/obj/test/test_dlies.o build/obj/test/test_dsa.o build/obj/test/test_ec_group.o build/obj/test/test_ecc_h2c.o build/obj/test/test_ecc_pointmul.o build/obj/test/test_ecdh.o build/obj/test/test_ecdsa.o build/obj/test/test_ecgdsa.o build/obj/test/test_ecies.o build/obj/test/test_eckcdsa.o build/obj/test/test_ed25519.o build/obj/test/test_elgamal.o build/obj/test/test_entropy.o build/obj/test/test_ffi.o build/obj/test/test_filters.o build/obj/test/test_fpe.o build/obj/test/test_gf2m.o build/obj/test/test_gost_3410.o build/obj/test/test_hash.o build/obj/test/test_hash_id.o build/obj/test/test_kdf.o build/obj/test/test_keccak_helpers.o build/obj/test/test_keywrap.o build/obj/test/test_kyber.o build/obj/test/test_mac.o build/obj/test/test_mceliece.o build/obj/test/test_modes.o build/obj/test/test_mp.o build/obj/test/test_name_constraint.o build/obj/test/test_ocb.o build/obj/test/test_ocsp.o build/obj/test/test_octetstring.o build/obj/test/test_oid.o build/obj/test/test_os_utils.o build/obj/test/test_otp.o build/obj/test/test_pad.o build/obj/test/test_passhash.o build/obj/test/test_pbkdf.o build/obj/test/test_pem.o build/obj/test/test_pk_pad.o build/obj/test/test_pkcs11_high_level.o build/obj/test/test_pkcs11_low_level.o build/obj/test/test_psk_db.o build/obj/test/test_pubkey.o build/obj/test/test_rfc6979.o build/obj/test/test_rng_behavior.o build/obj/test/test_rng_kat.o build/obj/test/test_rngs.o build/obj/test/test_roughtime.o build/obj/test/test_rsa.o build/obj/test/test_simd.o build/obj/test/test_siv.o build/obj/test/test_sm2.o build/obj/test/test_sodium.o build/obj/test/test_sphincsplus.o build/obj/test/test_sphincsplus_fors.o build/obj/test/test_sphincsplus_utils.o build/obj/test/test_sphincsplus_wots.o build/obj/test/test_srp6.o build/obj/test/test_stream.o build/obj/test/test_strong_type.o build/obj/test/test_tests.o build/obj/test/test_thread_utils.o build/obj/test/test_tls.o build/obj/test/test_tls_cipher_state.o build/obj/test/test_tls_handshake_layer_13.o build/obj/test/test_tls_handshake_state_13.o build/obj/test/test_tls_handshake_transitions.o build/obj/test/test_tls_hybrid_kem_key.o build/obj/test/test_tls_messages.o build/obj/test/test_tls_record_layer_13.o build/obj/test/test_tls_rfc8448.o build/obj/test/test_tls_session_manager.o build/obj/test/test_tls_signature_scheme.o build/obj/test/test_tls_stream_integration.o build/obj/test/test_tls_transcript_hash_13.o build/obj/test/test_tpm.o build/obj/test/test_tss.o build/obj/test/test_uri.o build/obj/test/test_utils.o build/obj/test/test_utils_buffer.o build/obj/test/test_workfactor.o build/obj/test/test_x509_dn.o build/obj/test/test_x509_path.o build/obj/test/test_xmss.o build/obj/test/test_xof.o build/obj/test/test_zfec.o build/obj/test/tests.o build/obj/test/unit_asio_stream.o build/obj/test/unit_ecdh.o build/obj/test/unit_ecdsa.o build/obj/test/unit_tls.o build/obj/test/unit_tls_policy.o build/obj/test/unit_x509.o

# Executable targets

$(CLI): $(LIBRARIES) $(CLIOBJS)
	$(EXE_LINK_CMD) $(ABI_FLAGS) $(CLIOBJS) $(BUILD_DIR_LINK_PATH) $(LANG_EXE_FLAGS) $(LDFLAGS) $(EXE_LINKS_TO) -o $@

$(TEST): $(LIBRARIES) $(TESTOBJS)
	$(EXE_LINK_CMD) $(ABI_FLAGS) $(TESTOBJS) $(BUILD_DIR_LINK_PATH) $(LANG_EXE_FLAGS) $(LDFLAGS) --preload-file=/home/x/.PsBotan/Botan-3.2.0/src/tests/data@src/tests/data $(EXE_LINKS_TO) -o $@




# Library targets


./libbotan-3.a: $(LIBOBJS)
	$(AR) $(AR_OPTIONS) $@ $(LIBOBJS)



# Build Commands

build/obj/lib/asn1_alg_id.o: /home/x/.PsBotan/Botan-3.2.0/src/lib/asn1/alg_id.cpp
	$(CXX) $(LIB_FLAGS) $(BUILD_FLAGS)  -I build/include -I build/include/external -c /home/x/.PsBotan/Botan-3.2.0/src/lib/asn1/alg_id.cpp -o $@
.
.
..
..
...
more targets

libs target
prompt> make libs
All ok.

cli target

prompt>make cli
em++  build/obj/cli/argon2.o build/obj/cli/asn1.o build/obj/cli/bcrypt.o build/obj/cli/cc_enc.o build/obj/cli/cipher.o build/obj/cli/cli.o build/obj/cli/cli_rng.o build/obj/cli/codec.o build/obj/cli/compress.o build/obj/cli/entropy.o build/obj/cli/hash.o build/obj/cli/hmac.o build/obj/cli/main.o build/obj/cli/math.o build/obj/cli/pbkdf.o build/obj/cli/pk_crypt.o build/obj/cli/psk.o build/obj/cli/pubkey.o build/obj/cli/roughtime.o build/obj/cli/sandbox.o build/obj/cli/speed.o build/obj/cli/timing_tests.o build/obj/cli/tls_client.o build/obj/cli/tls_http_server.o build/obj/cli/tls_proxy.o build/obj/cli/tls_server.o build/obj/cli/tls_utils.o build/obj/cli/tss.o build/obj/cli/utils.o build/obj/cli/x509.o build/obj/cli/zfec.o -L. -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s NO_DISABLE_EXCEPTION_CATCHING  -lbotan-3   -o botan.html
make: em++: No such file or directory
make: *** [Makefile:83: botan.html] Error 127

Fix Sugestion
Reuse CXX variable in Makefile. When run configure.py.

Change from "EXE_LINK_CMD"

$(CLI): $(LIBRARIES) $(CLIOBJS)
	$(EXE_LINK_CMD) $(ABI_FLAGS) $(CLIOBJS) $(BUILD_DIR_LINK_PATH) $(LANG_EXE_FLAGS) $(LDFLAGS) $(EXE_LINKS_TO) -o $@

To "CXX"

$(CLI): $(LIBRARIES) $(CLIOBJS)
	$(CXX) $(ABI_FLAGS) $(CLIOBJS) $(BUILD_DIR_LINK_PATH) $(LANG_EXE_FLAGS) $(LDFLAGS) $(EXE_LINKS_TO) -o $@

or change value in "EXE_LINK_CMD" to "CXX"

EXE_LINK_CMD   = $(CXX)

@Satancito
Copy link
Author

Satancito commented Dec 19, 2023

An alternative solution. Change value of EXE_LINK_CMD variable in make command.

& make install EXE_LINK_CMD="/home/x/.emsdk/upstream/emscripten/em++"

@randombit
Copy link
Owner

Can you try the following patch?

diff --git a/src/build-data/cc/emcc.txt b/src/build-data/cc/emcc.txt
index ce7dc3205..11c562244 100644
--- a/src/build-data/cc/emcc.txt
+++ b/src/build-data/cc/emcc.txt
@@ -23,5 +23,5 @@ default -> "false"
 </so_link_commands>

 <binary_link_commands>
-default -> "em++"
+default -> "{cxx}"
 </binary_link_commands>

randombit added a commit that referenced this issue Dec 22, 2023
This allows overriding the path to emscripten using CXX and
having it work consistently.

GH #3836
@randombit
Copy link
Owner

I believe this is addressed now on master (and will be thus fixed in upcoming 3.3) using the patch above. Please reopen this issue if this patch does not resolve the issue.

@Satancito
Copy link
Author

Yes. I tried this patch.

Generated makefile

# Makefile for Botan 3.2.0 generated using
# 'configure.py --cpu=wasm --os=emscripten --cc=emcc --disable-shared-library --prefix=/mnt/c/Users/Megam/.CppLibs/Botan-3.2.0-Release-Emscripten-Full'

# Paths to relevant programs
CXX            = /home/x/.emsdk/upstream/emscripten/em++
LINKER         = /home/x/.emsdk/upstream/emscripten/em++
AR             = /home/x/.emsdk/upstream/emscripten/emar
AR_OPTIONS     = cr
PYTHON_EXE     = /usr/bin/python

# Compiler Flags
ABI_FLAGS      =  
LANG_FLAGS     = -s DISABLE_EXCEPTION_CATCHING=0 -std=c++20 -D_REENTRANT 
LANG_EXE_FLAGS = -s ALLOW_MEMORY_GROWTH=1 -s WASM=1 -s NO_DISABLE_EXCEPTION_CATCHING
CXXFLAGS       = -O3 -DBOTAN_IS_BEING_BUILT
WARN_FLAGS     = -Wall -Wextra -Wpedantic -Wshadow -Wstrict-aliasing -Wstrict-overflow=5 -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wshorten-64-to-32
LIB_FLAGS      = 
LDFLAGS        = 

EXE_LINK_CMD   = /home/x/.emsdk/upstream/emscripten/em++
.
.
..
..
...
more content

No issues on install target.

Thanks Jack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants