Skip to content

cpython compatibility fixes #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ LIBC_TOP_HALF_MUSL_SOURCES = \
%/tmpnam.c %/tmpfile.c %/tempnam.c \
%/popen.c %/pclose.c \
%/remove.c \
%/memfd_create.c \
%/gets.c, \
$(wildcard $(LIBC_TOP_HALF_MUSL_SRC_DIR)/stdio/*.c)) \
$(wildcard $(LIBC_TOP_HALF_MUSL_SRC_DIR)/string/*.c) \
Expand Down
4 changes: 2 additions & 2 deletions expected/wasm32-wasi/predefined-macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6372,7 +6372,7 @@
#define __wasi_libc_find_relpath_h
#define __wasi_libc_h
#define __wasi_libc_nocwd_h
#define __wasi_polyfill_h
#define __wasi_polyfill_h
#define __wasilibc___errno_h
#define __wasilibc___errno_values_h
#define __wasilibc___fd_set_h
Expand Down Expand Up @@ -6449,7 +6449,7 @@
#define __wasilibc___typedef_time_t_h
#define __wasilibc___typedef_uid_t_h
#define __wasix__ 1
#define __wasix_api_h
#define __wasix_api_h
#define __wasm 1
#define __wasm32 1
#define __wasm32__ 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

int getsockname(int socket, struct sockaddr *restrict addr, socklen_t *restrict addrlen) {
__wasi_addr_port_t local_addr;
__wasi_errno_t error = __wasi_sock_addr_peer(socket, &local_addr);
__wasi_errno_t error = __wasi_sock_addr_local(socket, &local_addr);
if (error != 0) {
errno = error;
return -1;
Expand Down
2 changes: 1 addition & 1 deletion libc-top-half/musl/include/sys/mman.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int munlock (const void *, size_t);
int mlockall (int);
int munlockall (void);

#ifdef _GNU_SOURCE
#if defined(_GNU_SOURCE) && defined(__wasi_unmodified_upstream)
void *mremap (void *, size_t, size_t, int, ...);
int remap_file_pages (void *, size_t, int, size_t, int);
int memfd_create (const char *, unsigned);
Expand Down