Skip to content

Commit

Permalink
lang/wasi-libc: update to git HEAD to support llvm 16
Browse files Browse the repository at this point in the history
switch to build with ports-clang 16, cf for llvm support:
- WebAssembly/wasi-libc#379
- WebAssembly/wasi-libc#285
- WebAssembly/wasi-libc#344
adapt a regex to deal with our egrep syntax.
  • Loading branch information
landryb committed Dec 7, 2023
1 parent fa9aa74 commit 3997b1a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
8 changes: 3 additions & 5 deletions lang/wasi-libc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ COMMENT = C standard library for WebAssembly System Interface

GH_ACCOUNT = WebAssembly
GH_PROJECT = wasi-libc
GH_COMMIT = 05cd0af0af4b5a191117d47a182adff1d6546b87
DISTNAME = wasi-libc-0.20220413
REVISION = 0
GH_COMMIT = 9c17f5235c7977cb2a000990eb8c605a25a80adf
DISTNAME = wasi-libc-0.20231121

DISTFILES = ${GH_DISTFILE}
DISTFILES.h = wasi-libc-llvm13-std-headers.tar.gz
Expand All @@ -19,8 +18,7 @@ COMPILER = ports-clang
USE_GMAKE = yes
ALL_TARGET = finish

# The entire wasi stack needs some work to be able to build with llvm 16
MODCLANG_VERSION = 13
MODCLANG_VERSION = 16
MAKE_ENV += AR=${LOCALBASE}/bin/llvm-ar-${MODCLANG_VERSION} \
NM=${LOCALBASE}/bin/llvm-nm-${MODCLANG_VERSION} \
INSTALL_DIR=${WRKINST}${PREFIX}/share/wasi-sysroot
Expand Down
4 changes: 2 additions & 2 deletions lang/wasi-libc/distinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SHA256 (wasi-libc-0.20220413-05cd0af0.tar.gz) = vgKb3dSRO5d5BYZjhUKPJBx+yeCRlteONLe2s2xUOmc=
SHA256 (wasi-libc-0.20231121-9c17f523.tar.gz) = dRUaojjr1lnbuJytlZFIC+oM2mfWoEeo5Qd3SoJ4mOk=
SHA256 (wasi-libc-llvm13-std-headers.tar.gz) = YTble8uIDTmeki+GTWKcGnO5JHK6p/educ3h/T+tIE4=
SIZE (wasi-libc-0.20220413-05cd0af0.tar.gz) = 1251259
SIZE (wasi-libc-0.20231121-9c17f523.tar.gz) = 1313030
SIZE (wasi-libc-llvm13-std-headers.tar.gz) = 1795
18 changes: 15 additions & 3 deletions lang/wasi-libc/patches/patch-Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ avoid rebuilding everything in fake
wasi-libc requires some compiler headers that we remove from our
llvm ports so we include them here instead

chunk 2: adapt regex for our grep
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -224,7 +224,7 @@ endif
@@ -346,7 +346,7 @@ endif
# should come earlier in the search path, so they can "override"
# and/or `#include_next` the public headers. `-isystem` (like
# `-idirafter`) comes later in the search path than `-I`.
Expand All @@ -16,9 +17,20 @@ Index: Makefile

# These variables describe the locations of various files and directories in
# the build tree.
@@ -565,7 +565,7 @@ check-symbols: startup_files libc
@@ -789,8 +789,8 @@ check-symbols: startup_files libc
-U__FLT_EVAL_METHOD__ -Wno-builtin-macro-redefined \
| sed -e 's/__[[:upper:][:digit:]]*_ATOMIC_\([[:upper:][:digit:]_]*\)_LOCK_FREE/__compiler_ATOMIC_\1_LOCK_FREE/' \
| sed -e 's/__GNUC_VA_LIST $$/__GNUC_VA_LIST 1/' \
- | grep -v '^#define __\(BOOL\|INT_\(LEAST\|FAST\)\(8\|16\|32\|64\)\|INT\|LONG\|LLONG\|SHRT\)_WIDTH__' \
- | grep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_\(1\|2\|4\|8\)' \
+ | egrep -v '^#define __(BOOL|INT_(LEAST|FAST)(8|16|32|64)|INT|LONG|LLONG|SHRT)_WIDTH__' \
+ | egrep -v '^#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_(1|2|4|8)' \
| grep -v '^#define __FPCLASS_' \
| grep -v '^#define __FLT128_' \
| grep -v '^#define NDEBUG' \
@@ -803,7 +803,7 @@ check-symbols: startup_files libc
# This ignores whitespace because on Windows the output has CRLF line endings.
diff -wur "$(CURDIR)/expected/$(MULTIARCH_TRIPLE)" "$(SYSROOT_SHARE)"
diff -wur "expected/$(TARGET_TRIPLE)" "$(SYSROOT_SHARE)"

-install: finish
+install:
Expand Down
1 change: 1 addition & 0 deletions lang/wasi-libc/pkg/PLIST
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ share/wasi-sysroot/include/cpio.h
share/wasi-sysroot/include/crypt.h
share/wasi-sysroot/include/ctype.h
share/wasi-sysroot/include/dirent.h
share/wasi-sysroot/include/dlfcn.h
share/wasi-sysroot/include/endian.h
share/wasi-sysroot/include/err.h
share/wasi-sysroot/include/errno.h
Expand Down

0 comments on commit 3997b1a

Please sign in to comment.