From 057d6c62db9c043f5465eb382c8197ad7841b293 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 4 Jan 2025 10:24:47 -0800 Subject: [PATCH 1/6] Build: Enable zlib when building LLVM for inclusion * build/unix/release-with-batteries.sh: Since system libraries on current FreeBSD versions use zlib-compressed symbols, set LLVM_ENABLE_ZLIB=ON so that these are supported. --- build/unix/release-with-batteries.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/unix/release-with-batteries.sh b/build/unix/release-with-batteries.sh index ec3bbdfe4..64316281c 100755 --- a/build/unix/release-with-batteries.sh +++ b/build/unix/release-with-batteries.sh @@ -93,7 +93,7 @@ fi -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_LIBEDIT=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ - -DLLVM_ENABLE_ZLIB=OFF \ + -DLLVM_ENABLE_ZLIB=ON \ -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \ -DLLVM_BUILD_TOOLS=OFF \ From 237621ba3a27ec77a7d0d8b95acc73978b3555fb Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 4 Jan 2025 10:27:52 -0800 Subject: [PATCH 2/6] Build: Update to current LLVM and BDWGC releases * build/unix/release-with-batteries.sh: Update to LLVM 19.1.0 and BDW GC 8.2.8. --- build/unix/release-with-batteries.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/unix/release-with-batteries.sh b/build/unix/release-with-batteries.sh index 64316281c..6801d6354 100755 --- a/build/unix/release-with-batteries.sh +++ b/build/unix/release-with-batteries.sh @@ -1,12 +1,12 @@ #!/bin/sh set -e -LLVM_RELEASE=16.0.5 +LLVM_RELEASE=19.1.0 LLVM_REL=$(echo $LLVM_RELEASE | sed s/-rc/rc/) LLVM_CLANG=$(echo $LLVM_RELEASE | sed 's/\([0-9]*\).*/\1/') -BDWGC_RELEASE=8.2.4 +BDWGC_RELEASE=8.2.8 srcdir=`dirname $0` test -z "$srcdir" && srcdir=. From d21a2ff1b034cc2ce96ce943bcf38090fb04567a Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 4 Jan 2025 10:31:38 -0800 Subject: [PATCH 3/6] Build: Force symbolic link creation * Makefile.in (dist): Force symbolic link creation using ln -sf to improve robustness. --- Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2d6a84f72..a7bbcca5c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -355,8 +355,8 @@ dist: 3-stage-bootstrap rm -rf release/opendylan-$(version)/sources/bootstrap1-registry cp -R Bootstrap.3/bin release/opendylan-$(version)/ cp -R Bootstrap.3/sbin/* release/opendylan-$(version)/bin - ln -s deft-app release/opendylan-$(version)/bin/deft - ln -s deft-app release/opendylan-$(version)/bin/dylan # ease transition to "deft" + ln -sf deft-app release/opendylan-$(version)/bin/deft + ln -sf deft-app release/opendylan-$(version)/bin/dylan # ease transition to "deft" cp -R Bootstrap.3/databases release/opendylan-$(version)/ -cp -R Bootstrap.3/include/opendylan release/opendylan-$(version)/include cp -R Bootstrap.3/lib release/opendylan-$(version)/ @@ -368,7 +368,7 @@ dist: 3-stage-bootstrap cp $(srcdir)/BUILDING.rst release/opendylan-$(version)/ cd release \ && tar cjf opendylan-$(version)-$(TARGET_PLATFORM).tar.bz2 opendylan-$(version) \ - && ln -s opendylan-$(version)-$(TARGET_PLATFORM).tar.bz2 opendylan.tar.bz2 + && ln -sf opendylan-$(version)-$(TARGET_PLATFORM).tar.bz2 opendylan.tar.bz2 TEST_LIBS = \ From 9c461cf84aa00d945f5001a467fd59d354491ff2 Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 4 Jan 2025 10:34:20 -0800 Subject: [PATCH 4/6] Build: Fix path substitution for the batteries-included build This commit changes the batteries-included build so that the $(SYSTEM_ROOT) relative path transformation in config.jam is only done within the final release directory rather than polluting the build directory. * Makefile.in (dist): Always perform the relative path transformation in the config.jam file in the release directory. * build/unix/release-with-batteries.sh: Use the standard dist make target rather than doing the relative path transformation interspersed with the build. --- Makefile.in | 1 + build/unix/release-with-batteries.sh | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index a7bbcca5c..bf18b2bcc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -361,6 +361,7 @@ dist: 3-stage-bootstrap -cp -R Bootstrap.3/include/opendylan release/opendylan-$(version)/include cp -R Bootstrap.3/lib release/opendylan-$(version)/ cp -R Bootstrap.3/share/opendylan release/opendylan-$(version)/share + sed "s;`pwd`/release/opendylan-$(version);\$$(SYSTEM_ROOT);g" sources/jamfiles/config.jam >release/opendylan-$(version)/share/opendylan/build-scripts/config.jam cp -R $(srcdir)/tools/lldb release/opendylan-$(version)/share/opendylan cp -R $(srcdir)/tools/bash_completion release/opendylan-$(version)/share/opendylan cp $(srcdir)/License.txt release/opendylan-$(version)/ diff --git a/build/unix/release-with-batteries.sh b/build/unix/release-with-batteries.sh index 6801d6354..6a639c5d3 100755 --- a/build/unix/release-with-batteries.sh +++ b/build/unix/release-with-batteries.sh @@ -171,9 +171,4 @@ $top_srcdir/configure CC="$CC" CXX="$CXX" \ echo "RTLIBS_INSTALL += ${RTLIBS_INSTALL} ;" >>sources/jamfiles/config.jam -${MAKE} 3-stage-bootstrap DYLAN_JOBS=${DYLAN_JOBS} - -sed -i~ "s;${DISTDIR};\$(SYSTEM_ROOT);g" sources/jamfiles/config.jam -rm sources/jamfiles/config.jam~ - -${MAKE} dist +${MAKE} dist DYLAN_JOBS=${DYLAN_JOBS} From 419c6b923458fdd615360588ab14e44549a1190e Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 4 Jan 2025 11:52:11 -0800 Subject: [PATCH 5/6] build: Put included LLVM in a subdirectory of the release * build/unix/release-with-batteries.sh: Move the included LLVM (and LLVM libunwind where applicable) to a subdirectory of the release distribution directory to prevent polluting PATH with non-Dylan binaries. --- build/unix/release-with-batteries.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/unix/release-with-batteries.sh b/build/unix/release-with-batteries.sh index 6a639c5d3..4141cef6d 100755 --- a/build/unix/release-with-batteries.sh +++ b/build/unix/release-with-batteries.sh @@ -86,7 +86,7 @@ if $NEED_LIBUNWIND; then fi (cd ${LLVM_DIST}; cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=OFF \ - -DCMAKE_INSTALL_PREFIX=${DISTDIR} \ + -DCMAKE_INSTALL_PREFIX=${DISTDIR}/llvm \ -DLLVM_TARGETS_TO_BUILD:STRING="Native" \ -DLLVM_ENABLE_PROJECTS="llvm;clang;lld" \ ${RT_OPTS} \ @@ -133,13 +133,13 @@ fi -DLLVM_PARALLEL_COMPILE_JOBS=${DYLAN_JOBS} \ llvm; ninja install-clang install-lld install-clang-resource-headers ${RT_TARGETS}) -CC="${DISTDIR}/bin/clang${SYSROOT}" -CXX="${DISTDIR}/bin/clang++${SYSROOT}" +CC="${DISTDIR}/llvm/bin/clang${SYSROOT}" +CXX="${DISTDIR}/llvm/bin/clang++${SYSROOT}" RTLIBS_INSTALL= if $NEED_LIBUNWIND; then - for i in ${DISTDIR}/lib/*/libunwind*; do + for i in ${DISTDIR}/llvm/lib/*/libunwind*; do RTLIBS_INSTALL="$RTLIBS_INSTALL $i" done fi From 51151ccfc33b2a2507de66284da0b86ff144097a Mon Sep 17 00:00:00 2001 From: "Peter S. Housel" Date: Sat, 4 Jan 2025 15:01:51 -0800 Subject: [PATCH 6/6] Build: Default to use the lld linker in LLVM-included builds * build/unix/release-with-batteries.sh: When building LLVM, set the LLVM_ENABLE_LLD and CLANG_DEFAULT_LINKER=lld options. --- build/unix/release-with-batteries.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/unix/release-with-batteries.sh b/build/unix/release-with-batteries.sh index 4141cef6d..e14bacdc6 100755 --- a/build/unix/release-with-batteries.sh +++ b/build/unix/release-with-batteries.sh @@ -30,6 +30,7 @@ NEED_LIBUNWIND=: NEED_INSTALL_NAME=false SYSROOT= USE_LLD="-fuse-ld=lld" +USE_LLD_OPTS="-DLLVM_ENABLE_LLD:BOOL=ON -DCLANG_DEFAULT_LINKER=lld" BUILD_SRC=false case ${MACHINE}-${SYSTEM} in amd64-FreeBSD) @@ -61,6 +62,7 @@ case ${MACHINE}-${SYSTEM} in NEED_INSTALL_NAME=: SYSROOT=" -isysroot $(xcrun --show-sdk-path)" USE_LLD= + USE_LLD_OPTS= DYLAN_JOBS=$(getconf _NPROCESSORS_ONLN) ;; esac @@ -89,7 +91,7 @@ fi -DCMAKE_INSTALL_PREFIX=${DISTDIR}/llvm \ -DLLVM_TARGETS_TO_BUILD:STRING="Native" \ -DLLVM_ENABLE_PROJECTS="llvm;clang;lld" \ - ${RT_OPTS} \ + ${RT_OPTS} ${USE_LLD_OPTS} \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_LIBEDIT=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \