Skip to content
New issue

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

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

Already on GitHub? # to your account

Windows + MinGWの環境で、リンク時に_lock_fileと_unlock_fileのシンボルが解決できない #58

Closed
kazuki0824 opened this issue Jul 25, 2023 · 1 comment · Fixed by #80
Labels
wontfix This will not be worked on

Comments

@kazuki0824
Copy link
Owner

状況

GitHub ホステッドランナー(Windows)上でビルドを行うと、
リンク時に_lock_fileと_unlock_fileのシンボルが解決されず、異常終了する。

関連

rust-lang/rust#112368 と同根かも。

エラーメッセージ


error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcCiDpta\\symbols.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.16t4eyqcob8a9hat.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.1c5cky5cso7xvi0n.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.1gq58g936w3ui0cu.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.1gwhpx0homgh1i9s.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.1v2v4x6hiiknmc22.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.1zp3whreinu4qbd9.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.24ou48v2uu8t23kz.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.2a1a7h86hsqksmpz.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.2gkjqyu19p6f4sxw.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.2tr8lno714zzn1i9.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.2txxkx6iluvgve69.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.33g343egzzq52o7a.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.3galkroco80ms0x1.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.3sa69ixdcl71itha.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.46pgoa6wwjfyq0lg.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.4bpsq82jht8om6ki.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.56zn1eg8a7bif33r.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.g5aqhsiunsfdifg.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.y5rbh3o4kho3pwr.rcgu.o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.1kx5i3ecov0kwnar.rcgu.o" "-L" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps" "-L" "C:\\Windows\\System32" "-L" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\build\\b25-sys-ae2aa1ffc12fbda0\\out/lib" "-L" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bdynamic" "-lucrt" "-lwinscard" "-Wl,-Bstatic" "-Wl,--whole-archive" "-laribb25" "-Wl,--no-whole-archive" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libtest-eb65851c522d788e.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgetopts-61a280a25b41e3b2.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunicode_width-c85c92b896a9c2f9.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_std-1860a805430f2e31.rlib" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\libpin_project_lite-c6a4aabae59852a2.rlib" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\liblog-c801d0c7eeedae9f.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-5b7bb87ce5571884.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-833364761c2781ff.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libobject-31ed18134a3c5ef8.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libmemchr-e6b6e6948f8fd702.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-8f2f336806363ae9.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgimli-e293aed9ea892a13.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-2b64d871f12392af.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_detect-96a374841ff446f9.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-e044a2cf0118811c.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-30e5ce84f317655b.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libminiz_oxide-7b7803bde19e4862.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libadler-ad9ad6e6c123302e.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-d6d690b4e8bbc285.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-3efb1be5ec3dfbdc.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-49ecf7da6013ea00.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-111544d92a21aec0.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-fde3932818a6e910.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-5b50c1fb747ce736.rlib" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-3fc553da9dd474fb.rlib" "-Wl,-Bdynamic" "-lkernel32" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-o" "D:\\a\\recisdb-rs\\recisdb-rs\\target\\debug\\deps\\b25_sys-f7261e01c4b20652.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "C:\\Users\\runneradmin\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2528bindgen_test_layout___fsid_t28_$u7b$$u7b$closure$u7d$$u7d$17h17e99638fb25aa59E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2537bindgen_test_layout_B_CAS_INIT_STATUS28_$u7b$$u7b$closure$u7d$$u7d$17h558990ac61e5f19dE" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2528bindgen_test_layout_B_CAS_ID28_$u7b$$u7b$closure$u7d$$u7d$17h40b2c4a2addac600E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2537bindgen_test_layout_B_CAS_PWR_ON_CTRL28_$u7b$$u7b$closure$u7d$$u7d$17h11c91160d770dec9E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2542bindgen_test_layout_B_CAS_PWR_ON_CTRL_INFO28_$u7b$$u7b$closure$u7d$$u7d$17ha325fa6d2e598a37E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2536bindgen_test_layout_B_CAS_ECM_RESULT28_$u7b$$u7b$closure$u7d$$u7d$17ha984cecc23c0f94bE" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2530bindgen_test_layout_B_CAS_CARD28_$u7b$$u7b$closure$u7d$$u7d$17h92672ba7326a16d2E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2539bindgen_test_layout_ARIB_STD_B25_BUFFER28_$u7b$$u7b$closure$u7d$$u7d$17hcc75c9cee9cdf502E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2545bindgen_test_layout_ARIB_STD_B25_PROGRAM_INFO28_$u7b$$u7b$closure$u7d$$u7d$17hbd79388248c8cd71E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN7b25_sys8bindings12arib_std_b2532bindgen_test_layout_ARIB_STD_B2528_$u7b$$u7b$closure$u7d$$u7d$17h70576fd92fff2128E" ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:"_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17h34c14d0c669cd358E" ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:_ZN3std2rt10lang_start17h37550e29cd25abd6E ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2528bindgen_test_layout___fsid_t17h360da14c1822e7ebE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2537bindgen_test_layout_B_CAS_INIT_STATUS17h4aed1aac10dc504fE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2528bindgen_test_layout_B_CAS_ID17hc7fb6de0ab06bfb8E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2537bindgen_test_layout_B_CAS_PWR_ON_CTRL17hf56526344368a9bfE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2542bindgen_test_layout_B_CAS_PWR_ON_CTRL_INFO17hacd8d9ed5d6355efE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2536bindgen_test_layout_B_CAS_ECM_RESULT17ha846894ec1c6fc31E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2530bindgen_test_layout_B_CAS_CARD17h216720d10973fcc6E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2539bindgen_test_layout_ARIB_STD_B25_BUFFER17hae73fc57a51e1b24E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2545bindgen_test_layout_ARIB_STD_B25_PROGRAM_INFO17h463905bcf08dda03E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN7b25_sys8bindings12arib_std_b2532bindgen_test_layout_ARIB_STD_B2517hc81f156562c0c11eE ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h2654e4199e2d7756E" ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h3b3378a6066b4302E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h46b4a271df8ac4bcE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h4af0713da1e72487E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h51ea60dc1e0267f5E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h6a411a5ef7160e96E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h6ea265f7ae438d45E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h70066ef2a2a9236eE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h752e5015f1e5e62aE ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h7cafe00743a572b5E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h83c187478877c283E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17ha345efbd415485a7E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17hf9fbd77a47b32b64E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17hfb04338fd89c682bE ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr30drop_in_place$LT$$RF$usize$GT$17h46e5dc189c605950E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN4core3ptr78drop_in_place$LT$std..sync..mutex..Mutex$LT$alloc..vec..Vec$LT$u64$GT$$GT$$GT$17h98b2d6b4b3c49f13E" ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments6as_str17hf70e63e885aa6846E ' unrecognized

          Warning: .drectve `-exclude-symbols:_ZN4core3fmt9Arguments6new_v117h8762e03b53b0e425E ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hb641189b34e1e6d3E" ' unrecognized

          Warning: .drectve `-exclude-symbols:"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17he945f37e66c13995E" ' unrecognized

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          Warning: corrupt .drectve at end of def file

          c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingwex.a(lib64_libmingwex_a-mingw_vfprintf.o):mingw_vfprintf:(.text+0x1c): undefined reference to `_lock_file'

          c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingwex.a(lib64_libmingwex_a-mingw_vfprintf.o):mingw_vfprintf:(.text+0x4b): undefined reference to `_unlock_file'

          collect2.exe: 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#cargorustc-link-libkindname)

warning: `b25-sys` (lib test) generated 68 warnings (3 duplicates)
error: could not compile `b25-sys` (lib test) due to previous error; 68 warnings emitted
@kazuki0824 kazuki0824 added the wontfix This will not be worked on label Jul 25, 2023
@kazuki0824 kazuki0824 linked a pull request Jul 25, 2023 that will close this issue
@kazuki0824
Copy link
Owner Author

kazuki0824 commented Aug 19, 2023

https://gist.github.com/kazuki0824/18be5a49ac4a9b72a0632752e5ffe561
これで作ったDockerイメージの上では、また別の失敗メッセージが出現する。(シンボル周りの問題は克服されていると思われる)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant