From 203a72254963928d2f98c73b86cad13bf1945fe5 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 16 Jul 2023 03:19:23 -0400 Subject: [PATCH 1/6] Add Mac ARM64 to toolchain-clean. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 94a3f78..8862a1b 100644 --- a/Makefile +++ b/Makefile @@ -132,7 +132,7 @@ toolchain-all: toolchain-lin toolchain-win toolchain-mac rack-sdk-all toolchain-clean: - rm -rf .build local osxcross $(rack-sdk-mac-x64) $(rack-sdk-win-x64) $(rack-sdk-lin-x64) + rm -rf .build local osxcross $(rack-sdk-mac-x64) $(rack-sdk-win-x64) $(rack-sdk-lin-x64) $(rack-sdk-mac-arm64) # Plugin build From 08907e1a6198d38cb2d60d9373eb70cd2b4fd2a7 Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Sun, 16 Jul 2023 16:24:45 -0600 Subject: [PATCH 2/6] Update Docker image to use Arch Linux. --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6117d3f..0a21102 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM archlinux:base-20230709.0.163418 ENV LANG C.UTF-8 ARG JOBS @@ -9,7 +9,7 @@ RUN useradd --create-home --uid 1000 --gid 1000 --shell /bin/bash build # Install make to run make ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y --no-install-recommends make +RUN pacman -Suy --noconfirm && pacman -S make --noconfirm # Create toolchain directory USER build @@ -20,9 +20,10 @@ COPY Makefile /home/build/rack-plugin-toolchain/ # Install dependencies for building toolchains and plugins USER root -RUN make dep-ubuntu +RUN make dep-arch-linux + # Clean up files to free up space -RUN rm -rf /var/lib/apt/lists/* +RUN pacman -Sc --noconfirm USER build COPY MacOSX11.1.sdk.tar.* /home/build/rack-plugin-toolchain/ From 59db4807a37b26e755f544d299d2ad7d638be18c Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Sun, 16 Jul 2023 16:25:20 -0600 Subject: [PATCH 3/6] Update documentation for changing Docker image to Arch Linux. Doc cleanup. --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 313701e..64b5490 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,32 @@ # VCV Rack plugin build toolchains -**Cross-compile** Rack plugins for Mac, Windows, and Linux with a single command on any Linux distro. +**Cross-compile** Rack plugins for Apple macOS, Microsoft Windows, and GNU/Linux with a single command on any Linux distro. ## Building Clone this repository in a **path without spaces**, or the Makefile will break. Obtain `MacOSX11.1.sdk.tar.xz` using the instructions at https://github.com/tpoechtrager/osxcross#packaging-the-sdk, and place it in the root of this repository. -You must have access to a Mac with **Xcode 12.4** to generate this SDK package. You **must** use this specific SDK version to build the toolchains. +You must have access to a Mac computer with **Xcode 12.4** to generate this SDK package. You **must** use this specific SDK version to build the toolchains. There are two ways to build the toolchains: -- Locally on Linux: Uses your system's compilers to build the toolchains. -- In a Docker container: This method uses an Ubuntu 20.04 base image and installs all dependencies necessary to build the toolchains. +- Locally on GNU/Linux: Uses your system's compilers to build the toolchains. +- In a Docker container: This method uses an Arch Linux base image and installs all dependencies necessary to build the toolchains. + +**NOTE:** The official VCV Rack plugin build system is based on Arch Linux. ### Local toolchain build -*Requires a Linux host.* +*Requires a GNU/Linux host.* Install toolchain build dependencies. -On Ubuntu, +On Arch Linux, ```bash -sudo make dep-ubuntu +sudo make dep-arch-linux ``` -Or on Arch Linux, +or on Ubuntu, ```bash -sudo make dep-arch-linux +sudo make dep-ubuntu ``` Build toolchains for all three platforms. From f776a9d6dc1f5b8474d8f126251e5441e1d8dcc1 Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Sun, 16 Jul 2023 16:26:08 -0600 Subject: [PATCH 4/6] Update dep-arch-linux Makefile target to install Arch Linux dependencies. Build osxcross with native clang compiler in Arch Linux. --- Makefile | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 8862a1b..64a72d0 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ $(toolchain-win): $(crosstool-ng) toolchain-mac := $(LOCAL_DIR)/osxcross toolchain-mac: $(toolchain-mac) -MAC_CLANG_VERSION := 12.0.1 -MAC_BINUTILS_VERSION := 2.37 +#MAC_CLANG_VERSION := 12.0.1 +#MAC_BINUTILS_VERSION := 2.37 # Binaries from ./build.sh must be available in order to run ./build_binutils.sh $(toolchain-mac): export PATH := $(LOCAL_DIR)/osxcross/bin:$(PATH) $(toolchain-mac): @@ -70,19 +70,19 @@ $(toolchain-mac): cd osxcross && git checkout 12f179126df156fb65515cccf140f4b634967baa # Build clang - cd osxcross && UNATTENDED=1 DISABLE_BOOTSTRAP=1 INSTALLPREFIX="$(LOCAL_DIR)" CLANG_VERSION=$(MAC_CLANG_VERSION) OCDEBUG=1 JOBS=$(JOBS) ./build_clang.sh - cd osxcross/build/build_stage && make install -j $(JOBS) + #cd osxcross && UNATTENDED=1 DISABLE_BOOTSTRAP=1 INSTALLPREFIX="$(LOCAL_DIR)" CLANG_VERSION=$(MAC_CLANG_VERSION) OCDEBUG=1 JOBS=$(JOBS) ./build_clang.sh + #cd osxcross/build/build_stage && make install -j $(JOBS) # Build osxcross cp MacOSX11.1.sdk.tar.* osxcross/tarballs/ cd osxcross && PATH="$(LOCAL_DIR)/bin:$(PATH)" UNATTENDED=1 TARGET_DIR="$(LOCAL_DIR)/osxcross" JOBS=$(JOBS) ./build.sh # Build compiler-rt - cd osxcross && ENABLE_COMPILER_RT_INSTALL=1 JOBS=$(JOBS) ./build_compiler_rt.sh + #cd osxcross && ENABLE_COMPILER_RT_INSTALL=1 JOBS=$(JOBS) ./build_compiler_rt.sh # Build Mac version of binutils and build LLVM gold - cd osxcross && BINUTILS_VERSION=$(MAC_BINUTILS_VERSION) TARGET_DIR="$(LOCAL_DIR)/osxcross" JOBS=$(JOBS) ./build_binutils.sh - cd osxcross/build/build_stage && cmake . -DLLVM_BINUTILS_INCDIR=$(PWD)/osxcross/build/binutils-$(MAC_BINUTILS_VERSION)/include && make install -j $(JOBS) + #cd osxcross && BINUTILS_VERSION=$(MAC_BINUTILS_VERSION) TARGET_DIR="$(LOCAL_DIR)/osxcross" JOBS=$(JOBS) ./build_binutils.sh + #cd osxcross/build/build_stage && cmake . -DLLVM_BINUTILS_INCDIR=$(PWD)/osxcross/build/binutils-$(MAC_BINUTILS_VERSION)/include && make install -j $(JOBS) rm -rf osxcross @@ -241,10 +241,23 @@ dep-ubuntu: dep-arch-linux: - # TODO Complete this list - sudo pacman -S --needed \ - wget \ - help2man + pacman -S --noconfirm --needed \ + git \ + cmake \ + patch \ + clang \ + python3 \ + automake \ + help2man \ + texinfo \ + libtool \ + jq \ + rsync \ + autoconf \ + flex \ + bison \ + which \ + unzip docker-build: rack-sdk-all From 96417f3377634aa551bf6e8875f11e307319ae0f Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Mon, 17 Jul 2023 21:15:00 -0600 Subject: [PATCH 5/6] Update crosstool-ng to development version to fix hanging build. Remove obsolete code. Add missing dependencies for Arch host system. --- Makefile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 64a72d0..417b0f9 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,9 @@ all: toolchain-all crosstool-ng := $(LOCAL_DIR)/bin/ct-ng $(crosstool-ng): - git clone https://github.com/crosstool-ng/crosstool-ng.git - # Use development version to avoid zlib issue until proper release is available - cd crosstool-ng && git checkout 82346dd7dfe7ed20dc8ec71e193c2d3b1930e22d + # FIXME Use development version until fix for hanging build is merged to crosstool-ng repository. + git clone https://github.com/cpackham/crosstool-ng.git + cd crosstool-ng && git checkout a7835a0251e5acdb38d7cbf301457058266bcbca cd crosstool-ng && ./bootstrap cd crosstool-ng && ./configure --prefix="$(LOCAL_DIR)" cd crosstool-ng && make -j $(JOBS) @@ -60,19 +60,12 @@ $(toolchain-win): $(crosstool-ng) toolchain-mac := $(LOCAL_DIR)/osxcross toolchain-mac: $(toolchain-mac) -#MAC_CLANG_VERSION := 12.0.1 -#MAC_BINUTILS_VERSION := 2.37 -# Binaries from ./build.sh must be available in order to run ./build_binutils.sh $(toolchain-mac): export PATH := $(LOCAL_DIR)/osxcross/bin:$(PATH) $(toolchain-mac): # Download osxcross git clone "https://github.com/cschol/osxcross.git" osxcross cd osxcross && git checkout 12f179126df156fb65515cccf140f4b634967baa - # Build clang - #cd osxcross && UNATTENDED=1 DISABLE_BOOTSTRAP=1 INSTALLPREFIX="$(LOCAL_DIR)" CLANG_VERSION=$(MAC_CLANG_VERSION) OCDEBUG=1 JOBS=$(JOBS) ./build_clang.sh - #cd osxcross/build/build_stage && make install -j $(JOBS) - # Build osxcross cp MacOSX11.1.sdk.tar.* osxcross/tarballs/ cd osxcross && PATH="$(LOCAL_DIR)/bin:$(PATH)" UNATTENDED=1 TARGET_DIR="$(LOCAL_DIR)/osxcross" JOBS=$(JOBS) ./build.sh @@ -257,7 +250,12 @@ dep-arch-linux: flex \ bison \ which \ - unzip + unzip \ + wget \ + glu \ + libx11 \ + mesa + docker-build: rack-sdk-all From 75f19e1c78b9c9ec0588c397d8e89fa61b3fc19e Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Sat, 22 Jul 2023 15:47:53 -0600 Subject: [PATCH 6/6] Update crosstool-ng to updated version with fix for hanging build. --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 417b0f9..c730908 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,8 @@ all: toolchain-all crosstool-ng := $(LOCAL_DIR)/bin/ct-ng $(crosstool-ng): - # FIXME Use development version until fix for hanging build is merged to crosstool-ng repository. - git clone https://github.com/cpackham/crosstool-ng.git - cd crosstool-ng && git checkout a7835a0251e5acdb38d7cbf301457058266bcbca + git clone https://github.com/crosstool-ng/crosstool-ng.git + cd crosstool-ng && git checkout e63c40854c977f488bee159a8f8ebf5fc06c8666 cd crosstool-ng && ./bootstrap cd crosstool-ng && ./configure --prefix="$(LOCAL_DIR)" cd crosstool-ng && make -j $(JOBS)