Skip to content

Commit fd352f3

Browse files
committed
Do not use prefixed clang for wasi
Rust 1.68 (rust-lang/rust#106489) broke this: ``` = note: clang-15: error: unsupported option '--export' clang-15: error: unsupported option '--stack-first' clang-15: error: unsupported option '--allow-undefined' clang-15: error: unsupported option '--fatal-warnings' clang-15: error: unsupported option '--no-demangle' clang-15: error: unsupported option '--gc-sections' clang-15: error: unknown argument: '-flavor' clang-15: error: no such file or directory: 'wasm' clang-15: error: no such file or directory: '__main_void' ```
1 parent 52ee7e1 commit fd352f3

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.github/workflows/ci.yml

+1-11
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,7 @@ jobs:
9696
# WASI
9797
# rustup target list | grep -e '-wasi'
9898
# rustc --print target-list | grep -e '-wasi'
99-
# TODO(wasi):
100-
# = note: clang-15: error: unsupported option '--export'
101-
# clang-15: error: unsupported option '--stack-first'
102-
# clang-15: error: unsupported option '--allow-undefined'
103-
# clang-15: error: unsupported option '--fatal-warnings'
104-
# clang-15: error: unsupported option '--no-demangle'
105-
# clang-15: error: unsupported option '--gc-sections'
106-
# clang-15: error: unknown argument: '-flavor'
107-
# clang-15: error: no such file or directory: 'wasm'
108-
# clang-15: error: no such file or directory: '__main_void'
109-
# - wasm32-wasi
99+
- wasm32-wasi
110100
os:
111101
- ubuntu-22.04
112102
- ubuntu-20.04

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
1010

1111
## [Unreleased]
1212

13+
- Fix linker error for wasm32-wasi on Rust 1.68+.
14+
1315
## [1.6.1] - 2022-12-13
1416

1517
- Improve robustness for temporary network failures.

main.sh

+15-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ install_rust_cross_toolchain() {
112112
*) qemu_ld_prefix="${toolchain_dir}/${target}" ;;
113113
esac
114114
case "${target}" in
115-
*-freebsd | *-wasi)
115+
*-freebsd)
116116
cat >>"${GITHUB_ENV}" <<EOF
117117
CARGO_TARGET_${target_upper}_LINKER=${target}-clang
118118
CC_${target_lower}=${target}-clang
@@ -124,6 +124,20 @@ STRIP=llvm-strip
124124
OBJCOPY=llvm-objcopy
125125
OBJDUMP=llvm-objdump
126126
READELF=llvm-readelf
127+
EOF
128+
;;
129+
*-wasi)
130+
cat >>"${GITHUB_ENV}" <<EOF
131+
CARGO_TARGET_${target_upper}_LINKER=clang
132+
CC_${target_lower}=clang
133+
CXX_${target_lower}=clang++
134+
AR_${target_lower}=llvm-ar
135+
AR=llvm-ar
136+
NM=llvm-nm
137+
STRIP=llvm-strip
138+
OBJCOPY=llvm-objcopy
139+
OBJDUMP=llvm-objdump
140+
READELF=llvm-readelf
127141
EOF
128142
;;
129143
*)

0 commit comments

Comments
 (0)