Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasi: update libc to sdk-20 and modularise LLVM bits
wasi-libcxx and wasi-compiler-rt now meta ports (similar to u-boot); the build process is the same for each LLVM version so child ports are minimal. Minimum supported LLVM version is 12, thus its corresponding child ports are resurrected and LLVM 11 child ports are removed. Since all supported LLVM versions are made available at once, remove restriction in bsd.gecko.mk and switch to USES=llvm throughout. LTO on gecko ports should now work with later LLVM versions so long as ${DEFAULT_VERSIONS} is set properly and matches the LLVM used in rust (if not using the PORT_LLVM option). Reviewed by: brooks (LLVM ports interactions) Tested by: Eric Camachat <eric[at]camachat[dot]org> Approved by: maintainer timeout (gecko@ portion, 2+ weeks) PR: 274896 Differential Revision: https://reviews.freebsd.org/D40098
- Loading branch information
Showing
37 changed files
with
3,655 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
PORTNAME= compiler-rt | ||
DISTVERSION?= 0 | ||
PORTREVISION?= 0 | ||
CATEGORIES= devel lang | ||
MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ | ||
https://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR}/ | ||
PKGNAMEPREFIX= wasi- | ||
PKGNAMESUFFIX= ${LLVM_VERSION} | ||
DISTNAME= llvm-project-${DISTVERSION}.src | ||
DISTFILES= llvm-project-${DISTVERSION}.src${EXTRACT_SUFX} | ||
|
||
MAINTAINER= vishwin@FreeBSD.org | ||
COMMENT= Clang builtins library for WebAssembly System Interface | ||
WWW= https://llvm.org/ | ||
|
||
LICENSE= LLVM2 | ||
LICENSE_NAME= Apache License 2.0 with LLVM Exceptions | ||
LICENSE_FILE= ${WRKSRC}/llvm/LICENSE.TXT | ||
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept | ||
|
||
.if ${DISTVERSION} == 0 | ||
IGNORE= is a meta-port; there is nothing to build | ||
.endif | ||
|
||
BUILD_DEPENDS= ${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc | ||
|
||
USES= cmake llvm:${LLVM_SUFFIX} tar:xz | ||
|
||
LLVM_RELEASE= ${DISTVERSION:C/rc.*//} | ||
LLVM_SUFFIX= ${LLVM_RELEASE:C/\.[0-9]\.[0-9]$//} | ||
DISTINFO_FILE= ${PORTSDIR}/${LLVM_PORT}/distinfo | ||
NO_ARCH= yes | ||
|
||
CC= ${LOCALBASE}/bin/clang${LLVM_VERSION} | ||
CXX= ${LOCALBASE}/bin/clang++${LLVM_VERSION} | ||
WASI_SYSROOT= ${LOCALBASE}/share/wasi-sysroot | ||
TRIPLE= wasm32-wasi | ||
WITHOUT_CPU_CFLAGS= yes | ||
# try to sync with https://github.com/WebAssembly/wasi-sdk | ||
# Makefile and wasi-sdk.cmake | ||
CMAKE_SOURCE_PATH= ${WRKSRC}/compiler-rt/lib/builtins | ||
CMAKE_ARGS= -DCMAKE_AR=${LOCALBASE}/bin/llvm-ar${LLVM_VERSION} \ | ||
-DCMAKE_RANLIB=${LOCALBASE}/bin/llvm-ranlib${LLVM_VERSION} \ | ||
-DCMAKE_C_COMPILER_TARGET=${TRIPLE} \ | ||
-DCMAKE_CXX_COMPILER_TARGET=${TRIPLE} \ | ||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ | ||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ | ||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ | ||
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \ | ||
-DCMAKE_SYSROOT=${WASI_SYSROOT} \ | ||
-DCMAKE_C_COMPILER_WORKS=ON \ | ||
-DCOMPILER_RT_BAREMETAL_BUILD=ON \ | ||
-DCOMPILER_RT_INCLUDE_TESTS=OFF \ | ||
-DCOMPILER_RT_HAS_FPIC_FLAG=ON \ | ||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
-DCOMPILER_RT_OS_DIR=wasi | ||
|
||
.include <bsd.port.pre.mk> | ||
|
||
.if ${LLVM_VERSION} < 16 | ||
CMAKE_ARGS+= -DLLVM_CONFIG_PATH=${LLVM_CONFIG} | ||
CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX}/lib/clang/${LLVM_RELEASE} | ||
PLIST_FILES= ${LLVM_PREFIX}/lib/clang/${LLVM_RELEASE}/lib/wasi/libclang_rt.builtins-wasm32.a | ||
.else | ||
CMAKE_ARGS+= -DLLVM_CMAKE_DIR=${LLVM_PREFIX} | ||
CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX}/lib/clang/${LLVM_VERSION} | ||
PLIST_FILES= ${LLVM_PREFIX}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a | ||
.endif | ||
|
||
.include <bsd.port.post.mk> |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# must sync with devel/llvm12 | ||
DISTVERSION= 12.0.1 | ||
|
||
MASTERDIR= ${.CURDIR}/../wasi-compiler-rt | ||
|
||
.include "${MASTERDIR}/Makefile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,6 @@ | ||
PORTNAME= compiler-rt | ||
# must sync with devel/llvm13 | ||
DISTVERSION= 13.0.1 | ||
CATEGORIES= devel lang | ||
MASTER_SITES= https://github.com/llvm/llvm-project/releases/download/llvmorg-${DISTVERSION:S/rc/-rc/}/ \ | ||
https://${PRE_}releases.llvm.org/${LLVM_RELEASE}/${RCDIR} | ||
PKGNAMEPREFIX= wasi- | ||
PKGNAMESUFFIX= ${LLVM_SUFFIX} | ||
DISTNAME= llvm-project-${DISTVERSION}.src | ||
DISTFILES= llvm-project-${DISTVERSION}.src${EXTRACT_SUFX} | ||
|
||
MAINTAINER= vishwin@FreeBSD.org | ||
COMMENT= Clang builtins library for WebAssembly System Interface | ||
WWW= https://llvm.org/ | ||
MASTERDIR= ${.CURDIR}/../wasi-compiler-rt | ||
|
||
LICENSE= LLVM2 | ||
LICENSE_FILE= ${WRKSRC}/llvm/LICENSE.TXT | ||
LICENSE_NAME= Apache License 2.0 with LLVM Exceptions | ||
LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept | ||
|
||
LLVM_RELEASE= ${DISTVERSION:C/rc.*//} | ||
LLVM_SUFFIX= ${LLVM_RELEASE:C/\.[0-9]\.[0-9]$//} | ||
LLVM_PREFIX= ${PREFIX}/llvm${LLVM_SUFFIX} | ||
|
||
WASI_SYSROOT= ${LOCALBASE}/share/wasi-sysroot | ||
|
||
BUILD_DEPENDS= ${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc \ | ||
clang${LLVM_SUFFIX}:devel/llvm${LLVM_SUFFIX} | ||
|
||
USES= cmake tar:xz | ||
NO_ARCH= yes | ||
|
||
PLIST_FILES= llvm${LLVM_SUFFIX}/lib/clang/${LLVM_RELEASE}/lib/wasi/libclang_rt.builtins-wasm32.a | ||
|
||
CC= ${LOCALBASE}/bin/clang${LLVM_SUFFIX} | ||
CXX= ${LOCALBASE}/bin/clang++${LLVM_SUFFIX} | ||
|
||
CMAKE_SOURCE_PATH= ${WRKSRC}/compiler-rt/lib/builtins | ||
CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX}/lib/clang/${LLVM_RELEASE} | ||
CMAKE_ARGS= -DCMAKE_C_COMPILER_WORKS=1 \ | ||
-DCMAKE_SYSROOT=${WASI_SYSROOT} \ | ||
-DLLVM_CONFIG_PATH=${LOCALBASE}/bin/llvm-config${LLVM_SUFFIX} \ | ||
-DCOMPILER_RT_OS_DIR=wasi \ | ||
-DCOMPILER_RT_BAREMETAL_BUILD=TRUE \ | ||
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=wasm32-wasi \ | ||
-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=TRUE \ | ||
-DCOMPILER_RT_HAS_FPIC_FLAG:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_FPIE_FLAG:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_FNO_BUILTIN_FLAG:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_STD_C11_FLAG:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_FREESTANDING_FLAG:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_XRAY_COMPILER_FLAG:BOOL=OFF \ | ||
-DCOMPILER_RT_HAS_ATOMIC_KEYWORD:BOOL=ON \ | ||
-DCOMPILER_RT_HAS_FLOAT16:BOOL=OFF \ | ||
-DCOMPILER_RT_HAS_ASM_LSE:BOOL=OFF | ||
|
||
post-build: | ||
${LOCALBASE}/bin/llvm-ranlib${LLVM_SUFFIX} ${CONFIGURE_WRKSRC}/lib/wasi/*.a | ||
|
||
.include <bsd.port.mk> | ||
.include "${MASTERDIR}/Makefile" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# must sync with devel/llvm14 | ||
DISTVERSION= 14.0.6 | ||
|
||
MASTERDIR= ${.CURDIR}/../wasi-compiler-rt | ||
|
||
.include "${MASTERDIR}/Makefile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# must sync with devel/llvm15 | ||
DISTVERSION= 15.0.7 | ||
|
||
MASTERDIR= ${.CURDIR}/../wasi-compiler-rt | ||
|
||
.include "${MASTERDIR}/Makefile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# must sync with devel/llvm16 | ||
DISTVERSION= 16.0.6 | ||
|
||
MASTERDIR= ${.CURDIR}/../wasi-compiler-rt | ||
|
||
.include "${MASTERDIR}/Makefile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# must sync with devel/llvm17 | ||
DISTVERSION= 17.0.5 | ||
|
||
MASTERDIR= ${.CURDIR}/../wasi-compiler-rt | ||
|
||
.include "${MASTERDIR}/Makefile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.