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

[Possible Regression] Link failure on 1.67-x86_64-pc-windows-msvc #133

Closed
kanerogers opened this issue Jan 27, 2023 · 1 comment
Closed

Comments

@kanerogers
Copy link

Background

Hi, there!

Since updating my toolchain to 1.67-x86_64-pc-windows-msvc I am now unable to build a crate that depends on shaderc. If I create a simple project with:

cargo new shaderc_test
cd shaderc_test
cargo add shaderc

And modify src/main.rs to:

use shaderc::Compiler;

fn main() {
    let compiler = Compiler::new().unwrap();
    println!("Hello, world!");
}

cargo build will give the following error:

error: linking with `link.exe` failed: exit code: 1377
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\enaku\\AppData\\Local\\Temp\\rustcS8yjpU\\symbols.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.1da0qcrv6jcb53ue.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.1wke1ryfpb9g28wy.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.2o68n2l8aqsfxyeo.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.397bbwv6md8qefv4.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.44uaa13kd8y7oxw7.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.47hytwwgw7qau3s4.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.ifxhz3lrx3e199n.rcgu.o" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.1v2gxaxgar1yn8k7.rcgu.o" "/LIBPATH:C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps" "/LIBPATH:C:\\VulkanSDK\\1.3.211.0\\Lib" "/LIBPATH:C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\libshaderc-abccb43ce05b4ccd.rlib" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\libshaderc_sys-5ba1156ecedc7241.rlib" "C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\liblibc-3a1484c748211e20.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-d948d7ba3a1428f8.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-160203b957826e76.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-b24bd95fe5d36805.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_detect-0e9d70f22be1c0d7.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-b095d6ec0de2c748.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libminiz_oxide-fb910d16a05b94c5.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libadler-3a4bfb6892558bf2.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-a9e6a5964ad33a4c.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-213bb51833c43573.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-4140ea5b1ce3650e.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-9a1df03c8e50ccf9.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-860856f6a77183a1.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-d38e1b9df5cea3b4.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-b993f6ac479af571.rlib" "C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-3f0eed38bcc54ffc.rlib" "legacy_stdio_definitions.lib" "kernel32.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "msvcrt.lib" "legacy_stdio_definitions.lib" "/NXCOMPAT" "/LIBPATH:C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\enaku\\Documents\\Development\\shaderc_test\\target\\debug\\deps\\shaderc_test.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\enaku\\.rustup\\toolchains\\1.67-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: libshaderc_sys-5ba1156ecedc7241.rlib(ShaderLang.obj) : fatal error LNK1377: '??_EIncluder@TShader@glslang@@UEAAPEAXI@Z' symbol not found in object. The containing library is corrupt.


warning: `shaderc_test` (bin "shaderc_test") generated 1 warning
error: could not compile `shaderc_test` due to previous error; 1 warning emitted

If I switch my toolchain back to 1.66 with rustup default 1.66, then everything builds fine.

Some further notes:

  • Building this repository works fine, but I'm assuming that's because the linker does not get invoked
  • Adding/removing the build-from-source flag doesn't appear to make a difference
  • I get the following warning when building shaderc:
warning: shaderc: searching native shaderc libraries in Vulkan SDK 'C:\VulkanSDK\1.3.211.0/lib'
warning: shaderc: Windows MSVC static build is experimental
  • I am not very familiar with shaderc or C/C++ development so I've not really done much digging, but I'm more than happy to investigate if need be
@kanerogers
Copy link
Author

This appears to be fixed by rust-lang/rust#107360

bors added a commit to rust-lang-ci/rust that referenced this issue Jan 28, 2023
…esleywiser

Fix thin archive reading

This includes a revert of rust-lang#105221 to restore fat archive reading with LlvmArchiveBuilder.

Should fix rust-lang#107162, rust-lang#107334 and google/shaderc-rs#133
bors added a commit to rust-lang/miri that referenced this issue Jan 31, 2023
Fix thin archive reading

This includes a revert of rust-lang/rust#105221 to restore fat archive reading with LlvmArchiveBuilder.

Should fix #107162, #107334 and google/shaderc-rs#133
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 8, 2023
…n-archive-reading-for-1-68-beta, r=cuviper

Backport reverts to fix thin archive reading for 1 68 beta

This is a backport of PR rust-lang#107360 aimed at beta.

cc rust-lang#107162, rust-lang#107334 and google/shaderc-rs#133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant