Skip to content

Commit 4025feb

Browse files
committed
3.1.61.12pre
1 parent ac0080b commit 4025feb

File tree

4 files changed

+36
-15
lines changed

4 files changed

+36
-15
lines changed

scripts/wasisdk-fetch.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ pushd ${SDKROOT}
4040
list(APPEND CMAKE_MODULE_PATH "${WASISDK}/share/cmake/Modules")
4141
4242
43-
# This is arbitrary, AFAIK, for now.
44-
cmake_minimum_required(VERSION 3.5.0)
43+
cmake_minimum_required(VERSION 3.10.0)
4544
set(CMAKE_SYSTEM_NAME WASI)
4645
set(CMAKE_SYSTEM_VERSION 1)
4746
set(CMAKE_SYSTEM_PROCESSOR wasm32)
48-
set(triple wasm32-wasi)
47+
set(triple wasm32-wasip1)
4948
5049
set(WASI True)
5150
option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)
@@ -56,8 +55,8 @@ set(COMPILER_SUPPORTS_FEXCEPTIONS FALSE)
5655
#add_compile_options(-fpic)
5756
#add_compile_options(-fno-exceptions)
5857
58+
set(WASI_SDK_PREFIX "${WASISDK}/upstream")
5959
set(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
60-
6160
set(CMAKE_CROSSCOMPILING 1)
6261
6362
@@ -95,9 +94,9 @@ set(CMAKE_CXX_PLATFORM_ID "wasi")
9594
set(CMAKE_ASM_COMPILER "${WASI_SDK_PREFIX}/bin/clang${WASI_HOST_EXE_SUFFIX}")
9695
set(CMAKE_AR "${WASI_SDK_PREFIX}/bin/llvm-ar${WASI_HOST_EXE_SUFFIX}")
9796
set(CMAKE_RANLIB "${WASI_SDK_PREFIX}/bin/llvm-ranlib${WASI_HOST_EXE_SUFFIX}")
98-
set(CMAKE_C_COMPILER_TARGET ${triple})
99-
set(CMAKE_CXX_COMPILER_TARGET ${triple})
100-
set(CMAKE_ASM_COMPILER_TARGET ${triple})
97+
set(CMAKE_C_COMPILER_TARGET \${triple})
98+
set(CMAKE_CXX_COMPILER_TARGET \${triple})
99+
set(CMAKE_ASM_COMPILER_TARGET \${triple})
101100
102101
# Don't look in the sysroot for executables to run during the build
103102
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

wasisdk/bin/wasi-cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/bash
2-
SDKROOT=${SDKROOT:-/opt/python-wasm-sdk}
2+
SDKROOT=${SDKROOT:-/tmp/sdk}
33
if . $SDKROOT/wasisdk/wasisdk_env.sh
44
then
55
CMAKE=$1
66
shift
77
$CMAKE \
88
-DCMAKE_SYSTEM_NAME=WASI \
9-
-DCMAKE_INSTALL_PREFIX=$PREFIX \
9+
-DCMAKE_INSTALL_PREFIX=$WASI_SYSROOT \
1010
"$@"
1111
fi
12-

wasisdk/hotfix/patch.h

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
SCOPE FILE *
77
popen(const char *command, const char *type){
8+
(void)command;
9+
(void)type;
810
return NULL;
911
}
1012

@@ -27,6 +29,7 @@ geteuid(void) {
2729
#include <sys/types.h> // for mode_t
2830
SCOPE mode_t
2931
umask(mode_t mask) {
32+
(void)mask;
3033
return 18;
3134
}
3235

@@ -35,6 +38,8 @@ umask(mode_t mask) {
3538

3639
SCOPE int
3740
sdk_chmod(const char * path, int mode_t) {
41+
(void)path;
42+
(void)mode_t;
3843
return 0;
3944
}
4045
#define chmod(path, mode) sdk_chmod(path, mode)
@@ -109,7 +114,12 @@ mkstemp(char *tmpl) {
109114
SCOPE int
110115
// getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result) {
111116
sdk_getpwuid_r(uid_t uid, void *pwd, char *buf, size_t buflen, void **result) {
112-
return ENOENT;
117+
(void)uid;
118+
(void)pwd;
119+
(void)buf;
120+
(void)buflen;
121+
(void)result;
122+
return ENOENT;
113123
}
114124
#define getpwuid_r(uid, pwd, buf, buflen, result) sdk_getpwuid_r(uid, pwd, buf, buflen, result)
115125

@@ -209,6 +219,9 @@ sdk_tmpfile(void) {
209219

210220
SCOPE int
211221
lockf(int fd, int cmd, off_t len) {
222+
(void)fd;
223+
(void)cmd;
224+
(void)len;
212225
return 0;
213226
}
214227

@@ -228,6 +241,8 @@ sdk_tmpfile(void) {
228241

229242
SCOPE int
230243
sdk_getrusage(int who, void *usage) {
244+
(void)who;
245+
(void)usage;
231246
return -1;
232247
}
233248
# define getrusage(who, usage) sdk_getrusage(who, usage)
@@ -274,10 +289,14 @@ sdk_tmpfile(void) {
274289
# define __wasm_exception_handling__
275290
# include <setjmp.h>
276291
SCOPE int sdk_sigsetjmp(sigjmp_buf env, int savesigs) {
292+
(void)env;
293+
(void)savesigs;
277294
return 0;
278295
}
279296
# define sigsetjmp(env, savesigs) sdk_sigsetjmp(env, savesigs)
280297
SCOPE void sdk_siglongjmp(sigjmp_buf env, int val) {
298+
(void)env;
299+
(void)val;
281300
puts("# 217:" __FILE__ ": siglongjmp STUB");
282301
}
283302
# define siglongjmp(env, val) sdk_siglongjmp(env, val)
@@ -298,8 +317,8 @@ extern int __wasi_fd_seek(int fd,int offset,int whence, unsigned long long *re
298317

299318
# include <wasi/api.h>
300319
SCOPE void sdk_exit(int ec) {
320+
void * base = 0 ;
301321
printf("EXIT(%d)\r\n", ec);
302-
const char * base = 0 ;
303322
memset(base, ec, 1);
304323
abort();
305324

@@ -309,14 +328,19 @@ extern int __wasi_fd_seek(int fd,int offset,int whence, unsigned long long *re
309328
# define exit(ec) sdk_exit(ec)
310329

311330

331+
312332
SCOPE int sdk_pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) {
333+
(void)how;
334+
(void)set;
335+
(void)oldset;
313336
return 0;
314337
}
315338
# define pthread_sigmask(how, set, oldset) sdk_pthread_sigmask(how, set, oldset)
316339

317340

318341

319342
SCOPE int sdk_sigpending(sigset_t *set) {
343+
(void)set;
320344
return -1;
321345
}
322346
# define sigpending(set) sdk_sigpending(set)

wasisdk/wasisdk_env.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,12 @@ then
3636
export PATH="${WASISDK}/bin:${WASI_SDK_PREFIX}/bin:$PATH"
3737

3838
# instruct pkg-config to use wasi target root
39-
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${WASI_SYSROOT}/lib/wasm32-wasi/pkgconfig"
40-
41-
# for thirparty prebuilts .pc in sdk
4239
export PKG_CONFIG_LIBDIR="${WASI_SYSROOT}/lib/wasm32-wasi/pkgconfig"
4340
#:${WASI_SYSROOT}/share/pkgconfig"
4441
export PKG_CONFIG_SYSROOT_DIR="${WASI_SYSROOT}"
4542

43+
# for thirparty prebuilts .pc in sdk
44+
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig:${WASI_SYSROOT}/lib/pkgconfig"
4645

4746
export PS1="[PyDK:wasi] \w $ "
4847

0 commit comments

Comments
 (0)