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

Build failure when dynamic_linking feature is used #9747

Closed
mdickopp opened this issue Sep 10, 2023 · 7 comments · Fixed by #9752
Closed

Build failure when dynamic_linking feature is used #9747

mdickopp opened this issue Sep 10, 2023 · 7 comments · Fixed by #9752
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior P-High This is particularly urgent, and deserves immediate attention
Milestone

Comments

@mdickopp
Copy link
Contributor

Bevy version

main branch, commit 17edf4f

The issue does not occur with the previous commit.

Relevant system information

  • Debian Linux (testing, trixie)
  • System linker (GNU ld 2.41)
  • Rust 1.72.0

What you did

Run command cargo run --example hello_world --features dynamic_linking in checked out bevy repository.

What went wrong

Expected behavior

The command should build and run the hello_world example, i.e., print hello world.

Actual behavior

The command fails with the following output:

   Compiling bevy_dylib v0.12.0-dev (/home/martin/tmp/bevy/crates/bevy_dylib)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/lib/ccache:/home/martin/.local/bin:/home/martin/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/martin/.cargo/bin:/home/martin/.npm/bin" VSLANG="1033" "cc" "-Wl,--version-script=/tmp/rustcVOQms7/list" "-Wl,--no-undefined-version" "-m64" "/tmp/rustcVOQms7/symbols.o" "/home/martin/tmp/bevy/target/debug/deps/bevy_dylib.1sebsf4e8g3dhjez.rcgu.o" "/home/martin/tmp/bevy/target/debug/deps/bevy_dylib.3lnuvt72hjeve51d.rcgu.rmeta" "-Wl,--as-needed" "-L" "/home/martin/tmp/bevy/target/debug/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/martin/tmp/bevy/target/debug/deps/libbevy_internal-58607d37a3fec7e7.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_gizmos-7131d18ac945580b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_winit-94b704e2e2c57992.rlib" "/home/martin/tmp/bevy/target/debug/deps/libaccesskit_winit-ee6ed0198285b5aa.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwinit-5e391fb0c937f104.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmio-6ed2cdf89e5a80c3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libx11_dl-a918141c3ad9e960.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_ui-75ec27c9bf3265bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtaffy-66b0c457f3369229.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgrid-9933c5d26f40aacc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libslotmap-970d0567a0035413.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_text-4f0ca34e806eeaaf.rlib" "/home/martin/tmp/bevy/target/debug/deps/libglyph_brush_layout-2481dfe32241ae49.rlib" "/home/martin/tmp/bevy/target/debug/deps/libxi_unicode-3cd3dfb4b40e1f8a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libapprox-79bb156fb47e2b71.rlib" "/home/martin/tmp/bevy/target/debug/deps/libab_glyph-92ad514d2cc3965e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libowned_ttf_parser-df67295f95aa2b5b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libttf_parser-e633e9ece00524bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libab_glyph_rasterizer-64591ad0758f1363.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_sprite-6ddae01a02847b50.rlib" "/home/martin/tmp/bevy/target/debug/deps/librectangle_pack-3aaf09ce7172a8f9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libguillotiere-00346a2cee4de321.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsvg_fmt-1499d0d0dda6f1d1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libeuclid-c1c1cdf295ee987f.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_gltf-941215de071c2816.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpercent_encoding-1c838f66e10d971e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbase64-303b1f5dc1de2774.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgltf-31ae1d1291c7d4f1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgltf_json-176cc03da6fdd791.rlib" "/home/martin/tmp/bevy/target/debug/deps/libserde_json-071af4409f0aa21c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libryu-07bba3d256252af8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libitoa-5351249f7154fdc4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_pbr-f840768090768ced.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_gilrs-3c708799a21ee849.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgilrs-91837ab03e0056c3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfnv-4d87e4d2bb291f2a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgilrs_core-f6a69130066bb2b3.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibudev_sys-79fbc4951aec24ea.rlib" "/home/martin/tmp/bevy/target/debug/deps/libvec_map-e18a692d8f777d4c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnix-238f0d5c39db7e48.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_core_pipeline-c2704198fc44f332.rlib" "/home/martin/tmp/bevy/target/debug/deps/libradsort-38b0d83fa20e392d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_audio-8c27ba0a5f12c22c.rlib" "/home/martin/tmp/bevy/target/debug/deps/librodio-6dade85c3fd192cc.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblewton-81bd4c192cd88a56.rlib" "/home/martin/tmp/bevy/target/debug/deps/libogg-11d75c485dfed590.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtinyvec-3fd4ab6967b9f11c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtinyvec_macros-267d34b29e8276e3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcpal-56e60edb8d646604.rlib" "/home/martin/tmp/bevy/target/debug/deps/libdasp_sample-e4dfb0e3fa59bd4c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libalsa-c8cdcc1d5d5e3cd0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnix-fe1478fccb045ea9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libalsa_sys-bea4b4af767edff7.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_animation-f4529e05f973d1ea.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_scene-32db5eefc2195856.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_render-dc3a0642b5611be1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libruzstd-cc693d48b67c59dd.rlib" "/home/martin/tmp/bevy/target/debug/deps/libthiserror_core-c1c18f5f748da946.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtwox_hash-b03cc3fd774eb08a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnaga_oil-2ccb57b5fd582807.rlib" "/home/martin/tmp/bevy/target/debug/deps/libunicode_ident-1cb5c4154aef338b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libdata_encoding-9cd3bf6e32e09e8c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_mikktspace-b1233ff37bd389b5.rlib" "/home/martin/tmp/bevy/target/debug/deps/libimage-2b8f3bd8732b3205.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcolor_quant-b7cf6246af0c842e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpng-e849aba0acc4a048.rlib" "/home/martin/tmp/bevy/target/debug/deps/libflate2-4eb333e7454d62a1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libminiz_oxide-4b77c2e8fe933f4d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfdeflate-44a0a80fd44916d2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsimd_adler32-7f9432a8f56af434.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcrc32fast-faf80f280cc1bb4a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnum_rational-57147f58affb9ab3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnum_integer-ba8aa51d5e2d6a20.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbyteorder-649c0b498eb5f4d1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libktx2-06041e2634e67992.rlib" "/home/martin/tmp/bevy/target/debug/deps/libencase-ff3146afa7a873b2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconst_panic-0de456f3a1591a1d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhexasphere-bd55f76d4ddb2a25.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconstgebra-1e9690f157344d4d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconst_soft_float-11cfd4e58246b426.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu-e21f76bf1d950da8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libstatic_assertions-31ba3f8d1564dfe4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu_core-59a494543c65a54b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu_hal-c1cc5186666c660a.rlib" "/home/martin/tmp/bevy/target/debug/deps/librenderdoc_sys-3e956478e7a6d03c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_descriptor-8d5deab566b8e61d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_descriptor_types-c6a6d6fe62c476a9.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibloading-69609ae89ce75177.rlib" "/home/martin/tmp/bevy/target/debug/deps/libkhronos_egl-c04cfffc04a80170.rlib" "/home/martin/tmp/bevy/target/debug/deps/libprofiling-c294894da49345fb.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_alloc-de651481b355c0f3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_alloc_types-2fa56c39eed8895c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libash-778e9b28ad4d0a5f.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibloading-83db7c797ca32a3b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnaga-5c503a7640f0636b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhexf_parse-19769a31418764f4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbit_set-f1eb00a5c4938eea.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbit_vec-708b08d83d105d3b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcodespan_reporting-bbd20dad31af1d84.rlib" "/home/martin/tmp/bevy/target/debug/deps/libunicode_width-3f45be079f27c499.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtermcolor-930992c1f8f11477.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpp_rs-753d71ee06e60619.rlib" "/home/martin/tmp/bevy/target/debug/deps/libunicode_xid-45345417c79fff97.rlib" "/home/martin/tmp/bevy/target/debug/deps/libspirv-6deb846d88ea68c8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnum_traits-0356f7aaf509f13b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbitflags-1926cec1a16924e0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libindexmap-dd896f99c2b62b80.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhashbrown-1639d654e124c1f7.rlib" "/home/martin/tmp/bevy/target/debug/deps/libahash-6f40bc731d0e3b92.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu_types-7156c79f40247a51.rlib" "/home/martin/tmp/bevy/target/debug/deps/libglow-82c645a85137a227.rlib" "/home/martin/tmp/bevy/target/debug/deps/libarrayvec-6916d94f783ab2b2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_window-0a60320368289e93.rlib" "/home/martin/tmp/bevy/target/debug/deps/libraw_window_handle-93c10ba3b4fc818a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_transform-6e55c973a592e7cd.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_hierarchy-d2d6aa3c72be4df2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_input-5eb7dc06896ac4c4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_diagnostic-526402f778696ceb.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_time-a8a956661102363b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_core-571385aa771c2d25.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_asset-417fe41e74a9a830.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_broadcast-c58019b99e1c6b11.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmd5-97078de9911b613c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libron-5c8b3af43613e638.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbitflags-bf7adebfb11df1ab.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbase64-b690142577ee2af1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_log-c99f64154dc4c968.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing_subscriber-7f6ab9cf0c3b0580.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnu_ansi_term-52ff66b094c58e22.rlib" "/home/martin/tmp/bevy/target/debug/deps/liboverload-2b65450f9f69567a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsharded_slab-ecb230e4b55b672a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmatchers-cdbfacad5a78312b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_automata-cc31c3c847567d44.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_syntax-4fb8567a4973916b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex-83aa7728f1ed84b5.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_automata-eb447f951ca62371.rlib" "/home/martin/tmp/bevy/target/debug/deps/libaho_corasick-5758ce179aee613c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_syntax-acc9cef604855d12.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing_log-b4b6272a94dac1a1.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblazy_static-643a017f62beb017.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcrossbeam_channel-72bac9fef8b57325.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_fs-68f9750ecec14308.rlib" "/home/martin/tmp/bevy/target/debug/deps/libblocking-82d45aa00edcc7cd.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblog-895a7d6396d4d394.rlib" "/home/martin/tmp/bevy/target/debug/deps/libatomic_waker-d68edf10272b3f49.rlib" "/home/martin/tmp/bevy/target/debug/deps/libanyhow-e7aa7e65ac173784.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_a11y-222610da9518bb86.rlib" "/home/martin/tmp/bevy/target/debug/deps/libaccesskit-9cf58743f956eed8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_app-c7f09e75d164e421.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_ecs-9745b55553a6b813.rlib" "/home/martin/tmp/bevy/target/debug/deps/librustc_hash-3af456ac9bcd35b4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libthread_local-f9b07bda76550363.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_tasks-e18210d6f2b8c367.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_channel-0190818e5ec297a4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_executor-604e82cd94271b4e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libslab-196fddbee6a75cdd.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_lock-af1b1ebffae8a3c0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libevent_listener-346605a9db2c0e34.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfutures_lite-0d37c6c02357680a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmemchr-333149cdd616a6c6.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfastrand-e6406709308aa321.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfutures_io-1455dcdc174b781f.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfutures_core-25b757fb82367445.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwaker_fn-3bf990f227163674.rlib" "/home/martin/tmp/bevy/target/debug/deps/libparking-57f2096a7a27190c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconcurrent_queue-15e5f7712393f2d6.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcrossbeam_utils-b7bedb7b710f431f.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_task-f0b52c7611d93ec0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_reflect-03e540717bbf74c9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsmol_str-e6d74db7d1cc33dd.rlib" "/home/martin/tmp/bevy/target/debug/deps/liberased_serde-dac9cf9eb5200514.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_math-b178f72b2d085c86.rlib" "/home/martin/tmp/bevy/target/debug/deps/libglam-defd7ab7d8cd69fa.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbytemuck-88f70619a3e45b87.rlib" "/home/martin/tmp/bevy/target/debug/deps/libparking_lot-c4ce06ca471f7b38.rlib" "/home/martin/tmp/bevy/target/debug/deps/libparking_lot_core-85a9e65cf9b0a06a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsmallvec-4e5e9afe78a52962.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblock_api-5b573ab2fe3fad0a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libscopeguard-2448006f136b7268.rlib" "/home/martin/tmp/bevy/target/debug/deps/libdowncast_rs-cbc0b23857f6c1f9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_ptr-288042f6a060b0f2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_utils-1ec1e55fe1d0fd77.rlib" "/home/martin/tmp/bevy/target/debug/deps/libuuid-ec8f95c7144f63bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing-494df13252aa3823.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpin_project_lite-a76229303093e015.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing_core-1d5c8a1907215259.rlib" "/home/martin/tmp/bevy/target/debug/deps/libthiserror-b75ccf0709e3a762.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpetgraph-8f78af984f7f3556.rlib" "/home/martin/tmp/bevy/target/debug/deps/libindexmap-b309f99fc43f8679.rlib" "/home/martin/tmp/bevy/target/debug/deps/libequivalent-7257265f83ae57da.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfixedbitset-14fc5db9e5d0b704.rlib" "/home/martin/tmp/bevy/target/debug/deps/libinstant-f5b0c5ca8ce358bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhashbrown-9a8fc373705e70d3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libserde-0b9a39148650e28f.rlib" "/home/martin/tmp/bevy/target/debug/deps/liballocator_api2-76a1655c0106d913.rlib" "/home/martin/tmp/bevy/target/debug/deps/libahash-ef9e458e64c8032a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgetrandom-8a576451914e76b3.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibc-7210a355a56b809e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libonce_cell-55f61dcd952bd954.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcfg_if-a4949322dd83a0a2.rlib" "-L" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-lstd-8f88c761e33f2651" "-Wl,-Bstatic" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b114db70ea0690b1.rlib" "-Wl,-Bdynamic" "-ldl" "-ludev" "-lasound" "-ldl" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/martin/tmp/bevy/target/debug/deps/libbevy_dylib.so" "-shared" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: /usr/bin/ld: _ZN96_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_registry..GetTypeRegistration$GT$21get_type_registration17h92b7a10ff8fb1dbfE: undefined version: 
          /usr/bin/ld: _ZN87_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..from_reflect..FromReflect$GT$12from_reflect17h77ac65f98b65726cE: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$9field_mut17h0a89c6e84327d3f6E: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$9field_len17h53361f8577385f4bE: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$8field_at17h41103bfcc57e199dE: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$7name_at17hc1fc1efcc7736fceE: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$5field17h61b51fb5ae71f5eeE: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$13clone_dynamic17h79ddba5a9a7eb4ddE: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$12field_at_mut17h12fa8b4e1a988ca3E: undefined version: 
          /usr/bin/ld: _ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$11iter_fields17h5d155b73bac07c84E: undefined version: 
          /usr/bin/ld: _ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$9type_path17ha6c027d31136760dE: undefined version: 
          /usr/bin/ld: _ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$15short_type_path17h99e7f557201f0541E: undefined version: 
          /usr/bin/ld: _ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$11module_path17h74a868c2c928912bE: undefined version: 
          /usr/bin/ld: _ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$10type_ident17h681b77858c05418fE: undefined version: 
          /usr/bin/ld: _ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$10crate_name17h914d05472eecaf4bE: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_info..Typed$GT$9type_info17hc6e3ec37dd387509E: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$5debug17hfccbecc2dea8b56fE: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$18reflect_partial_eq17hca55d9a8ff7e3eb1E: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$13reflect_owned17hdc387ffd9b9a024eE: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$12reflect_hash17h2642bfc3a1300eecE: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$11reflect_ref17h0e806fae69afe03eE: undefined version: 
          /usr/bin/ld: _ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$11reflect_mut17h9131bce9653d807aE: undefined version: 
          /usr/bin/ld: failed to set dynamic section sizes: bad value
          collect2: error: ld returned 1 exit status
          

error: could not compile `bevy_dylib` (lib) due to previous error
@mdickopp mdickopp added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 10, 2023
@alice-i-cecile alice-i-cecile added P-High This is particularly urgent, and deserves immediate attention and removed S-Needs-Triage This issue needs to be labelled labels Sep 10, 2023
@alice-i-cecile alice-i-cecile added this to the 0.12 milestone Sep 10, 2023
@alice-i-cecile alice-i-cecile added the A-Assets Load files from disk to use for things like images, models, and sounds label Sep 10, 2023
@mdickopp
Copy link
Contributor Author

The issue occurs with nightly rust (1.74.0-nightly (d14c85f4e 2023-09-05)) as well.

@VitalyAnkh
Copy link
Contributor

I could reproduce this problem with GNU ld, but the examples all compile smoothly with the mold linker https://github.com/rui314/mold.

@mdickopp
Copy link
Contributor Author

Build fails with lld (LLD 14.0.6) as well.

Command: RUSTFLAGS="-Clink-arg=-fuse-ld=lld" cargo run --example hello_world --features dynamic_linking

Error message:

error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/lib/ccache:/home/martin/.local/bin:/home/martin/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/martin/.cargo/bin:/home/martin/.npm/bin" VSLANG="1033" "cc" "-Wl,--version-script=/tmp/rustcOaOCLt/list" "-Wl,--no-undefined-version" "-m64" "/tmp/rustcOaOCLt/symbols.o" "/home/martin/tmp/bevy/target/debug/deps/bevy_dylib.1sebsf4e8g3dhjez.rcgu.o" "/home/martin/tmp/bevy/target/debug/deps/bevy_dylib.3lnuvt72hjeve51d.rcgu.rmeta" "-Wl,--as-needed" "-L" "/home/martin/tmp/bevy/target/debug/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/martin/tmp/bevy/target/debug/deps/libbevy_internal-58607d37a3fec7e7.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_gizmos-7131d18ac945580b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_winit-94b704e2e2c57992.rlib" "/home/martin/tmp/bevy/target/debug/deps/libaccesskit_winit-ee6ed0198285b5aa.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwinit-5e391fb0c937f104.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmio-6ed2cdf89e5a80c3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libx11_dl-a918141c3ad9e960.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_ui-75ec27c9bf3265bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtaffy-66b0c457f3369229.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgrid-9933c5d26f40aacc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libslotmap-970d0567a0035413.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_text-4f0ca34e806eeaaf.rlib" "/home/martin/tmp/bevy/target/debug/deps/libglyph_brush_layout-2481dfe32241ae49.rlib" "/home/martin/tmp/bevy/target/debug/deps/libxi_unicode-3cd3dfb4b40e1f8a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libapprox-79bb156fb47e2b71.rlib" "/home/martin/tmp/bevy/target/debug/deps/libab_glyph-92ad514d2cc3965e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libowned_ttf_parser-df67295f95aa2b5b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libttf_parser-e633e9ece00524bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libab_glyph_rasterizer-64591ad0758f1363.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_sprite-6ddae01a02847b50.rlib" "/home/martin/tmp/bevy/target/debug/deps/librectangle_pack-3aaf09ce7172a8f9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libguillotiere-00346a2cee4de321.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsvg_fmt-1499d0d0dda6f1d1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libeuclid-c1c1cdf295ee987f.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_gltf-941215de071c2816.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpercent_encoding-1c838f66e10d971e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbase64-303b1f5dc1de2774.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgltf-31ae1d1291c7d4f1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgltf_json-176cc03da6fdd791.rlib" "/home/martin/tmp/bevy/target/debug/deps/libserde_json-071af4409f0aa21c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libryu-07bba3d256252af8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libitoa-5351249f7154fdc4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_pbr-f840768090768ced.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_gilrs-3c708799a21ee849.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgilrs-91837ab03e0056c3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfnv-4d87e4d2bb291f2a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgilrs_core-f6a69130066bb2b3.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibudev_sys-79fbc4951aec24ea.rlib" "/home/martin/tmp/bevy/target/debug/deps/libvec_map-e18a692d8f777d4c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnix-238f0d5c39db7e48.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_core_pipeline-c2704198fc44f332.rlib" "/home/martin/tmp/bevy/target/debug/deps/libradsort-38b0d83fa20e392d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_audio-8c27ba0a5f12c22c.rlib" "/home/martin/tmp/bevy/target/debug/deps/librodio-6dade85c3fd192cc.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblewton-81bd4c192cd88a56.rlib" "/home/martin/tmp/bevy/target/debug/deps/libogg-11d75c485dfed590.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtinyvec-3fd4ab6967b9f11c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtinyvec_macros-267d34b29e8276e3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcpal-56e60edb8d646604.rlib" "/home/martin/tmp/bevy/target/debug/deps/libdasp_sample-e4dfb0e3fa59bd4c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libalsa-c8cdcc1d5d5e3cd0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnix-fe1478fccb045ea9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libalsa_sys-bea4b4af767edff7.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_animation-f4529e05f973d1ea.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_scene-32db5eefc2195856.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_render-dc3a0642b5611be1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libruzstd-cc693d48b67c59dd.rlib" "/home/martin/tmp/bevy/target/debug/deps/libthiserror_core-c1c18f5f748da946.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtwox_hash-b03cc3fd774eb08a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnaga_oil-2ccb57b5fd582807.rlib" "/home/martin/tmp/bevy/target/debug/deps/libunicode_ident-1cb5c4154aef338b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libdata_encoding-9cd3bf6e32e09e8c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_mikktspace-b1233ff37bd389b5.rlib" "/home/martin/tmp/bevy/target/debug/deps/libimage-2b8f3bd8732b3205.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcolor_quant-b7cf6246af0c842e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpng-e849aba0acc4a048.rlib" "/home/martin/tmp/bevy/target/debug/deps/libflate2-4eb333e7454d62a1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libminiz_oxide-4b77c2e8fe933f4d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfdeflate-44a0a80fd44916d2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsimd_adler32-7f9432a8f56af434.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcrc32fast-faf80f280cc1bb4a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnum_rational-57147f58affb9ab3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnum_integer-ba8aa51d5e2d6a20.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbyteorder-649c0b498eb5f4d1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libktx2-06041e2634e67992.rlib" "/home/martin/tmp/bevy/target/debug/deps/libencase-ff3146afa7a873b2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconst_panic-0de456f3a1591a1d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhexasphere-bd55f76d4ddb2a25.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconstgebra-1e9690f157344d4d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconst_soft_float-11cfd4e58246b426.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu-e21f76bf1d950da8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libstatic_assertions-31ba3f8d1564dfe4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu_core-59a494543c65a54b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu_hal-c1cc5186666c660a.rlib" "/home/martin/tmp/bevy/target/debug/deps/librenderdoc_sys-3e956478e7a6d03c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_descriptor-8d5deab566b8e61d.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_descriptor_types-c6a6d6fe62c476a9.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibloading-69609ae89ce75177.rlib" "/home/martin/tmp/bevy/target/debug/deps/libkhronos_egl-c04cfffc04a80170.rlib" "/home/martin/tmp/bevy/target/debug/deps/libprofiling-c294894da49345fb.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_alloc-de651481b355c0f3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgpu_alloc_types-2fa56c39eed8895c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libash-778e9b28ad4d0a5f.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibloading-83db7c797ca32a3b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnaga-5c503a7640f0636b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhexf_parse-19769a31418764f4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbit_set-f1eb00a5c4938eea.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbit_vec-708b08d83d105d3b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcodespan_reporting-bbd20dad31af1d84.rlib" "/home/martin/tmp/bevy/target/debug/deps/libunicode_width-3f45be079f27c499.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtermcolor-930992c1f8f11477.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpp_rs-753d71ee06e60619.rlib" "/home/martin/tmp/bevy/target/debug/deps/libunicode_xid-45345417c79fff97.rlib" "/home/martin/tmp/bevy/target/debug/deps/libspirv-6deb846d88ea68c8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnum_traits-0356f7aaf509f13b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbitflags-1926cec1a16924e0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libindexmap-dd896f99c2b62b80.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhashbrown-1639d654e124c1f7.rlib" "/home/martin/tmp/bevy/target/debug/deps/libahash-6f40bc731d0e3b92.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwgpu_types-7156c79f40247a51.rlib" "/home/martin/tmp/bevy/target/debug/deps/libglow-82c645a85137a227.rlib" "/home/martin/tmp/bevy/target/debug/deps/libarrayvec-6916d94f783ab2b2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_window-0a60320368289e93.rlib" "/home/martin/tmp/bevy/target/debug/deps/libraw_window_handle-93c10ba3b4fc818a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_transform-6e55c973a592e7cd.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_hierarchy-d2d6aa3c72be4df2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_input-5eb7dc06896ac4c4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_diagnostic-526402f778696ceb.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_time-a8a956661102363b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_core-571385aa771c2d25.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_asset-417fe41e74a9a830.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_broadcast-c58019b99e1c6b11.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmd5-97078de9911b613c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libron-5c8b3af43613e638.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbitflags-bf7adebfb11df1ab.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbase64-b690142577ee2af1.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_log-c99f64154dc4c968.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing_subscriber-7f6ab9cf0c3b0580.rlib" "/home/martin/tmp/bevy/target/debug/deps/libnu_ansi_term-52ff66b094c58e22.rlib" "/home/martin/tmp/bevy/target/debug/deps/liboverload-2b65450f9f69567a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsharded_slab-ecb230e4b55b672a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmatchers-cdbfacad5a78312b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_automata-cc31c3c847567d44.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_syntax-4fb8567a4973916b.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex-83aa7728f1ed84b5.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_automata-eb447f951ca62371.rlib" "/home/martin/tmp/bevy/target/debug/deps/libaho_corasick-5758ce179aee613c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libregex_syntax-acc9cef604855d12.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing_log-b4b6272a94dac1a1.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblazy_static-643a017f62beb017.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcrossbeam_channel-72bac9fef8b57325.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_fs-68f9750ecec14308.rlib" "/home/martin/tmp/bevy/target/debug/deps/libblocking-82d45aa00edcc7cd.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblog-895a7d6396d4d394.rlib" "/home/martin/tmp/bevy/target/debug/deps/libatomic_waker-d68edf10272b3f49.rlib" "/home/martin/tmp/bevy/target/debug/deps/libanyhow-e7aa7e65ac173784.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_a11y-222610da9518bb86.rlib" "/home/martin/tmp/bevy/target/debug/deps/libaccesskit-9cf58743f956eed8.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_app-c7f09e75d164e421.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_ecs-9745b55553a6b813.rlib" "/home/martin/tmp/bevy/target/debug/deps/librustc_hash-3af456ac9bcd35b4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libthread_local-f9b07bda76550363.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_tasks-e18210d6f2b8c367.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_channel-0190818e5ec297a4.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_executor-604e82cd94271b4e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libslab-196fddbee6a75cdd.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_lock-af1b1ebffae8a3c0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libevent_listener-346605a9db2c0e34.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfutures_lite-0d37c6c02357680a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libmemchr-333149cdd616a6c6.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfastrand-e6406709308aa321.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfutures_io-1455dcdc174b781f.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfutures_core-25b757fb82367445.rlib" "/home/martin/tmp/bevy/target/debug/deps/libwaker_fn-3bf990f227163674.rlib" "/home/martin/tmp/bevy/target/debug/deps/libparking-57f2096a7a27190c.rlib" "/home/martin/tmp/bevy/target/debug/deps/libconcurrent_queue-15e5f7712393f2d6.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcrossbeam_utils-b7bedb7b710f431f.rlib" "/home/martin/tmp/bevy/target/debug/deps/libasync_task-f0b52c7611d93ec0.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_reflect-03e540717bbf74c9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsmol_str-e6d74db7d1cc33dd.rlib" "/home/martin/tmp/bevy/target/debug/deps/liberased_serde-dac9cf9eb5200514.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_math-b178f72b2d085c86.rlib" "/home/martin/tmp/bevy/target/debug/deps/libglam-defd7ab7d8cd69fa.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbytemuck-88f70619a3e45b87.rlib" "/home/martin/tmp/bevy/target/debug/deps/libparking_lot-c4ce06ca471f7b38.rlib" "/home/martin/tmp/bevy/target/debug/deps/libparking_lot_core-85a9e65cf9b0a06a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libsmallvec-4e5e9afe78a52962.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblock_api-5b573ab2fe3fad0a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libscopeguard-2448006f136b7268.rlib" "/home/martin/tmp/bevy/target/debug/deps/libdowncast_rs-cbc0b23857f6c1f9.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_ptr-288042f6a060b0f2.rlib" "/home/martin/tmp/bevy/target/debug/deps/libbevy_utils-1ec1e55fe1d0fd77.rlib" "/home/martin/tmp/bevy/target/debug/deps/libuuid-ec8f95c7144f63bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing-494df13252aa3823.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpin_project_lite-a76229303093e015.rlib" "/home/martin/tmp/bevy/target/debug/deps/libtracing_core-1d5c8a1907215259.rlib" "/home/martin/tmp/bevy/target/debug/deps/libthiserror-b75ccf0709e3a762.rlib" "/home/martin/tmp/bevy/target/debug/deps/libpetgraph-8f78af984f7f3556.rlib" "/home/martin/tmp/bevy/target/debug/deps/libindexmap-b309f99fc43f8679.rlib" "/home/martin/tmp/bevy/target/debug/deps/libequivalent-7257265f83ae57da.rlib" "/home/martin/tmp/bevy/target/debug/deps/libfixedbitset-14fc5db9e5d0b704.rlib" "/home/martin/tmp/bevy/target/debug/deps/libinstant-f5b0c5ca8ce358bc.rlib" "/home/martin/tmp/bevy/target/debug/deps/libhashbrown-9a8fc373705e70d3.rlib" "/home/martin/tmp/bevy/target/debug/deps/libserde-0b9a39148650e28f.rlib" "/home/martin/tmp/bevy/target/debug/deps/liballocator_api2-76a1655c0106d913.rlib" "/home/martin/tmp/bevy/target/debug/deps/libahash-ef9e458e64c8032a.rlib" "/home/martin/tmp/bevy/target/debug/deps/libgetrandom-8a576451914e76b3.rlib" "/home/martin/tmp/bevy/target/debug/deps/liblibc-7210a355a56b809e.rlib" "/home/martin/tmp/bevy/target/debug/deps/libonce_cell-55f61dcd952bd954.rlib" "/home/martin/tmp/bevy/target/debug/deps/libcfg_if-a4949322dd83a0a2.rlib" "-L" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-lstd-8f88c761e33f2651" "-Wl,-Bstatic" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b114db70ea0690b1.rlib" "-Wl,-Bdynamic" "-ldl" "-ludev" "-lasound" "-ldl" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/martin/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/martin/tmp/bevy/target/debug/deps/libbevy_dylib.so" "-shared" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-fuse-ld=lld"
  = note: ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$11reflect_mut17h9131bce9653d807aE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$11reflect_ref17h0e806fae69afe03eE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$12reflect_hash17h2642bfc3a1300eecE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$13reflect_owned17hdc387ffd9b9a024eE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$18reflect_partial_eq17hca55d9a8ff7e3eb1E' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..reflect..Reflect$GT$5debug17hfccbecc2dea8b56fE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN78_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_info..Typed$GT$9type_info17hc6e3ec37dd387509E' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$10crate_name17h914d05472eecaf4bE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$10type_ident17h681b77858c05418fE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$11module_path17h74a868c2c928912bE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$15short_type_path17h99e7f557201f0541E' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN81_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..type_path..TypePath$GT$9type_path17ha6c027d31136760dE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$11iter_fields17h5d155b73bac07c84E' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$12field_at_mut17h12fa8b4e1a988ca3E' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$13clone_dynamic17h79ddba5a9a7eb4ddE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$5field17h61b51fb5ae71f5eeE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$7name_at17hc1fc1efcc7736fceE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$8field_at17h41103bfcc57e199dE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$9field_len17h53361f8577385f4bE' failed: symbol not defined
          ld.lld: error: version script assignment of 'global' to symbol '_ZN82_$LT$bevy_asset..path..AssetPath$u20$as$u20$bevy_reflect..struct_trait..Struct$GT$9field_mut17h0a89c6e84327d3f6E' failed: symbol not defined
          ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
          collect2: error: ld returned 1 exit status
          

error: could not compile `bevy_dylib` (lib) due to previous error

@mdickopp
Copy link
Contributor Author

I could reproduce this problem with GNU ld, but the examples all compile smoothly with the mold linker

Works as expected with mold for me as well.

@mdickopp
Copy link
Contributor Author

One more observation: If I remove #[derive(Reflect)] from AssetPath, it builds and runs as expected. Could the issue be related to AssetPath now containing the new CowArc, which is not reflectable?

@cart
Copy link
Member

cart commented Sep 10, 2023

Reproed on debian sid linux with lld 14.0.6. I think I take dynamic linking over CowArc, but the fact that something like that can break us makes me extremely uncomfortable.

github-merge-queue bot pushed a commit that referenced this issue Sep 13, 2023
# Objective

Fix #9747

## Solution

Linkers don't like what we're doing with CowArc (I'm guessing it has
something to do with `?Sized`). Weirdly the `Reflect` derive on
`AssetPath` doesn't fail, despite `CowArc` not implementing `Reflect`.

To resolve this, we manually implement "reflect value" for
`AssetPath<'static>`. It sadly cannot use `impl_reflect_value` because
that macro doesn't support static lifetimes.

---------

Co-authored-by: Martin Dickopp <[email protected]>
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
…ine#9752)

# Objective

Fix bevyengine#9747

## Solution

Linkers don't like what we're doing with CowArc (I'm guessing it has
something to do with `?Sized`). Weirdly the `Reflect` derive on
`AssetPath` doesn't fail, despite `CowArc` not implementing `Reflect`.

To resolve this, we manually implement "reflect value" for
`AssetPath<'static>`. It sadly cannot use `impl_reflect_value` because
that macro doesn't support static lifetimes.

---------

Co-authored-by: Martin Dickopp <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Mar 23, 2024
…#12596)

# Objective

* Adopted #12025 to fix merge conflicts
* In some cases we used manual impls for certain types, though they are
(at least, now) unnecessary.

## Solution

* Use macros and reflecting-by-value to avoid this clutter.
* Though there were linker issues with Reflect and the CowArc in
AssetPath (see #9747), I
checked these are resolved by using #[reflect_value].

---------

Co-authored-by: soqb <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: James Liu <[email protected]>
@pcgeek86
Copy link

Reproduced this (roughly similar error) on Ubuntu Server 24.04 LTS. Rust toolchain version 1.81.0.

  = note: /usr/bin/ld: __rust_realloc: undefined version:
          /usr/bin/ld: __rust_no_alloc_shim_is_unstable: undefined version:
          /usr/bin/ld: __rust_dealloc: undefined version:
          /usr/bin/ld: __rust_alloc_zeroed: undefined version:
          /usr/bin/ld: __rust_alloc_error_handler_should_panic: undefined version:
          /usr/bin/ld: __rust_alloc_error_handler: undefined version:
          /usr/bin/ld: __rust_alloc: undefined version:
          /usr/bin/ld: failed to set dynamic section sizes: bad value
          collect2: error: ld returned 1 exit status


error: could not compile `bevy_dylib` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Cargo.toml

[dependencies]
bevy = { version = "0.14.2", features = ["exr", "jpeg", "flac", "file_watcher", "dynamic_linking", "detailed_trace", "bmp", "dds", "bevy_dev_tools", "meshlet", "mp3", "pnm", "serialize", "shader_format_glsl", "asset_processor", "async-io"] }
diesel = { version = "2.2.4", features = ["mysql", "chrono", "postgres", "serde_json", "time", "uuid", "numeric", "network-address", "large-tables", "huge-tables", "extras"] }
tokio = { version = "1.40.0", features = ["full"] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior P-High This is particularly urgent, and deserves immediate attention
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants