Skip to content

Linkage error when cross-compiling for aarch64-pc-windows-msvc #453

Closed
@rami3l

Description

@rami3l

Problem:

Originally posted as rustls/rustls-platform-verifier#101, but it turns out it's actually an aws_lc_rs-related issue.

In short, in rust-lang/rustup#3898 we (the Rustup team) are trying to replace the ring backend with aws-lc-rs as a part of Rustup's plan to ship the rustls backend by default (rust-lang/rustup#3806).

When cross-compiling for aarch64-pc-windows-msvc from GitHub's official Windows CI runner however, the following error was generated (see the full error log in the foldable section below):

LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'libaws_lc_sys-0a41df4d7545123e.rlib(bio.c.obj)'
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'libaws_lc_sys-0a41df4d7545123e.rlib(printf.c.obj)'
[..]
LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(chacha.c.obj)'
[..]
libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_ftell referenced in function file_ctrl
libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp__setmode referenced in function file_ctrl
oldnames.lib(strdup.obi) : error LNK2001: unresolved external symbol __imp__strdup
D:\a\rustup\rustup\target\aarch64-pc-windows-msvc\debug\deps\rustls_platform_verifier-824047c6ba53f86f.dll : fatal error LNK1120: 18 unresolved externals
Full Error log
Compiling rustls-platform-verifier v0.3.1
error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.40.33807\\bin\\HostX64\\arm64\\link.exe" "/DEF:C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcjxMRYi\\lib.def" "/NOLOGO" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcjxMRYi\\symbols.o" "D:\\a\\rustup\\rustup\\target\\aarch64-pc-windows-msvc\\debug\\deps\\rustls_platform_verifier-824047c6ba53f86f.rustls_platform_verifier.d3754e06d5d23fde-cgu.0.rcgu.o" "D:\\a\\rustup\\rustup\\target\\aarch64-pc-windows-msvc\\debug\\deps\\rustls_platform_verifier-824047c6ba53f86f.2kbvfqg2xu4cad5i.rcgu.o" "/LIBPATH:D:\\a\\rustup\\rustup\\target\\aarch64-pc-windows-msvc\\debug\\deps" "/LIBPATH:D:\\a\\rustup\\rustup\\target\\debug\\deps" "/LIBPATH:D:\\a\\rustup\\rustup\\target\\aarch64-pc-windows-msvc\\debug\\build\\aws-lc-sys-62247e93288e9cb7\\out\\build\\artifacts\\" "/LIBPATH:C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\aarch64-pc-windows-msvc\\lib" "D:\\a\\rustup\\rustup\\target\\aarch64
  = note:    Creating library D:\a\rustup\rustup\target\aarch64-pc-windows-msvc\debug\deps\rustls_platform_verifier-824047c6ba53f86f.dll.lib and object D:\a\rustup\rustup\target\aarch64-pc-windows-msvc\debug\deps\rustls_platform_verifier-824047c6ba53f86f.dll.exp
          LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
          LINK : warning LNK4286: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(obj.c.obj)'
          LINK : warning LNK4286: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(refcount_c11.c.obj)'
          LINK : warning LNK4286: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(ex_data.c.obj)'
          LINK : warning LNK4217: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function 'aws_lc_0_18_0_bn_mod_exp_mont_small'
          LINK : warning LNK4286: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj)'
          LINK : warning LNK4286: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(thread_win.c.obj)'
          LINK : warning LNK4286: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(windows.c.obj)'
          LINK : warning LNK4217: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function 'bn_less_than_word_mask'
          LINK : warning LNK4286: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(mem.c.obj)'
          LINK : warning LNK4286: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj)'
          LINK : warning LNK4286: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(thread_win.c.obj)'
          LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function 'aws_lc_0_18_0_handle_cpu_env'
          LINK : warning LNK4217: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function 'ctr32_add'
          LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(mem.c.obj)'
          LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj)'
          LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(thread_win.c.obj)'
          LINK : warning LNK4217: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function 'check_test'
          LINK : warning LNK4286: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(pq_custom_randombytes.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(kyber512r3_ref.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(kyber768r3_ref.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(kyber1024r3_ref.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(ml_kem_512_ipd.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(kem.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(printf.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(kem_methods.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(kem_kyber.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_hmac_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(print.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bio.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_dsa_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_ed25519_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_x25519_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_kem_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_x25519.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_kem.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_rsa_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_ec_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(err_data.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(a_object.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(lhash.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_ed25519.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(convert.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(dsa_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(posix_time.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(poly1305.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(rsa_crypt.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(curve25519_nohw.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bn_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(asn1_compat.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(p_methods.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(dsa.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(rsassa_pss_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(ripemd.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(refcount_c11.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(engine.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(ex_data.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(obj_xref.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(forkunsafe.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(windows.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(obj.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(cpucap.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(e_chacha20poly1305.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(thread_win.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(stack.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(rsa_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(mem.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(cbs.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(e_aesgcmsiv.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(cbb.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(ec_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(evp_asn1.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(crypto.c.obj)'
          LINK : warning LNK4217: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function '_vsnprintf_l'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(chacha.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(curve25519.c.obj)'
          LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(ecdsa_asn1.c.obj)'
          LINK : warning LNK4217: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj)' in function '_vfprintf_l'
          LINK : warning LNK4217: symbol 'qsort' defined in 'libucrt.lib(qsort.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(cbb.c.obj)' in function 'aws_lc_0_18_0_CBB_flush_asn1_set_of'
          LINK : warning LNK4217: symbol '_errno' defined in 'libucrt.lib(errno.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(mem.c.obj)' in function 'aws_lc_0_18_0_OPENSSL_vasprintf_internal'
          LINK : warning LNK4286: symbol '_errno' defined in 'libucrt.lib(errno.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj)'
          LINK : warning LNK4286: symbol '_errno' defined in 'libucrt.lib(errno.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj)'
          LINK : warning LNK4217: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj)' in function 'aws_lc_0_18_0_BIO_new_file'
          LINK : warning LNK4217: symbol '_fileno' defined in 'libucrt.lib(fileno.obj)' is imported by 'libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj)' in function 'file_ctrl'
          libaws_lc_sys-2799e0ca1159a8ce.rlib(bio.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(printf.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(posix_time.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(poly1305.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(a_object.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(lhash.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(curve25519_nohw.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(asn1_compat.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(convert.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(dsa_asn1.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(stack.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(engine.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(ex_data.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(ripemd.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(mem.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(cbs.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(e_chacha20poly1305.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(chacha.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(cbb.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(rsa_asn1.c.obj) : error LNK2001: unresolved external symbol __imp__wassert
          libaws_lc_sys-2799e0ca1159a8ce.rlib(bcm.c.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsscanf referenced in function _vsscanf_l
          libaws_lc_sys-2799e0ca1159a8ce.rlib(mem.c.obj) : error LNK2019: unresolved external symbol __imp_realloc referenced in function aws_lc_0_18_0_OPENSSL_vasprintf_internal
          libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj) : error LNK2019: unresolved external symbol __imp_strerror referenced in function err_reason_error_string
          libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj) : error LNK2019: unresolved external symbol __imp_fputs referenced in function print_errors_to_file
          libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj) : error LNK2019: unresolved external symbol __imp_strdup referenced in function aws_lc_0_18_0_ERR_set_error_data
          oldnames.lib(strdup.obi) : error LNK2001: unresolved external symbol __imp_strdup
          libaws_lc_sys-2799e0ca1159a8ce.rlib(err.c.obj) : error LNK2019: unresolved external symbol __imp_bsearch referenced in function aws_lc_0_18_0_ERR_restore_state
          libaws_lc_sys-2799e0ca1159a8ce.rlib(obj.c.obj) : error LNK2001: unresolved external symbol __imp_bsearch
          libaws_lc_sys-2799e0ca1159a8ce.rlib(stack.c.obj) : error LNK2019: unresolved external symbol __imp_qsort_s referenced in function aws_lc_0_18_0_OPENSSL_sk_sort
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_fopen referenced in function aws_lc_0_18_0_BIO_new_file
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_fwrite referenced in function file_write
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_fread referenced in function file_read
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_ferror referenced in function file_read
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_fgets referenced in function file_gets
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_fseek referenced in function file_ctrl
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_feof referenced in function file_ctrl
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp_ftell referenced in function file_ctrl
          libaws_lc_sys-2799e0ca1159a8ce.rlib(file.c.obj) : error LNK2019: unresolved external symbol __imp__setmode referenced in function file_ctrl
          oldnames.lib(strdup.obi) : error LNK2001: unresolved external symbol __imp__strdup
          D:\a\rustup\rustup\target\aarch64-pc-windows-msvc\debug\deps\rustls_platform_verifier-824047c6ba53f86f.dll : fatal error LNK1120: 18 unresolved externals
          
error: could not compile `rustls-platform-verifier` (lib) due to 1 previous error

You can also go to https://github.com/rust-lang/rustup/actions/runs/9624188283/job/26547561849 for the full CI log.

In addition, to prove that this actually has nothing to do with rustls-platform-verifier, another build error without the latter was reproduced in rust-lang/rustup#3917 as https://github.com/rust-lang/rustup/actions/runs/9708177268/job/26794554219.

Relevant details

The lockfile includes the following versions for aws-lc-* dependencies:

[[package]]
name = "aws-lc-fips-sys"
version = "0.12.9"

[[package]]
name = "aws-lc-rs"
version = "1.7.3"

[[package]]
name = "aws-lc-sys"
version = "0.18.0"

System information for the official GitHub runner in question:

Current runner version: '2.317.0'
Operating System
  Microsoft Windows Server 2022
  10.0.20348
  Datacenter
Runner Image
  Image: windows-2022
  Version: 20240624.1.0
  Included Software: https://github.com/actions/runner-images/blob/win22/20240624.1/images/windows/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20240624.1
Runner Image Provisioner
  2.0.370.1

Another interesting detail is that this seems to work without issues when compiling natively on an ARM64 Windows machine:

I was able to compile and run the tests for rustls-platform-verifier in an ARM64 Windows 11 VM with the aws_lc_rs backend earlier today. The steps I took to setup the environment were:

  • Installed the latest CMake from their website
  • Installed the latest Ninja from GitHub releases
  • Download the latest Visual Studio 2022 Tools installer
  • Installed these components:
    • Windows 11 SDK
    • MSVC v143 C++ ARM64 build tools

I then:

  • Edited rustls-platform-verifier's main branch to use aws_lc_rs everywhere ring currently is
  • Ran cargo test.

With this setup, I don't get the errors you reported FWIW. @ctz mentioned this in the project Discord but it looks like there isn't a compatible ucrt available to your build since all the missing symbols should be coming from it. I saw the VS installer install a ARM64 ucrt implementation, so maybe that's part of what's missing?
Originally posted by @complexspaces in rustls/rustls-platform-verifier#101 (comment)

Many thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions