Skip to content

Commit

Permalink
Do not use prefixed clang for wasi
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
taiki-e committed Mar 12, 2023
1 parent 52ee7e1 commit fd352f3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,7 @@ jobs:
# WASI
# rustup target list | grep -e '-wasi'
# rustc --print target-list | grep -e '-wasi'
# TODO(wasi):
# = 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'
# - wasm32-wasi
- wasm32-wasi
os:
- ubuntu-22.04
- ubuntu-20.04
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com

## [Unreleased]

- Fix linker error for wasm32-wasi on Rust 1.68+.

## [1.6.1] - 2022-12-13

- Improve robustness for temporary network failures.
Expand Down
16 changes: 15 additions & 1 deletion main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ install_rust_cross_toolchain() {
*) qemu_ld_prefix="${toolchain_dir}/${target}" ;;
esac
case "${target}" in
*-freebsd | *-wasi)
*-freebsd)
cat >>"${GITHUB_ENV}" <<EOF
CARGO_TARGET_${target_upper}_LINKER=${target}-clang
CC_${target_lower}=${target}-clang
Expand All @@ -124,6 +124,20 @@ STRIP=llvm-strip
OBJCOPY=llvm-objcopy
OBJDUMP=llvm-objdump
READELF=llvm-readelf
EOF
;;
*-wasi)
cat >>"${GITHUB_ENV}" <<EOF
CARGO_TARGET_${target_upper}_LINKER=clang
CC_${target_lower}=clang
CXX_${target_lower}=clang++
AR_${target_lower}=llvm-ar
AR=llvm-ar
NM=llvm-nm
STRIP=llvm-strip
OBJCOPY=llvm-objcopy
OBJDUMP=llvm-objdump
READELF=llvm-readelf
EOF
;;
*)
Expand Down

0 comments on commit fd352f3

Please sign in to comment.