Skip to content

v5 link failure #505

@PaulDance

Description

@PaulDance

Hi,

I have tried upgrading our project to using v5, however in doing so, the following weird linker error occurs:

error: linking with `/nix/store/81nnwpxsmjzkwxqzjpbkazlw2gbhgi44-x86_64-unknown-linux-musl-gcc-wrapper-15.2.0/bin/x86_64-unknown-linux-musl-gcc` failed: exit status: 1
  |
  = note:  "/nix/store/81nnwpxsmjzkwxqzjpbkazlw2gbhgi44-x86_64-unknown-linux-musl-gcc-wrapper-15.2.0/bin/x86_64-unknown-linux-musl-gcc" "-m64" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/rcrt1.o" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crti.o" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtbeginS.o" "[...]/target/x86_64-unknown-linux-musl/release/deps/rustc8ziHQe/symbols.o" "<17 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "[...]/target/x86_64-unknown-linux-musl/release/deps/{libconfig-6c9c61896e37df33,libpathdiff-d296a2564e31c710,libtoml-5499fdf896ea29a6,libtoml_edit-b15c59c496944696,libserde_spanned-e7b8570be1dec9cf,libtoml_datetime-703e075eed47db1c,libwinnow-c3500c1e322eb6c8,libargh-f34ea2d771731614,libargh_shared-55d097bfddb0bafc,libhl_communication-458aebe4d069e162,libhl_constants-be2c10a8e34deddf,libhyper_rustls-9cdc3875776abf58,librustls_native_certs-6a9a2c85cf7c4fa5,libopenssl_probe-664548dfaa217477,libhl_param-bb217314ce1a2038,libhl_agent_structs-6f4aa882f0a196be,libhl_impersonation-9fa394effc78d9f7,libhl_ebpf-7eabcf42c2be7d9e,libhl_system-398b8b84d2ff8722,libtar-0e46d6850391da5f,libxattr-f991ce681e90f1a7,librustix-134aff22a666f5a3,liblinux_raw_sys-8f7bc80368864d49,libfiletime-22f7582ad758230e,librayon-aaf24e31f9e1a000,librayon_core-14e2c83f96c33770,libcrossbeam_deque-370f348e4428a83a,libcrossbeam_epoch-423db33bfd5386b9,libcrossbeam_utils-c0daa9425a54f9df,liblzma_rs-c5a0f382d438820e,libcrc-82660040bb014a69,libcrc_catalog-393aefc015291c52,libhl_ebpf_sys-f5f84879c8c2c7cc,libaya-bf989626c49bbdf6,libassert_matches-cdd6a1e7fa78843d,libaya_obj-c47a5b76182ee3c2,libhl_proc_startid-e44b31922e945a36,libhl_agent_store-2347ca56ea224372,libhl_store-e7b4c258f5146fbc,libtempfile-cbf0d096231ed048,libfastrand-abb5b34f7a140781,librustix-29df0f35a0bc7dc0,liblinux_raw_sys-74a2f6f8f0b9f37b,librusqlite-ebff6efb0ab4b450,libhashlink-eb31138831655315,libhashbrown-4ed33a2817e17769,libfoldhash-ff9fdc7bfa791472,liblibsqlite3_sys-6d9cedd3b8b78732,libfallible_streaming_iterator-7d2f507d46ba79d1,libfallible_iterator-453a9395dd916412,libhyper_proxy2-edc5de49248b943c,libheaders-1ad506e15fc684ae,libsha1-703c2501812f4058,libheaders_core-c7c99d74e6b7de60,libbase64-836ecaa8d9f7986c,libhyper_boring-d3dec3b177bd7c1d,libtower-5475b8a90619448b,libantidote-a0e845d5554f20ab,liblinked_hash_set-83992cd2d1f5eae1,liblinked_hash_map-d978f9d0a552b6d5,libtokio_boring-acf6ef0a4570001f,libhl_directories-612d12322bc5b045,libhl_proto-be8ef51b783a90e3,libhl_tracing-baad3f0a52ab988f,libhl_version-653f382f9e4f6eee,libhl_fs-2ed07b373e3fc962,libthiserror-6537a22496b5a387,libhl_osstr-3c58760fb8f19e10,libunicase-a455074fc8fdfeed,libsentry_contrib_breakpad-bfa9d8dd4e6798f3,libbreakpad_handler-090482ea7073543c,libbreakpad_sys-e0b826481cb2fd04,libsentry-ee6b5c1c727a7207,libsentry_tracing-48418171fdd29337,libtracing_subscriber-df743c24b0ff3bac,libthread_local-91d2f00244ca3b2a,libsharded_slab-970792f208f7d931,liblazy_static-0c19ad66d34022f7,libtracing_log-e9f99676196505b7,libsentry_debug_images-cd9e42e4782a071c,libfindshlibs-9ea7ad68ada7f54b,libsentry_backtrace-16f78ee9d745dcbe,libbacktrace-a23e05be5add35bc,libminiz_oxide-daa3e842617ed774,libsimd_adler32-d798e5046c9d67ed,libobject-eb93b7560cdbe2f5,libcrc32fast-b6f494f7d56ec935,libruzstd-91d24e6b539d931f,libtwox_hash-3ad1c754712c1960,libflate2-35c2202d6acc3518,libzlib_rs-3a6398feb920ce4d,libaddr2line-6a6cf4cb69c67afb,libgimli-7c57377820235d7c,librustc_demangle-5a782d75254542a1,libsentry_core-548c4fc062882209,libsentry_types-dd3372caf3e32241,librand-754b53d5b6a249b4,librand_chacha-5a621ccb8aad8727,libdebugid-5326791d3fcbc0c4,libserde_json-26f12199ca8e1ac9,libzmij-851da6fade3243a7,liburl-7f1d31f69410f71e,libidna-146e14df9a3fabf7,libidna_adapter-c2e55cf5c2ed503d,libicu_normalizer-e784c3bae70228b8,libicu_normalizer_data-51f042f8434c682c,libwrite16-fb8e7b1f0188569e,libutf8_iter-ec948cdfe0b86125,libutf16_iter-0047e84abac9fe00,libicu_properties-e24b7da4ee4fe140,libicu_properties_data-5a0cf05593598062,libicu_locid_transform-0015e05506d6dfe0,libicu_locid_transform_data-12b674b3f61a5b73,libicu_collections-7ef223ff6d8a3ba2,libicu_provider-f36f3b57c1dff0d1,libicu_locid-893135866d54c720,liblitemap-8cfe6d0ceaac5ba0,libtinystr-ed659b0588f43c19,libzerovec-7578cb3b00a4874b,libwriteable-d63639fe5e25a895,libyoke-a59b92a6560bef0e,libzerofrom-5072dfa0f7c8a429,libstable_deref_trait-0e6e3fe0faf2792e,libform_urlencoded-31ef38fd915a6afd,libbrotli-673306de26b3a0ed,libbrotli_decompressor-6dab6870a3f532bc,liballoc_stdlib-fe720fe0ad96ac47,liballoc_no_stdlib-d925fcb40ff72a6a,libstatic_assertions-26b86fa2e40e2092,libhl_proto_types-6aec127cca482069,libhl_time-3aeeccf6f8292790,libpbjson_types-db6e4d9b00c8e65b,libpbjson-b9b767add219b3d6,libtime-dcc3265fd73e61e9,libnum_threads-ab7656e42d309200,libtime_core-eb6fb2d02a5c8296,libnum_conv-a25b7ed5e8e420cc,libderanged-fd78b508b7b433cb,libpowerfmt-829fc4f20df77ce8,libstrum-beea48756fda624a,libregex-b479ff3779759d30,libregex_automata-32547bd3b4328625,libaho_corasick-713f78e913d65363,libregex_syntax-84062a3eb3b6da48,libitertools-039fa175567cccda,libeither-b2ba9cca3b179076,libhex_literal-24c021e28e02f270,libhl_interner-b1f9a134e4d297a1,libscc-59a58e1d59973db9,libsaa-8c322e5b31d57658,libsdd-c562db4af8f79bb6,liblz4_flex-ba37836c4f7f6a85,libtwox_hash-385b2d7a7ff94d63,libchacha20poly1305-157abccca8db253c,libpoly1305-b853f41342e1f9d4,libaes_gcm-c3a8b40183c12f77,libctr-b01555cb50690feb,libghash-cd9f4ff4b26c2a56,libpolyval-23f490e0666f750b,libopaque_debug-db00e3fa44edabf7,libuniversal_hash-ea3cf56d858dece1,libaes-399cfce5cddfde1f,libaead-5bc2040b62a07633,libtonic_prost-89e4d11e72e744be,libtonic-6c99907354cc9064,libhyper_timeout-9b3d93eeba1b69eb,libtokio_rustls-487c4380d97fa074,librustls-c4575857cf05823d,libwebpki-adde8c478a9a7d6a,libring-00c4b04dfd217c52,libspin-2bb387c6ebb9b670,libuntrusted-da3c8f405a221285,librustls_pki_types-069ee11a64deba12,libhyper_util-29946c72293c67ff,libsocket2-665d3f940a5dc906,libaxum-e212728dfc869ef9,libpercent_encoding-caead2f2c5a018d0,libmatchit-4ad2aaece0f37879,libaxum_core-aabb9db674c8c1d9,libmime-10002d9e7ba3f5f7,libtower-af12cd928a17d7e6,libtower_layer-8960330ef8af0af4,libbase64-dfce50c8587abec2,libpin_project-9d7f0d3438b61dc4,libsync_wrapper-1a1630b80c896332,libtower_service-6c0476f770852fdb,libtokio_stream-1ee150cdeae7d8b5,libhttp_body_util-6c5fb046ba8226a3,libprost-981df1bef4ccd38b,libhl_agent_config-7a3105adfb5ade22,libhl_linux-ae419e3b159fc1ad,libhl_hostname-c6dc801a993688fe,libhl_network_management-e8a3b15379515ce0,librtnetlink-25efb429e3798245,libnetlink_proto-3bbdc4062f1b945e,libnetlink_sys-82c616f8c608ba31,libnetlink_packet_route-16b2a5a3852edae8,libnetlink_packet_core-17de6343690fe806,libnetlink_packet_utils-f2a3383d2807a196,libthiserror-86e9db3fac5a216b,libanyhow-efe94e3eb4c806d8,libbyteorder-372a2ee514929e46,libfutures-75d21873006c793d,libfutures_executor-6b813e91891aea36,libfutures_util-3122e40588d4c37a,libmemchr-5fcfdb2e6f6e7d81,libfutures_io-b20ffdb4b78705f9,libfutures_task-bf851e3006790afd,libnix-d30d7c7423e05b74,libmemoffset-d1fbc54814dd4fb2,libipnet-570910482cd9332c,libhex-93ce5c1d9e1b2276,libhyper-ca98e6c89aa4b1d8,libwant-a4e71597c79fca56,libtry_lock-e14561e5be4cb254,libhttparse-d476539cac3d3f51,libh2-7091a54efeb526a5,libslab-9e1ee26fae750125,libpin_utils-ebbb4cb4ae245c0d,libatomic_waker-ad0b4a71cfa5526a,libhttpdate-aea11260e450ce0f,libfutures_channel-b9e6c49777ba537c,libhttp_body-076f1801f55cad00,libhttp-21c7dbc62c31aded,libitoa-2cf7e782fad1336d,libfnv-d762469884195d77,libhl_utils-9fd00eb0e0a87a8b,libuuid-f362ea06d5b96ad7,libgetrandom-43008f285a228830,libhl_tokio-cf7cbeac55bc6e4f,libtokio_util-31394e9d9c3a6b08,libfutures_core-00357f3d66592fb7,libfutures_sink-4b1e72a6caf1819a,libtokio-bad524f58187e74a,libsignal_hook_registry-9c47b7dc91d166cf,libsocket2-a4ea52c211368fc8,libbytes-afaa217547e7cec8,libmio-1492907ffc8873c6,libparking_lot-94c972f1d46b6204,libparking_lot_core-7a32b8ad5e603900,libsmallvec-5e54aed112457957,liblock_api-182afc2feb4a20ef,libserde-5caeb3a497e56044,libscopeguard-22cf9b9db0ab3517,libhl_ini-88cc0177bbad5471,libconfigparser-8d537cd9211fcac9,libindexmap-b7859fea407e5a9a,libserde_core-a146b007ce4091fd,libhashbrown-102843d3c3a9c31e,libequivalent-fdc28497c672003c,liballocator_api2-0ba2b01d21d5fff0,libfoldhash-bd7a1c1c59e72514,libhl_hash-a5266e261b558924,libmd5-74ba3d2aaea069b7,libsha2_const-8eeed7f5730fdb51,libhl_crypto-9ea3c24049d7bf17,libboring-569876b8a9389b6d,libboring_sys-bebef9d79b6119a6,libforeign_types-be73714f8dae25db,libforeign_types_shared-717e1b0de7f09c95,libbitflags-127a2031ab096594,libchacha20-71c4db23ffe59b0d,libcipher-68348a10588efa9d,libinout-c8edaab513f9aab4,libblock_padding-6160a287e3ab4bf7,libshabal-5735c9281c65af48,librand-78275bb34c05559d,librand_chacha-54dbd62d2f571ea9,libppv_lite86-55dc6a132756e538,librand_core-44fcac939db5ece5,libgetrandom-c4c8dd01c89276d3,libgroestl-91f8d14ee56e4ce1,libzeroize-268de0a176de1714,libsha2-f1431231bde16125,libcpufeatures-ced7bc7e206a6c18,libhkdf-1546c2f7e7f12dc9,libhmac-3afb0fdce5679003,libdigest-47a8e1c0b78943b0,libsubtle-755ee66c5c47a8db,libconst_oid-4aa8281dfe36836d,libblock_buffer-cbece0f19f4feb11,libcrypto_common-d7de10f78ffa43bb,librand_core-e96764c5489c3096,libgetrandom-9413d6ed444c3bf7,liblibc-2fa0889ce943444b,libcfg_if-2f3ad20d9961d853,libgeneric_array-09abc3aa57e780f4,libtypenum-0842a1dbc66c0464,libed25519_compact-15fdb2e69f72a59d,libhl_std-c3f7172fdf530dec,libobflog-3ed598acc4a8628c,libtracing-5bb2d654e80af667,liblog-eb94df73f500f3e6,libpin_project_lite-a6cb139c5e183dc1,libtracing_core-eccde3a8608d10fd,libonce_cell-6738a30855c92666,libobfstr-f93e16678c992587}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*}.rlib" "-lunwind" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/liblibc-*.rlib" "-lc" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/{librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lstdc++" "-L" "[...]/target/x86_64-unknown-linux-musl/release/deps/rustc8ziHQe/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-nostartfiles" "-L" "/nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib" "-L" "/nix/store/rv4c31ryip8azhh98l4gvvxrfznwbssk-musl-x86_64-unknown-linux-musl-1.2.5/lib" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/boring-sys-5816a72ee9985233/out/build/lib" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/boring-sys-5816a72ee9985233/out/build/crypto" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/boring-sys-5816a72ee9985233/out/build/ssl" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/boring-sys-5816a72ee9985233/out/build/" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/breakpad-sys-91b882c2d5c344c2/out" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/ring-2b161cea703e5b44/out" "-L" "[...]/target/x86_64-unknown-linux-musl/release/build/libsqlite3-sys-680082211d0e98ab/out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib" "-o" "[...]/target/x86_64-unknown-linux-musl/release/deps/back_stress-52f811b27afc7ddb" "-Wl,--gc-sections" "-static-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-Wl,--build-id=sha1" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtendS.o" "<sysroot>/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/crtn.o"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib/libstdc++.a(cp-demangle.o): in function `d_append_num':
          (.text+0x9cc): undefined reference to `sprintf'
          /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib/libstdc++.a(cp-demangle.o): in function `d_print_lambda_parm_name':
          (.text+0xada): undefined reference to `sprintf'
          /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib/libstdc++.a(cp-demangle.o): in function `d_type':
          (.text+0x15e7): undefined reference to `sprintf'
          /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib/libstdc++.a(cp-demangle.o): in function `d_print_comp_inner':
          (.text+0x5730): undefined reference to `sprintf'
          /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x7683): undefined reference to `sprintf'
          /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib/libstdc++.a(cp-demangle.o):(.text+0x786b): more undefined references to `sprintf' follow
          /nix/store/ghh9ph8sxhxmd908na3njl3sbmpnffn3-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/m4jki8j89n6r261n5wm9z18kznw5gmby-x86_64-unknown-linux-musl-gcc-15.2.0/x86_64-unknown-linux-musl/lib/libstdc++.a(eh_alloc.o): in function `_GLOBAL__sub_I_eh_alloc.cc':
          (.text.startup._GLOBAL__sub_I_eh_alloc.cc+0x4b): undefined reference to `secure_getenv'
          collect2: error: ld returned 1 exit status
          
  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

It occurs specifically for x86_64-unknown-linux-musl and no other target (three Windows ones and two macOS ones). Also, for some odd reason, I can't yet seem to be able to reproduce the error locally, only in CI for now. We use Nix in order to bring much of the build dependencies in. We use MUSL-GCC as both the C/C++ compiler and linker for this target.

I see that the contents of the boring-sys/deps/boringssl/ directory have changed quite a bit between v4 and v5: could there have been some breakage there somehow? Most of the build tooling is up-to-date on our side as far as I can tell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions