Skip to content

Commit 819879d

Browse files
authored
Support cranelift backend on Windows (#1030)
1 parent 7a08a8c commit 819879d

File tree

5 files changed

+14306
-1
lines changed

5 files changed

+14306
-1
lines changed

.github/workflows/sys-bindings-generator.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ jobs:
283283
working-directory: aws-lc-sys/src
284284
run: |
285285
sed 's/#\[link_name = "\\u{1}aws_lc_/#[link_name = "aws_lc_/g' universal_crypto.rs > universal_no_u1_crypto.rs
286+
- name: Create prefixed bindings with the \u{1} stripped
287+
if: matrix.os == 'ubuntu-latest'
288+
working-directory: aws-lc-sys/src
289+
run: |
290+
sed 's/#\[link_name = "\\u{1}_aws_lc_/#[link_name = "aws_lc_/g' universal_prefixed_crypto.rs > universal_no_u1_prefixed_crypto.rs
286291
- name: Commit & Push changes
287292
run: ./scripts/ci/ci_add_commit_rebase_push.sh "Generated bindings from ${{ matrix.os }}"
288293
collect-src-and-commit:

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ jobs:
741741
target: x86_64-unknown-linux-gnu
742742
- os: macos-latest
743743
target: aarch64-apple-darwin
744+
- os: windows-latest
745+
target: x86_64-pc-windows-msvc
744746
steps:
745747
- uses: actions/checkout@v4
746748
with:

aws-lc-sys/builder/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,11 @@ fn initialize() {
574574
"Cranelift codegen backend detected. Using universal_no_u1 bindings.",
575575
);
576576
}
577-
emit_rustc_cfg("universal-no-u1");
577+
if target_has_prefixed_symbols() {
578+
emit_rustc_cfg("universal-no-u1-prefixed");
579+
} else {
580+
emit_rustc_cfg("universal-no-u1");
581+
}
578582
} else if target_has_prefixed_symbols() {
579583
emit_rustc_cfg("universal-prefixed");
580584
} else {
@@ -708,6 +712,7 @@ fn prepare_cargo_cfg() {
708712
println!("cargo:rustc-check-cfg=cfg(x86_64_unknown_linux_musl)");
709713
println!("cargo:rustc-check-cfg=cfg(universal)");
710714
println!("cargo:rustc-check-cfg=cfg(universal_no_u1)");
715+
println!("cargo:rustc-check-cfg=cfg(universal_no_u1_prefixed)");
711716
println!("cargo:rustc-check-cfg=cfg(universal_prefixed)");
712717
}
713718
}

aws-lc-sys/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ macro_rules! platform_binding {
2020
}
2121

2222
platform_binding!(universal_prefixed, universal_prefixed_crypto);
23+
platform_binding!(universal_no_u1_prefixed, universal_no_u1_prefixed_crypto);
2324
platform_binding!(universal_no_u1, universal_no_u1_crypto);
2425
platform_binding!(universal, universal_crypto);
2526

0 commit comments

Comments
 (0)