mirror of
https://github.com/openharmony/third_party_rust_libc.git
synced 2026-07-13 21:31:52 -04:00
0e57942c36
Signed-off-by: ljy9810 <longjianyin@h-partners.com>
23 lines
579 B
Bash
23 lines
579 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -eux
|
|
|
|
# Note: keep in sync with:
|
|
# https://github.com/rust-lang/rust/blob/master/src/doc/rustc/src/platform-support/wasm32-unknown-emscripten.md#requirements
|
|
emsdk_version=3.1.68
|
|
|
|
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
|
|
cd /emsdk-portable
|
|
./emsdk install "$emsdk_version"
|
|
./emsdk activate "$emsdk_version"
|
|
|
|
# Compile and cache libc
|
|
# shellcheck disable=SC1091
|
|
source ./emsdk_env.sh
|
|
echo "int main() {return 0;}" > a.c
|
|
HOME=/emsdk-portable/ emcc a.c
|
|
rm -f a.*
|
|
|
|
# Make emsdk usable by any user
|
|
chmod a+rxw -R /emsdk-portable
|