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

Filter out -lmsvcrt for Windows gnu targets #274

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ jobs:
cargo run zigbuild --target aarch64-unknown-linux-musl
cargo run zigbuild --target aarch64-unknown-linux-musl --manifest-path tests/hello-rustls/Cargo.toml
- name: Windows - Test gnu build
# We are having trouble building with zig 0.13
if: ${{ matrix.zig == '0.10.1' }}
run: |
cargo run zigbuild --target x86_64-pc-windows-gnu
cargo run zigbuild --target x86_64-pc-windows-gnu --manifest-path tests/hello-windows/Cargo.toml
Expand All @@ -202,7 +204,7 @@ jobs:
run: |
cargo run zigbuild --target aarch64-unknown-linux-gnu --manifest-path tests/hello-rustls/Cargo.toml --features curl
- name: Windows - Test run
if: ${{ matrix.os == 'windows-latest' }}
if: ${{ matrix.os == 'windows-latest' && matrix.zig == '0.10.1' }}
run: |
./target/x86_64-pc-windows-gnu/debug/cargo-zigbuild.exe zigbuild --help
./tests/hello-windows/target/x86_64-pc-windows-gnu/debug/hello-windows.exe
Expand Down
2 changes: 2 additions & 0 deletions src/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ impl Zig {
// https://github.com/rust-lang/rust/blob/f0bc76ac41a0a832c9ee621e31aaf1f515d3d6a5/compiler/rustc_target/src/spec/i686_pc_windows_gnu.rs#L16
// zig doesn't support --disable-auto-image-base, --dynamicbase and --large-address-aware
return None;
} else if arg == "-lmsvcrt" {
return None;
}
} else if arg == "-Wl,--no-undefined-version" {
// https://github.com/rust-lang/rust/blob/542ed2bf72b232b245ece058fc11aebb1ca507d7/compiler/rustc_codegen_ssa/src/back/linker.rs#L723
Expand Down
Loading