mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 04:28:52 +01:00
3rdparty/cross-compiler: Various fixes and multi-host arch support
Change-Id: I57e8a0be75950c767d115131b838006036d4bc0e Reviewed-on: https://review.haiku-os.org/c/haiku/+/8796 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
8ecc31ca7b
commit
b2474d284f
8
3rdparty/docker/cross-compiler/Dockerfile
vendored
8
3rdparty/docker/cross-compiler/Dockerfile
vendored
@ -1,7 +1,7 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
# docker build --no-cache --tag docker.io/haiku/cross-compiler:x86_64 .
|
||||
# docker push docker.io/haiku/cross-compiler:x86_64
|
||||
# docker build --no-cache --tag ghcr.io/haiku/cross-compiler:x86_64 .
|
||||
# docker push ghcr.io/haiku/cross-compiler:x86_64
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
autoconf \
|
||||
@ -14,7 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
file \
|
||||
flex \
|
||||
g++ \
|
||||
g++-multilib \
|
||||
gawk \
|
||||
git \
|
||||
libcurl4-openssl-dev \
|
||||
@ -28,7 +27,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
vim \
|
||||
wget \
|
||||
xz-utils \
|
||||
zlib1g-dev
|
||||
zlib1g-dev; \
|
||||
if [ $(uname -m) = "x86_64" ]; then apt-get install -y g++-multilib; fi
|
||||
|
||||
# source revision to build
|
||||
ARG BUILDTOOLS_REV=master
|
||||
|
@ -32,10 +32,15 @@ git clone --depth=1 --branch $BUILDTOOLS_REV https://review.haiku-os.org/buildto
|
||||
# The Haiku build requires the ability to find a hrev tag. In case a specific branch is selected
|
||||
# (like `r1beta4`)`, we will get the entire history just to be sure that the tag will exist.
|
||||
cd haiku
|
||||
if ! `git describe --dirty --tags --match=hrev* --abbrev=1`; then
|
||||
if [ ! "$(git describe --dirty --tags --match=hrev* --abbrev=1)" ]; then
|
||||
git fetch --unshallow
|
||||
fi
|
||||
|
||||
# Scale up cores to speed up, but don't go crazy since Jam starts
|
||||
# to lose its mind at 8+
|
||||
NCPU=$(nproc)
|
||||
if [ $NCPU -gt 8 ]; then NCPU=8; fi
|
||||
|
||||
# Build a cross-compiler
|
||||
cd $BUILDTOOLS/jam
|
||||
make && ./jam0 install
|
||||
@ -57,14 +62,23 @@ if [ -n "$SECONDARY_ARCH" ]; then
|
||||
fi
|
||||
|
||||
# Build needed packages and tools for the cross-compiler
|
||||
jam -q haiku.hpkg haiku_devel.hpkg '<build>package'
|
||||
jam -j$NCPU -q haiku.hpkg haiku_devel.hpkg '<build>package'
|
||||
if [ -n "$SECONDARY_ARCH" ]; then
|
||||
jam -q haiku_${SECONDARY_ARCH}.hpkg haiku_${SECONDARY_ARCH}_devel.hpkg
|
||||
jam -j$NCPU -q haiku_${SECONDARY_ARCH}.hpkg haiku_${SECONDARY_ARCH}_devel.hpkg
|
||||
fi
|
||||
|
||||
# Set up our sysroot
|
||||
cp $OUTPUT/objects/linux/lib/*.so /lib/x86_64-linux-gnu
|
||||
cp $OUTPUT/objects/linux/x86_64/release/tools/package/package /bin/
|
||||
HOST_ARCH=$(uname -m)
|
||||
case $HOST_ARCH in
|
||||
aarch64)
|
||||
HOST_ARCH=arm64
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
cp $OUTPUT/objects/linux/lib/*.so /lib/$(uname -m)-linux-gnu
|
||||
cp $OUTPUT/objects/linux/$HOST_ARCH/release/tools/package/package /bin/
|
||||
for file in $SYSROOT/../bin/*; do
|
||||
ln -s $file /bin/$(basename $file)
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user