Files
third_party_rust_libc/ci/emscripten.sh
archane 4463c194de 升级libc版本至0.2.153
Signed-off-by: archane <zhaipeizhe@huawei.com>
Change-Id: I8f3f1652df13d929cf99ff89e38c112ff0c8b419
2025-02-26 10:34:42 +08:00

23 lines
634 B
Bash

#!/usr/bin/env bash
set -ex
# FIXME: 3.1.21 removed a lot of header files (https://github.com/emscripten-core/emscripten/pull/17704).
# We have to tweak libc-test (and deprecate unsupported items, maybe) when updating emsdk.
EMSDK_VERSION=3.1.20
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