Skip to content

Commit

Permalink
Improvements to the release-with-batteries build (#1644)
Browse files Browse the repository at this point in the history
These changes update the with-batteries build to include newer LLVM and
BDWGC releases, properly canonicalize tool and library paths in the
build script configuration, and use the included LLVM linker as the
default.

Fixes #1483
  • Loading branch information
housel authored Jan 5, 2025
2 parents 16bbc84 + 51151cc commit ce6ba32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
7 changes: 4 additions & 3 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -355,20 +355,21 @@ 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)/
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)/
cp $(srcdir)/README.md release/opendylan-$(version)/
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 = \
Expand Down
25 changes: 11 additions & 14 deletions build/unix/release-with-batteries.sh
Original file line number Diff line number Diff line change
@@ -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=.
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -86,14 +88,14 @@ 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} \
${RT_OPTS} ${USE_LLD_OPTS} \
-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 \
Expand Down Expand Up @@ -133,13 +135,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
Expand Down Expand Up @@ -171,9 +173,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}

0 comments on commit ce6ba32

Please sign in to comment.