From b014ca410803eac368a990d6a678f89169ab5db9 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 31 Dec 2024 22:52:06 +1100 Subject: [PATCH 01/78] linux fix build targets --- scripts/calculate_formulas.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/calculate_formulas.sh b/scripts/calculate_formulas.sh index 7e4e266a7..3a5b9aca6 100755 --- a/scripts/calculate_formulas.sh +++ b/scripts/calculate_formulas.sh @@ -38,14 +38,30 @@ FORMULAS=( "curl" # "poco" "svgtiny" - #"uri" "cairo" "fmt" "metalangle" ) # Seperate in bundles on osx -if [[ "$TARGET" =~ ^(osx|macos|ios|tvos|xros|catos|watchos)$ ]]; then +if [[ "$TARGET" =~ ^(linuxarmv6l|linuxarmv7l|linuxaarch64|linux|linux64)$ ]]; then + FORMULAS=( + # Dependencies for other formulas (cairo) + "glm" + "json" + "utf8" + "brotli" + # All formulas + "glew" + "videoInput" + "rtAudio" + "tess2" + "kiss" + "uriparser" + # # Formulas with depenencies in the end + "cairo" + ) +elif [[ "$TARGET" =~ ^(osx|macos|ios|tvos|xros|catos|watchos)$ ]]; then if [ "$BUNDLE" == "1" ]; then FORMULAS=( From 3e99ee8f169ac7254a0c3c585995bb184871cd51 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 31 Dec 2024 23:18:10 +1100 Subject: [PATCH 02/78] Raspberry Pi 64 - GCC 14.2.0 - Bookworm --- .github/workflows/build-linux-arm.yml | 11 ++++++----- scripts/linuxaarch64/install_and_build.sh | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index f8fb5c405..29bc8d497 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -7,6 +7,7 @@ on: paths-ignore: - "**/README.md" jobs: + build-linux-aarch64: runs-on: ubuntu-latest env: @@ -36,11 +37,11 @@ jobs: if: steps.folder-check.outputs.folder-exists == 'false' run: > cd $WORKDIR && - wget https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/cross-gcc-10.3.0-pi_64.tar.gz - --no-check-certificate && - tar xf cross-gcc-10.3.0-pi_64.tar.gz && - rm cross-gcc-10.3.0-pi_64.tar.gz && - mv cross-pi-gcc-10.3.0-64 raspbian + wget https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/cross-gcc-14.2.0-pi_64.tar.gz/download \ + --no-check-certificate -O cross-gcc-14.2.0-pi_64.tar.gz && + tar xf cross-gcc-14.2.0-pi_64.tar.gz && + rm cross-gcc-14.2.0-pi_64.tar.gz && + mv cross-pi-gcc-14.2.0-64 raspbian - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 1125191f2..3fa3b75c5 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -22,6 +22,9 @@ RASP="$ROOT/raspbian" PATH=$RASP/bin:$PATH LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH + +export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/aarch64-linux-gnu/*/ + export AR="aarch64-linux-gnu-gcc-ar" export CC="aarch64-linux-gnu-gcc" export CXX="aarch64-linux-gnu-g++" @@ -30,7 +33,7 @@ export FC="aarch64-linux-gnu-gfortran" export RANLIB="aarch64-linux-gnu-gcc-ranlib" export LD="$CXX" -GCCPATH="$RASP/libexec/gcc/aarch64-linux-gnu/10.3.1" +GCCPATH="$RASP/libexec/gcc/aarch64-linux-gnu/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" From da7d2a35a847a830181d639dc990f1f36382df9f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 31 Dec 2024 23:22:18 +1100 Subject: [PATCH 03/78] Fix download --- .github/workflows/build-linux-arm.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 29bc8d497..b6e0c48b2 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -36,12 +36,7 @@ jobs: - name: Download and extract tar file if: steps.folder-check.outputs.folder-exists == 'false' run: > - cd $WORKDIR && - wget https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/cross-gcc-14.2.0-pi_64.tar.gz/download \ - --no-check-certificate -O cross-gcc-14.2.0-pi_64.tar.gz && - tar xf cross-gcc-14.2.0-pi_64.tar.gz && - rm cross-gcc-14.2.0-pi_64.tar.gz && - mv cross-pi-gcc-14.2.0-64 raspbian + cd $WORKDIR && wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/cross-gcc-14.2.0-pi_64.tar.gz/download" -O cross-gcc-14.2.0-pi_64.tar.gz && tar xf cross-gcc-14.2.0-pi_64.tar.gz &&rm cross-gcc-14.2.0-pi_64.tar.gz &&mv cross-pi-gcc-14.2.0-64 raspbian - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh From 55e19e586f27955dca9512b318eaf292b213b3ef Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 31 Dec 2024 23:30:27 +1100 Subject: [PATCH 04/78] linux calculate - remove rtAudio --- scripts/calculate_formulas.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/calculate_formulas.sh b/scripts/calculate_formulas.sh index 3a5b9aca6..9b05af191 100755 --- a/scripts/calculate_formulas.sh +++ b/scripts/calculate_formulas.sh @@ -54,7 +54,6 @@ if [[ "$TARGET" =~ ^(linuxarmv6l|linuxarmv7l|linuxaarch64|linux|linux64)$ ]]; th # All formulas "glew" "videoInput" - "rtAudio" "tess2" "kiss" "uriparser" From 1754076816b01c1d19fa675c8bdc0a80d302dcaa Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 31 Dec 2024 23:43:22 +1100 Subject: [PATCH 05/78] Update toolchain --- .github/workflows/build-linux-arm.yml | 2 ++ scripts/linuxaarch64/install_and_build.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index b6e0c48b2..75d8cb5b3 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -14,6 +14,8 @@ jobs: TARGET: linuxaarch64 WORKDIR: "/home/runner/work/apothecary/apothecary" SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian" + TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" + TOOLCHAIN_PREFIX: "aarch64-linux-gnu" steps: - uses: actions/checkout@v2 diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 3fa3b75c5..1a524a219 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -22,7 +22,7 @@ RASP="$ROOT/raspbian" PATH=$RASP/bin:$PATH LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH - +export GCC_PREFIX=aarch64-linux-gnu export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/aarch64-linux-gnu/*/ export AR="aarch64-linux-gnu-gcc-ar" From f60c893abcf7962bb3f769bdc66bd3766751d410 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 31 Dec 2024 23:54:33 +1100 Subject: [PATCH 06/78] linux arch --- .github/workflows/build-linux-arm.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 75d8cb5b3..1cb4181ac 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest env: TARGET: linuxaarch64 + ARCH: arm64 WORKDIR: "/home/runner/work/apothecary/apothecary" SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" @@ -56,6 +57,7 @@ jobs: runs-on: ubuntu-latest env: TARGET: "linuxarmv6l" + ARCH: armv6l SYSROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/raspbian" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/rpi_toolchain" TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" From 92dc69dde1e16923f41ffab3ba60b688262ac965 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 00:30:09 +1100 Subject: [PATCH 07/78] Cross Compilers Linux Raspberry Pi 1 / Zero (armv6), Pi 3A, 3B, 4, Pi 5 (armv7) Tests for armv6/armv7 enabled --- .github/workflows/build-linux-arm.yml | 147 +++++++++++++++++++++----- 1 file changed, 120 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 1cb4181ac..478ca3ad0 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -53,33 +53,126 @@ jobs: files: out/openFrameworksLibs_master_linuxaarch64.tar.bz2 if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' - build-linux-arm6: - runs-on: ubuntu-latest - env: - TARGET: "linuxarmv6l" - ARCH: armv6l - SYSROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/raspbian" - TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/rpi_toolchain" - TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" - steps: - - uses: actions/checkout@v2 - - name: Scripts Calc Formula - run: ./scripts/calculate_formulas.sh - - name: Scripts Install - run: ./scripts/$TARGET/install.sh - - name: build - run: ./scripts/build.sh - env: - GA_CI_SECRET: ${{ secrets.CI_SECRET }} - - name: Update Release - uses: johnwbyrd/update-release@v1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: nightly - release: nightly - prerelease: false - files: out/openFrameworksLibs_master_linuxarmv6l.tar.bz2 - if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' + build-linux-armv6l-pi-1zero: + runs-on: ubuntu-latest + env: + TARGET: linuxarmv6l + ARCH: armv6 + WORKDIR: "/home/runner/work/apothecary/apothecary" + SYSROOT: "/home/runner/work/apothecary/apothecary/raspbianpi1zero" + TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbianpi1zero" + TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" + steps: + - uses: actions/checkout@v2 + + - name: Cache raspbian folder + uses: actions/cache@v2 + with: + path: /home/runner/work/apothecary/apothecary/raspbianpi1zero + key: raspbian-pi1zero-cache-2 + + - name: Check if folder exists + id: folder-check + run: > + if [ -d $SYSROOT ]; then + echo "Raspbian folder already exists. Skipping download and extract." + echo "::set-output name=folder-exists::true" + else + echo "::set-output name=folder-exists::false" + fi + + - name: Download and extract tar file + if: steps.folder-check.outputs.folder-exists == 'false' + run: > + cd $WORKDIR && + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + + - name: Script Install and Build + run: ./scripts/$TARGET/install_and_build.sh + - name: Update Release + uses: johnwbyrd/update-release@v1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: nightly + release: nightly + prerelease: false + files: out/openFrameworksLibs_master_linuxarmv6l.tar.bz2 + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' + + build-linux-armv7-pi3ab45: + runs-on: ubuntu-latest + env: + TARGET: linuxarmv7l + ARCH: armv7 + WORKDIR: "/home/runner/work/apothecary/apothecary" + SYSROOT: "/home/runner/work/apothecary/apothecary/raspbianpi3ab45" + TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbianpi3ab45" + TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" + steps: + - uses: actions/checkout@v2 + + - name: Cache raspbian folder + uses: actions/cache@v2 + with: + path: /home/runner/work/apothecary/apothecary/raspbianpi3ab45 + key: raspbian-pi3ab45-cache-2 + + - name: Check if folder exists + id: folder-check + run: > + if [ -d $SYSROOT ]; then + echo "Raspbian folder already exists. Skipping download and extract." + echo "::set-output name=folder-exists::true" + else + echo "::set-output name=folder-exists::false" + fi + + - name: Download and extract tar file + if: steps.folder-check.outputs.folder-exists == 'false' + run: > + cd $WORKDIR && + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi3ab45 + + - name: Script Install and Build + run: ./scripts/$TARGET/install_and_build.sh + - name: Update Release + uses: johnwbyrd/update-release@v1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag: nightly + release: nightly + prerelease: false + files: out/openFrameworksLibs_master_linuxarmv7l.tar.bz2 + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' + + + # build-linux-arm6: + # runs-on: ubuntu-latest + # env: + # TARGET: "linuxarmv6l" + # ARCH: armv6l + # SYSROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/raspbian" + # TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/rpi_toolchain" + # TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" + # steps: + # - uses: actions/checkout@v2 + # - name: Scripts Calc Formula + # run: ./scripts/calculate_formulas.sh + # - name: Scripts Install + # run: ./scripts/$TARGET/install.sh + # - name: build + # run: ./scripts/build.sh + # env: + # GA_CI_SECRET: ${{ secrets.CI_SECRET }} + # - name: Update Release + # uses: johnwbyrd/update-release@v1.0.0 + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + # tag: nightly + # release: nightly + # prerelease: false + # files: out/openFrameworksLibs_master_linuxarmv6l.tar.bz2 + # if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' # build-linux-arm7: # runs-on: ubuntu-latest From e49b115988875bdf83625e2e84ec8bd2ebcd463e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 00:33:50 +1100 Subject: [PATCH 08/78] Fix linuxv7 deploy cross compiler --- .github/workflows/build-linux-arm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 478ca3ad0..87b655854 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -131,7 +131,7 @@ jobs: if: steps.folder-check.outputs.folder-exists == 'false' run: > cd $WORKDIR && - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi3ab45 + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3%2B.tar.gz && tar xf cross-gcc-14.2.0-pi_3%2B.tar.gz && rm cross-gcc-14.2.0-pi_3%2B.tar.gz && mv cross-gcc-14.2.0-pi_3%2B raspbianpi3ab45 - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh From 440fdf4bb337cc2ef54c6eeec84596229611c403 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 00:42:53 +1100 Subject: [PATCH 09/78] Fix install scripts --- scripts/linuxaarch64/install.sh | 24 +++++++++++------------- scripts/linuxarmv6l/install.sh | 10 +++++----- scripts/linuxarmv7l/install.sh | 19 ++++++------------- 3 files changed, 22 insertions(+), 31 deletions(-) diff --git a/scripts/linuxaarch64/install.sh b/scripts/linuxaarch64/install.sh index 5ffff08c2..448b3364f 100755 --- a/scripts/linuxaarch64/install.sh +++ b/scripts/linuxaarch64/install.sh @@ -25,10 +25,8 @@ createRaspbianImg(){ } downloadToolchain(){ - wget https://github.com/openframeworks/openFrameworks/releases/download/tools/cross-gcc-10.3.0-pi_64.tar.gz - tar xvf cross-gcc-10.3.0-pi_64.tar.gz - mv cross-pi-gcc-10.3.0-64 rpi_toolchain - rm cross-gcc-10.3.0-pi_64.tar.gz + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + } downloadFirmware(){ @@ -62,18 +60,18 @@ ROOT=$( cd "$(dirname "$0")" ; pwd -P ) echo $ROOT cd $ROOT installPackages -createRaspbianImg +# createRaspbianImg downloadToolchain -downloadFirmware +# downloadFirmware -cp -rn rpi_toolchain/aarch64-linux-gnu/libc/lib/* $ROOT/raspbian/usr/lib/ -cp -rn rpi_toolchain/aarch64-linux-gnu/libc/usr/lib/* $ROOT/raspbian/usr/lib/ -cp -rn rpi_toolchain/aarch64-linux-gnu/lib/* $ROOT/raspbian/usr/lib/ +# cp -rn rpi_toolchain/aarch64-linux-gnu/libc/lib/* $ROOT/raspbian/usr/lib/ +# cp -rn rpi_toolchain/aarch64-linux-gnu/libc/usr/lib/* $ROOT/raspbian/usr/lib/ +# cp -rn rpi_toolchain/aarch64-linux-gnu/lib/* $ROOT/raspbian/usr/lib/ -cd $ROOT/raspbian/usr/lib -relativeSoftLinks -cd $ROOT/raspbian/usr/lib/aarch64-linux-gnu -relativeSoftLinks +# cd $ROOT/raspbian/usr/lib +# relativeSoftLinks +# cd $ROOT/raspbian/usr/lib/aarch64-linux-gnu +# relativeSoftLinks sudo apt-get update && sudo apt-get install -y autoconf libtool automake dos2unix sudo apt-get update && sudo apt-get install -y cmake diff --git a/scripts/linuxarmv6l/install.sh b/scripts/linuxarmv6l/install.sh index c30ab3fe1..04ebb9c4c 100755 --- a/scripts/linuxarmv6l/install.sh +++ b/scripts/linuxarmv6l/install.sh @@ -38,9 +38,8 @@ createRaspbianImg(){ } downloadToolchain(){ - wget -nv https://github.com/openframeworks/openFrameworks/releases/download/tools/rpi_toolchain_gcc6.tar.bz2 - tar xjf rpi_toolchain_gcc6.tar.bz2 - rm rpi_toolchain_gcc6.tar.bz2 + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + } downloadFirmware(){ @@ -75,8 +74,9 @@ if [[ $(uname -m) != armv* ]]; then echo $ROOT cd $ROOT installPackages - createRaspbianImg - downloadFirmware + # createRaspbianImg + # downloadFirmware + downloadToolchain fi diff --git a/scripts/linuxarmv7l/install.sh b/scripts/linuxarmv7l/install.sh index edc9acf1f..0293e13a5 100755 --- a/scripts/linuxarmv7l/install.sh +++ b/scripts/linuxarmv7l/install.sh @@ -33,16 +33,8 @@ EOF } downloadToolchain(){ - #wget http://archlinuxarm.org/builder/xtools/x-tools7h.tar.xz - #tar xf x-tools7h.tar.xz - #rm x-tools7h.tar.xz - if [ "$(ls -A ~/rpi2_toolchain)" ]; then - echo "Using cached RPI2 toolchain" - else - wget -q https://github.com/openframeworks/openFrameworks/releases/download/tools/rpi2_toolchain.tar.bz2 - tar xjf rpi2_toolchain.tar.bz2 -C ~/ - rm rpi2_toolchain.tar.bz2 - fi + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3%2B.tar.gz && tar xf cross-gcc-14.2.0-pi_3%2B.tar.gz && rm cross-gcc-14.2.0-pi_3%2B.tar.gz && mv cross-gcc-14.2.0-pi_3%2B raspbianpi3ab45 + } downloadFirmware(){ @@ -95,9 +87,10 @@ if [[ $(uname -m) != armv* ]]; then ROOT=$( cd "$(dirname "$0")" ; pwd -P ) echo $ROOT cd $ROOT - installJunest - createArchImg - downloadFirmware + # installJunest + # createArchImg + # downloadFirmware + downloadToolchain #cd $HOME/archlinux/usr/lib #relativeSoftLinks "../.." "..\/.." From 60e5532a0cfb7d496ebe9ddb75fb3a5b7863eacb Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 00:52:48 +1100 Subject: [PATCH 10/78] Fix install --- .github/workflows/build-linux-arm.yml | 4 ++-- scripts/linuxarmv6l/install.sh | 2 +- scripts/linuxarmv7l/install.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 87b655854..11e12dab5 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -85,7 +85,7 @@ jobs: if: steps.folder-check.outputs.folder-exists == 'false' run: > cd $WORKDIR && - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh @@ -131,7 +131,7 @@ jobs: if: steps.folder-check.outputs.folder-exists == 'false' run: > cd $WORKDIR && - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3%2B.tar.gz && tar xf cross-gcc-14.2.0-pi_3%2B.tar.gz && rm cross-gcc-14.2.0-pi_3%2B.tar.gz && mv cross-gcc-14.2.0-pi_3%2B raspbianpi3ab45 + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-gcc-14.2.0-pi_3+ raspbianpi3ab45 - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh diff --git a/scripts/linuxarmv6l/install.sh b/scripts/linuxarmv6l/install.sh index 04ebb9c4c..213eff34b 100755 --- a/scripts/linuxarmv6l/install.sh +++ b/scripts/linuxarmv6l/install.sh @@ -38,7 +38,7 @@ createRaspbianImg(){ } downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero } diff --git a/scripts/linuxarmv7l/install.sh b/scripts/linuxarmv7l/install.sh index 0293e13a5..d70bdca40 100755 --- a/scripts/linuxarmv7l/install.sh +++ b/scripts/linuxarmv7l/install.sh @@ -33,7 +33,7 @@ EOF } downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3%2B.tar.gz && tar xf cross-gcc-14.2.0-pi_3%2B.tar.gz && rm cross-gcc-14.2.0-pi_3%2B.tar.gz && mv cross-gcc-14.2.0-pi_3%2B raspbianpi3ab45 + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-gcc-14.2.0-pi_3+ raspbianpi3ab45 } From fe65377805e7b4323e930efb8039d6a46957ef7f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 00:59:09 +1100 Subject: [PATCH 11/78] Cross compiler install extract --- .github/workflows/build-linux-arm.yml | 4 ++-- scripts/linuxarmv6l/install.sh | 2 +- scripts/linuxarmv7l/install.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 11e12dab5..b3b92bff1 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -85,7 +85,7 @@ jobs: if: steps.folder-check.outputs.folder-exists == 'false' run: > cd $WORKDIR && - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0 raspbianpi1zero - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh @@ -131,7 +131,7 @@ jobs: if: steps.folder-check.outputs.folder-exists == 'false' run: > cd $WORKDIR && - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-gcc-14.2.0-pi_3+ raspbianpi3ab45 + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-pi-gcc-14.2.0-2 raspbianpi3ab45 - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh diff --git a/scripts/linuxarmv6l/install.sh b/scripts/linuxarmv6l/install.sh index 213eff34b..3592293cc 100755 --- a/scripts/linuxarmv6l/install.sh +++ b/scripts/linuxarmv6l/install.sh @@ -38,7 +38,7 @@ createRaspbianImg(){ } downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-pi-gcc-14.2.0-2 raspbianpi3ab45 } diff --git a/scripts/linuxarmv7l/install.sh b/scripts/linuxarmv7l/install.sh index d70bdca40..e9456e338 100755 --- a/scripts/linuxarmv7l/install.sh +++ b/scripts/linuxarmv7l/install.sh @@ -33,7 +33,7 @@ EOF } downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-gcc-14.2.0-pi_3+ raspbianpi3ab45 + wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0 raspbianpi1zero } From 24dd171a0ae185237cdc02aa4b3f26fac798c13a Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 01:07:49 +1100 Subject: [PATCH 12/78] fix install --- scripts/linuxaarch64/install_and_build.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 1a524a219..1ba34fbe4 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -25,15 +25,15 @@ LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH export GCC_PREFIX=aarch64-linux-gnu export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/aarch64-linux-gnu/*/ -export AR="aarch64-linux-gnu-gcc-ar" -export CC="aarch64-linux-gnu-gcc" -export CXX="aarch64-linux-gnu-g++" -export CPP="aarch64-linux-gnu-cpp" -export FC="aarch64-linux-gnu-gfortran" -export RANLIB="aarch64-linux-gnu-gcc-ranlib" +export AR="${GCC_PREFIX}-gcc-ar" +export CC="${GCC_PREFIX}-gcc" +export CXX="${GCC_PREFIX}-g++" +export CPP="${GCC_PREFIX}-cpp" +export FC="${GCC_PREFIX}-gfortran" +export RANLIB="${GCC_PREFIX}-gcc-ranlib" export LD="$CXX" -GCCPATH="$RASP/libexec/gcc/aarch64-linux-gnu/${GCC_VERSION}" +GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" From 2958c0a472e3f11c78930f62bdb299b0e5ace736 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 01:17:06 +1100 Subject: [PATCH 13/78] Install and build --- scripts/linuxarmv6l/install_and_build.sh | 53 ++++++++++++++++++++++++ scripts/linuxarmv7l/install_and_build.sh | 53 ++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 scripts/linuxarmv6l/install_and_build.sh create mode 100644 scripts/linuxarmv7l/install_and_build.sh diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh new file mode 100644 index 000000000..a50ab880e --- /dev/null +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -e +set -o pipefail +# trap any script errors and exit +trap "trapError" ERR + +trapError() { + echo + echo " ^ Received error ^" + cat formula.log + exit 1 +} + +sudo apt-get install -y aptitude +sudo aptitude install -y gperf + +ROOT=/home/runner/work/apothecary/apothecary +echo $ROOT +cd $ROOT +RASP="$ROOT/raspbianpi1zero" + +PATH=$RASP/bin:$PATH +LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH + +export GCC_PREFIX=arm-linux-gnueabihf +export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/arm-linux-gnueabihf/*/ + +export AR="${GCC_PREFIX}-gcc-ar" +export CC="${GCC_PREFIX}-gcc" +export CXX="${GCC_PREFIX}-g++" +export CPP="${GCC_PREFIX}-cpp" +export FC="${GCC_PREFIX}-gfortran" +export RANLIB="${GCC_PREFIX}-gcc-ranlib" +export LD="$CXX" + +GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" +export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" + +#echo "ROOT dir " +#ls -la $ROOT +# +#echo "RASP dir " +#ls -la $RASP +# +#echo "GCCPATH IS " +#echo $GCCPATH + +echo "calculate formulas" +$ROOT/scripts/calculate_formulas.sh + +echo "building" +$ROOT/scripts/build.sh diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh new file mode 100644 index 000000000..5b7ba2541 --- /dev/null +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -e +set -o pipefail +# trap any script errors and exit +trap "trapError" ERR + +trapError() { + echo + echo " ^ Received error ^" + cat formula.log + exit 1 +} + +sudo apt-get install -y aptitude +sudo aptitude install -y gperf + +ROOT=/home/runner/work/apothecary/apothecary +echo $ROOT +cd $ROOT +RASP="$ROOT/raspbianpi3ab45" + +PATH=$RASP/bin:$PATH +LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH + +export GCC_PREFIX=arm-linux-gnueabihf +export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/arm-linux-gnueabihf/*/ + +export AR="${GCC_PREFIX}-gcc-ar" +export CC="${GCC_PREFIX}-gcc" +export CXX="${GCC_PREFIX}-g++" +export CPP="${GCC_PREFIX}-cpp" +export FC="${GCC_PREFIX}-gfortran" +export RANLIB="${GCC_PREFIX}-gcc-ranlib" +export LD="$CXX" + +GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" +export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" + +#echo "ROOT dir " +#ls -la $ROOT +# +#echo "RASP dir " +#ls -la $RASP +# +#echo "GCCPATH IS " +#echo $GCCPATH + +echo "calculate formulas" +$ROOT/scripts/calculate_formulas.sh + +echo "building" +$ROOT/scripts/build.sh From adeeef93620a1755bbd67f86f9c50ad61726e1e6 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 01:22:07 +1100 Subject: [PATCH 14/78] Executable --- .github/workflows/build-linux-arm.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index b3b92bff1..624b17578 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -86,7 +86,8 @@ jobs: run: > cd $WORKDIR && wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0 raspbianpi1zero - + - name: Ensure Script is Executable + run: chmod +x ./scripts/$TARGET/install_and_build.sh - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh - name: Update Release @@ -133,6 +134,8 @@ jobs: cd $WORKDIR && wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-pi-gcc-14.2.0-2 raspbianpi3ab45 + - name: Ensure Script is Executable + run: chmod +x ./scripts/$TARGET/install_and_build.sh - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh - name: Update Release From bab5decbb6246e4276dcb8a84543c004c3258237 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 01:50:35 +1100 Subject: [PATCH 15/78] Cross compiling - Configure and set toolchain linked --- apothecary/formulas/libxml2/libxml2.sh | 5 +- apothecary/linuxaarch64_configure.sh | 68 ++++++++++++++++++++------ apothecary/linuxarmv6l_configure.sh | 47 +++++++++++++++--- apothecary/linuxarmv7l_configure.sh | 68 ++++++++++++++++++++++---- 4 files changed, 153 insertions(+), 35 deletions(-) diff --git a/apothecary/formulas/libxml2/libxml2.sh b/apothecary/formulas/libxml2/libxml2.sh index 17df8dc68..a24c8326a 100644 --- a/apothecary/formulas/libxml2/libxml2.sh +++ b/apothecary/formulas/libxml2/libxml2.sh @@ -296,7 +296,9 @@ function build() { cmake --build . --config Release cd .. elif [ "$TYPE" == "linuxarmv6l" ] || [ "$TYPE" == "linuxarmv7l" ] || [ "$TYPE" == "linuxaarch64" ]; then - source ../../${TYPE}_configure.sh + if [ $CROSSCOMPILING -eq 1 ]; then + source ../../${TYPE}_configure.sh + fi export CFLAGS="$CFLAGS -DTRIO_FPCLASSIFY=fpclassify" sed -i "s/#if defined.STANDALONE./#if 0/g" trionan.c find . -name "test*.c" | xargs -r rm @@ -318,7 +320,6 @@ function build() { -DCMAKE_SYSTEM_PROCESSOR=$ABI \ -DLIBXML2_WITH_LZMA=OFF \ -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/aarch64-linux-gnu.toolchain.cmake \ -DLIBXML2_WITH_THREAD_ALLOC=OFF cmake --build . --config Release cd .. diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 478f01653..e7ab22001 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -1,20 +1,58 @@ -export GCC_PREFIX=aarch64-linux-gnu -export GCC_VERSION=10.3.1 -export GST_VERSION=1.0 +# Set the root directory + +# Set Raspbian toolchain directory export RPI_ROOT=$SYSROOT -export PLATFORM_OS=Linux -export PLATFORM_ARCH=aarch64 -export PKG_CONFIG_LIBDIR=${RPI_ROOT}/usr/lib/pkgconfig:${RPI_ROOT}/usr/lib/${GCC_PREFIX}/pkgconfig:${RPI_ROOT}/usr/share/pkgconfig -export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" -export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" -export AR=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar -export LD=${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld +RASP="$RPI_ROOT/raspbian" + +# Update PATH and library paths +export PATH=$RASP/bin:$PATH +export LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH + +# Set GCC cross-compilation variables +export GCC_PREFIX="aarch64-linux-gnu" +export GCC_VERSION="14.2.0" # Adjust as needed + +# Define cross-compilation tools +export AR="${GCC_PREFIX}-gcc-ar" +export CC="${GCC_PREFIX}-gcc" +export CXX="${GCC_PREFIX}-g++" +export CPP="${GCC_PREFIX}-cpp" +export FC="${GCC_PREFIX}-gfortran" +export RANLIB="${GCC_PREFIX}-gcc-ranlib" +export LD="$CXX" + +# GCC plugin path for LTO +GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" +export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" + +# GStreamer version for dependencies +export GST_VERSION="1.0" + +# Package configuration path +export PKG_CONFIG_PATH="$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig" -export PATH=/rpi_toolchain/bin/:$PATH -export LD_LIBRARY_PATH=/rpi_toolchain/lib +# Compiler flags for ARM64 +export CFLAGS="--sysroot=${SYSROOT} \ + -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ + -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ + -I$SYSROOT/opt/vc/include \ + -I$SYSROOT/opt/vc/include/IL \ + -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" -export CFLAGS="--sysroot=${SYSROOT} -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include -I$SYSROOT/opt/vc/include -I$SYSROOT/opt/vc/include/IL -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" +# Linker flags for ARM64 +export LDFLAGS="--sysroot=${SYSROOT} \ + -L${SYSROOT}/usr/lib/${GCC_PREFIX} \ + -L${SYSROOT}/usr/lib/aarch64-linux-gnu \ + -L${TOOLCHAIN_ROOT}/aarch64-linux-gnu/lib64 \ + -L${TOOLCHAIN_ROOT}/aarch64-linux-gnu/libc/lib64 \ + -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} \ + -L${SYSROOT}/lib/${GCC_PREFIX}" -export LDFLAGS="--sysroot=${SYSROOT} -L${SYSROOT}/usr/lib/${GCC_PREFIX} -L${SYSROOT}/usr/lib/aarch64-linux-gnu -L${TOOLCHAIN_ROOT}/aarch64-linux-gnu/lib64 -L${TOOLCHAIN_ROOT}/aarch64-linux-gnu/libc/lib64 -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} -L${SYSROOT}/lib/${GCC_PREFIX}" +# Host system for cross-compilation +export HOST="${GCC_PREFIX}" -export HOST=aarch64-linux-gnu +# Debugging output +echo "Using GCC Version: $GCC_VERSION" +echo "Toolchain Path: $RASP" +echo "GCC Path: $GCCPATH" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 0fba8f4ec..aeb65073b 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -1,11 +1,42 @@ -export PKG_CONFIG_PATH=$SYSROOT/usr/lib/$TOOLCHAIN_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig -export CROSS_COMPILE=$TOOLCHAIN_ROOT/bin/$TOOLCHAIN_PREFIX- -export CXX=${CROSS_COMPILE}g++ -export CC=${CROSS_COMPILE}gcc -export AR=${CROSS_COMPILE}ar -export LD=${CROSS_COMPILE}ld -export RANLIB=${CROSS_COMPILE}ranlib +# Set the root directory +export RPI_ROOT=$SYSROOT +# Set Raspbian toolchain directory +RASP="$RPI_ROOT/raspbianpi3ab45" + +# Update PATH and library paths +export PATH=$RASP/bin:$PATH +export LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH + +# Set GCC cross-compilation variables +export GCC_PREFIX="arm-linux-gnueabihf" +export GCC_VERSION="14.2.0" # Adjust as needed + +# Define cross-compilation tools +export AR="${GCC_PREFIX}-gcc-ar" +export CC="${GCC_PREFIX}-gcc" +export CXX="${GCC_PREFIX}-g++" +export CPP="${GCC_PREFIX}-cpp" +export FC="${GCC_PREFIX}-gfortran" +export RANLIB="${GCC_PREFIX}-gcc-ranlib" +export LD="$CXX" + +# GCC plugin path for LTO +GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" +export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" + +# Package configuration path +export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig" + +# Compiler flags for cross-compilation export CFLAGS="--sysroot=${SYSROOT} -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include -I$SYSROOT/opt/vc/include/IL -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -I$SYSROOT/opt/vc/lib -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" + +# Linker flags for cross-compilation export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -lm" -export HOST=arm-linux-gnueabihf +# Host system for cross-compilation +export HOST="${GCC_PREFIX}" + +echo "Using GCC Version: $GCC_VERSION" +echo "Toolchain Path: $RASP" +echo "GCC Path: $GCCPATH" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 0ef424621..5ccf4f050 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -1,10 +1,58 @@ -export PKG_CONFIG_PATH=$SYSROOT/usr/lib/$TOOLCHAIN_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig -export CROSS_COMPILE=$TOOLCHAIN_ROOT/bin/$TOOLCHAIN_PREFIX- -export CXX=${CROSS_COMPILE}g++ -export CC=${CROSS_COMPILE}gcc -export AR=${CROSS_COMPILE}ar -export LD=${CROSS_COMPILE}ld -export RANLIB=${CROSS_COMPILE}ranlib -export CFLAGS="--sysroot=${SYSROOT} -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include -I$SYSROOT/opt/vc/include/IL -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -I$SYSROOT/opt/vc/lib -march=armv7-a -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" -export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -L$SYSROOT/opt/vc/lib/" -export HOST=arm-linux-gnueabihf +# Set the root directory +export RPI_ROOT=$SYSROOT +# Set Raspbian toolchain directory +RASP="$RPI_ROOT/raspbianpi3ab45" + +# Update PATH and library paths +export PATH=$RASP/bin:$PATH +export LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH + +# Set GCC cross-compilation variables +export GCC_PREFIX="arm-linux-gnueabihf" +export GCC_VERSION="14.2.0" # Adjust as needed + +# Define cross-compilation tools +export AR="${GCC_PREFIX}-gcc-ar" +export CC="${GCC_PREFIX}-gcc" +export CXX="${GCC_PREFIX}-g++" +export CPP="${GCC_PREFIX}-cpp" +export FC="${GCC_PREFIX}-gfortran" +export RANLIB="${GCC_PREFIX}-gcc-ranlib" +export LD="$CXX" + +# GCC plugin path for LTO +GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" +export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" + +# Package configuration path +export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig" + +# Compiler flags for ARMv7 +export CFLAGS="--sysroot=${SYSROOT} \ + -I$SYSROOT/usr/include \ + -I$SYSROOT/opt/vc/include \ + -I$SYSROOT/opt/vc/include/IL \ + -I$SYSROOT/opt/vc/include/interface/vcos/pthreads \ + -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux \ + -I$SYSROOT/opt/vc/lib \ + -march=armv7-a -mfpu=vfp -mfloat-abi=hard \ + -fPIC -ftree-vectorize -Wno-psabi -pipe \ + -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ + -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \ + -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX \ + -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" + +# Linker flags for ARMv7 +export LDFLAGS="--sysroot=${SYSROOT} \ + -L$SYSROOT/usr/lib \ + -L$SYSROOT/usr/lib/arm-linux-gnueabihf \ + -L$SYSROOT/opt/vc/lib/" + +# Host system for cross-compilation +export HOST="${GCC_PREFIX}" + +# Debugging output +echo "Using GCC Version: $GCC_VERSION" +echo "Toolchain Path: $RASP" +echo "GCC Path: $GCCPATH" From e9299abd705f876ccc3b05c69808c1c63bc76c44 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 02:07:10 +1100 Subject: [PATCH 16/78] linux / linux raspberry pi - fmt, libxml2, rtAudio, tess2, zlib --- apothecary/formulas/fmt/fmt.sh | 9 +++--- apothecary/formulas/libxml2/libxml2.sh | 11 ++++---- apothecary/formulas/rtAudio/rtAudio.sh | 12 ++++++-- apothecary/formulas/tess2/tess2.sh | 39 ++++++++++++++++++++------ apothecary/formulas/zlib/zlib.sh | 12 ++++---- 5 files changed, 57 insertions(+), 26 deletions(-) diff --git a/apothecary/formulas/fmt/fmt.sh b/apothecary/formulas/fmt/fmt.sh index ef44aa263..bc1ad84e2 100644 --- a/apothecary/formulas/fmt/fmt.sh +++ b/apothecary/formulas/fmt/fmt.sh @@ -164,14 +164,15 @@ function build() { -DCMAKE_INSTALL_INCLUDEDIR=include \ cmake --build . --target install --config Release cd .. - elif [ "$TYPE" == "linuxaarch64" ]; then - source ../../${TYPE}_configure.sh - mkdir -p build_$TYPE + elif [[ "$TYPE" =~ ^(linuxarmv6l|linuxarmv7l|linuxaarch64)$ ]]; then + if [ $CROSSCOMPILING -eq 1 ]; then + source ../../${TYPE}_configure.sh + fi + mkdir -p build_$TYPE cd build_$TYPE rm -f CMakeCache.txt *.a *.o cmake .. \ ${DEFINES} \ - -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/aarch64-linux-gnu.toolchain.cmake \ -DCMAKE_SYSTEM_NAME=$TYPE \ -DCMAKE_SYSTEM_PROCESSOR=$ABI \ -DCMAKE_C_STANDARD=${C_STANDARD} \ diff --git a/apothecary/formulas/libxml2/libxml2.sh b/apothecary/formulas/libxml2/libxml2.sh index a24c8326a..90f934d4f 100644 --- a/apothecary/formulas/libxml2/libxml2.sh +++ b/apothecary/formulas/libxml2/libxml2.sh @@ -310,6 +310,8 @@ function build() { cmake .. \ ${DEFS} \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_C_STANDARD=${C_STANDARD} \ -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ @@ -330,11 +332,8 @@ function build() { function copy() { # prepare headers directory if needed mkdir -p $1/include/libxml - - # create a common lib directory path mkdir -p $1/lib/$TYPE . "$SECURE_SCRIPT" - # copy files specific to each build TYPE if [ "$TYPE" == "vs" ]; then mkdir -p $1/lib/$TYPE/$PLATFORM/ cp -Rv "build_${TYPE}_${PLATFORM}/Release/include/libxml2/"* $1/include/ @@ -368,10 +367,10 @@ function copy() { cp -Rv "build_${TYPE}_${PLATFORM}/Release/include/libxml2/libxml/" $1/include/libxml cp -Rv build_${TYPE}_${PLATFORM}/libxml/xmlversion.h $1/include/libxml/xmlversion.h elif [ "$TYPE" == "linux64" ] || [ "$TYPE" == "linux" ] || [ "$TYPE" == "linuxaarch64" ] || [ "$TYPE" == "linuxarmv6l" ] || [ "$TYPE" == "linuxarmv7l" ] || [ "$TYPE" == "msys2" ]; then - cp -v "build_${TYPE}/libxml2.a" $1/lib/$TYPE/libxml2.a + cp -v "build_${TYPE}_${PLATFORM}/Release/lib/libxml2.a" $1/lib/$TYPE/libxml2.a secure $1/lib/$TYPE/libxml2.a - cp -Rv build_${TYPE}/libxml/xmlversion.h $1/include/libxml/xmlversion.h - cp -Rv include/libxml/* $1/include/libxml/ + cp -Rv "build_${TYPE}_${PLATFORM}/Release/include/libxml2/libxml/" $1/include/libxml + cp -Rv build_${TYPE}_${PLATFORM}/libxml/xmlversion.h $1/include/libxml/xmlversion.h else echo "Unknown build TYPE: $TYPE" exit 1 diff --git a/apothecary/formulas/rtAudio/rtAudio.sh b/apothecary/formulas/rtAudio/rtAudio.sh index c5dd47df6..ec9cf965b 100755 --- a/apothecary/formulas/rtAudio/rtAudio.sh +++ b/apothecary/formulas/rtAudio/rtAudio.sh @@ -136,6 +136,9 @@ function build() { cd .. elif [[ "$TYPE" =~ ^(linux|linux64|linuxarmv6l|linuxarmv7l|linuxaarch64)$ ]]; then # Compile the program + if [ $CROSSCOMPILING -eq 1 ]; then + source ../../${TYPE}_configure.sh + fi mkdir -p build cd build rm -f CMakeCache.txt *.a *.o @@ -208,8 +211,13 @@ function copy() { elif [ "$TYPE" == "osx" ] ; then mkdir -p $1/lib/$TYPE/$PLATFORM/ cp -Rv build_${TYPE}_${PLATFORM}/Release/include/rtaudio/* $1/include/ - cp -vf "build_${TYPE}_${PLATFORM}/Release/lib/librtaudio.a" $1/lib/$TYPE/$PLATFORM/librtaudio.a - secure $1/lib/$TYPE/$PLATFORM/librtaudio.a rtaudio + cp -vf "build_${TYPE}_${PLATFORM}/Release/lib/librtaudio.a" $1/lib/$TYPE/$PLATFORM/librtaudio.a + secure $1/lib/$TYPE/$PLATFORM/librtaudio.a rtaudio + elif [[ "$TYPE" =~ ^(linuxarmv6l|linuxarmv7l|linuxaarch64|linuxx86|linuxx64)$ ]]; then + mkdir -p $1/lib/$TYPE/$PLATFORM/ + cp -Rv build_${TYPE}_${PLATFORM}/Release/include/rtaudio/* $1/include/ + cp -vf "build_${TYPE}_${PLATFORM}/Release/lib/librtaudio.a" $1/lib/$TYPE/$PLATFORM/librtaudio.a + secure $1/lib/$TYPE/$PLATFORM/librtaudio.a rtaudio fi # copy license file diff --git a/apothecary/formulas/tess2/tess2.sh b/apothecary/formulas/tess2/tess2.sh index c9c783107..a648c2805 100644 --- a/apothecary/formulas/tess2/tess2.sh +++ b/apothecary/formulas/tess2/tess2.sh @@ -194,14 +194,35 @@ function build() { if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh fi - mkdir -p build - cd build - cp -v $FORMULA_DIR/Makefile . - cp -v $FORMULA_DIR/tess2.make . - make config=release tess2 + echoVerbose "building $TYPE | $ARCH " + echoVerbose "--------------------" + mkdir -p "build_${TYPE}_${ARCH}" + cd "build_${TYPE}_${ARCH}" + rm -f CMakeCache.txt *.a *.o *.so + DEFINES="-DLIBRARY_SUFFIX=${ARCH} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_STANDARD=${C_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF + -DBUILD_SHARED_LIBS=OFF" + cmake .. ${DEFINES} \ + -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DZLIB_BUILD_EXAMPLES=OFF \ + -DSKIP_EXAMPLE=ON \ + -DCMAKE_SYSTEM_NAME=$TYPE \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DENABLE_VISIBILITY=OFF \ + -DCMAKE_INSTALL_INCLUDEDIR=include + cmake --build . --target install --config Release cd .. - mkdir -p build/$TYPE - mv build/libtess2.a build/$TYPE else mkdir -p build/$TYPE cd build/$TYPE @@ -229,10 +250,10 @@ function copy() { cp -Rv "build_${TYPE}_${PLATFORM}/Release/include/" $1/ cp -f "build_${TYPE}_${PLATFORM}/Release/lib/tess2.lib" $1/lib/$TYPE/$PLATFORM/tess2.lib secure $1/lib/$TYPE/$PLATFORM/tess2.lib tess2 - elif [[ "$TYPE" =~ ^(osx|ios|tvos|xros|catos|watchos)$ ]]; then + elif [[ "$TYPE" =~ ^(osx|ios|tvos|xros|catos|watchos|linuxarmv6l|linuxarmv7l|linuxaarch64|linuxx86|linuxx64)$ ]]; then mkdir -p $1/lib/$TYPE/$PLATFORM/ cp -v "build_${TYPE}_${PLATFORM}/Release/lib/libtess2.a" $1/lib/$TYPE/$PLATFORM/libtess2.a - secure $1/lib/$TYPE/$PLATFORM/libtess2.a tess2 + secure $1/lib/$TYPE/$PLATFORM/libtess2.a tess2 cp -Rv "build_${TYPE}_${PLATFORM}/Release/include/" $1/include elif [ "$TYPE" == "emscripten" ]; then mkdir -p $1/lib/$TYPE/$PLATFORM/ diff --git a/apothecary/formulas/zlib/zlib.sh b/apothecary/formulas/zlib/zlib.sh index f943ec783..d02753ab0 100644 --- a/apothecary/formulas/zlib/zlib.sh +++ b/apothecary/formulas/zlib/zlib.sh @@ -168,22 +168,24 @@ function build() { $EMSDK/upstream/emscripten/emmake make install cd .. elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] || [ "$TYPE" == "linuxaarch64" ] || [ "$TYPE" == "linuxarmv6l" ] || [ "$TYPE" == "linuxarmv7l" ] || [ "$TYPE" == "msys2" ]; then - + if [ $CROSSCOMPILING -eq 1 ]; then + source ../../${TYPE}_configure.sh + fi echoVerbose "building $TYPE | $ARCH " echoVerbose "--------------------" mkdir -p "build_${TYPE}_${ARCH}" cd "build_${TYPE}_${ARCH}" rm -f CMakeCache.txt *.a *.o *.so - DEFS="-DLIBRARY_SUFFIX=${ARCH} \ + DEFINES="-DLIBRARY_SUFFIX=${ARCH} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_STANDARD=${C_STANDARD} \ -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_SHARED_LIBS=OFF" - cmake .. ${DEFS} \ - -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude" \ - -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude" \ + cmake .. ${DEFINES} \ + -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DZLIB_BUILD_EXAMPLES=OFF \ From 227d802128a5fc79eff065829b20d147a8eacfb0 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 02:11:11 +1100 Subject: [PATCH 17/78] Configure LD path --- apothecary/linuxaarch64_configure.sh | 2 +- apothecary/linuxarmv6l_configure.sh | 2 +- apothecary/linuxarmv7l_configure.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index e7ab22001..3f08b3767 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -6,7 +6,7 @@ RASP="$RPI_ROOT/raspbian" # Update PATH and library paths export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$RASP/lib # Set GCC cross-compilation variables export GCC_PREFIX="aarch64-linux-gnu" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index aeb65073b..2fc313379 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -5,7 +5,7 @@ RASP="$RPI_ROOT/raspbianpi3ab45" # Update PATH and library paths export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$RASP/lib # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 5ccf4f050..d400c15a5 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -5,7 +5,7 @@ RASP="$RPI_ROOT/raspbianpi3ab45" # Update PATH and library paths export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$RASP/lib # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" From 2a9bd7304eec497f77ba819d1c8fc88f0d94ffea Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 12:45:19 +1100 Subject: [PATCH 18/78] Linux cross compiler tess2/zlib setup --- apothecary/formulas/tess2/tess2.sh | 17 +++++++++-- apothecary/formulas/zlib/zlib.sh | 47 ++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/apothecary/formulas/tess2/tess2.sh b/apothecary/formulas/tess2/tess2.sh index a648c2805..12bca6f60 100644 --- a/apothecary/formulas/tess2/tess2.sh +++ b/apothecary/formulas/tess2/tess2.sh @@ -207,8 +207,18 @@ function build() { -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_SHARED_LIBS=OFF" cmake .. ${DEFINES} \ - -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ - -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_COMPILER=${CC} \ + -DCMAKE_CXX_COMPILER=${CXX} \ + -DCMAKE_AR=${AR} \ + -DCMAKE_RANLIB=${RANLIB} \ + -DCMAKE_SYSROOT=${SYSROOT} \ + -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ + -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ + -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE ${CFLAGS}}" \ + -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DZLIB_BUILD_EXAMPLES=OFF \ @@ -220,7 +230,8 @@ function build() { -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DENABLE_VISIBILITY=OFF \ - -DCMAKE_INSTALL_INCLUDEDIR=include + -DCMAKE_INSTALL_INCLUDEDIR=include \ + -DCMAKE_VERBOSE_MAKEFILE=TRUE cmake --build . --target install --config Release cd .. else diff --git a/apothecary/formulas/zlib/zlib.sh b/apothecary/formulas/zlib/zlib.sh index d02753ab0..5b08b2f21 100644 --- a/apothecary/formulas/zlib/zlib.sh +++ b/apothecary/formulas/zlib/zlib.sh @@ -167,7 +167,37 @@ function build() { $EMSDK/upstream/emscripten/emmake make -j $EMSDK/upstream/emscripten/emmake make install cd .. - elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] || [ "$TYPE" == "linuxaarch64" ] || [ "$TYPE" == "linuxarmv6l" ] || [ "$TYPE" == "linuxarmv7l" ] || [ "$TYPE" == "msys2" ]; then + elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] || [ "$TYPE" == "msys2" ]; then + echoVerbose "building $TYPE | $ARCH " + echoVerbose "--------------------" + mkdir -p "build_${TYPE}_${ARCH}" + cd "build_${TYPE}_${ARCH}" + rm -f CMakeCache.txt *.a *.o *.so + DEFINES="-DLIBRARY_SUFFIX=${ARCH} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_STANDARD=${C_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF + -DBUILD_SHARED_LIBS=OFF" + cmake .. ${DEFINES} \ + -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DZLIB_BUILD_EXAMPLES=OFF \ + -DSKIP_EXAMPLE=ON \ + -DCMAKE_SYSTEM_NAME=$TYPE \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DENABLE_VISIBILITY=OFF \ + -DCMAKE_INSTALL_INCLUDEDIR=include + cmake --build . --target install --config Release + cd .. + elif [ "$TYPE" == "linuxaarch64" ] || [ "$TYPE" == "linuxarmv6l" ] || [ "$TYPE" == "linuxarmv7l" ] ; then if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh fi @@ -184,8 +214,18 @@ function build() { -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_SHARED_LIBS=OFF" cmake .. ${DEFINES} \ - -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ - -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_COMPILER=${CC} \ + -DCMAKE_CXX_COMPILER=${CXX} \ + -DCMAKE_AR=${AR} \ + -DCMAKE_RANLIB=${RANLIB} \ + -DCMAKE_SYSROOT=${SYSROOT} \ + -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ + -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ + -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE ${CFLAGS}}" \ + -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DZLIB_BUILD_EXAMPLES=OFF \ @@ -201,6 +241,7 @@ function build() { cmake --build . --target install --config Release cd .. fi + fi } # executed inside the lib src dir, first arg $1 is the dest libs dir root From 5b4b4b8ed9056b61986a71cf7057c86b7b5d0ed8 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 12:51:06 +1100 Subject: [PATCH 19/78] Cross compiler configuration and debug echo --- apothecary/formulas/tess2/tess2.sh | 2 +- apothecary/linuxaarch64_configure.sh | 5 +++++ apothecary/linuxarmv6l_configure.sh | 5 +++++ apothecary/linuxarmv7l_configure.sh | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apothecary/formulas/tess2/tess2.sh b/apothecary/formulas/tess2/tess2.sh index 12bca6f60..5805cbc48 100644 --- a/apothecary/formulas/tess2/tess2.sh +++ b/apothecary/formulas/tess2/tess2.sh @@ -217,7 +217,7 @@ function build() { -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ - -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE ${CFLAGS}}" \ + -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 3f08b3767..9fb7dd083 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -53,6 +53,11 @@ export LDFLAGS="--sysroot=${SYSROOT} \ export HOST="${GCC_PREFIX}" # Debugging output +echo "--------------------" +echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Toolchain Path: $RASP" echo "GCC Path: $GCCPATH" +echo "LDFLAGS : $LDFLAGS" +echo "CFLAGS : $CFLAGS" +echo "--------------------" \ No newline at end of file diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 2fc313379..1218380bb 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -37,6 +37,11 @@ export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L$SYSROOT/usr/lib/arm-l # Host system for cross-compilation export HOST="${GCC_PREFIX}" +echo "--------------------" +echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Toolchain Path: $RASP" echo "GCC Path: $GCCPATH" +echo "LDFLAGS : $LDFLAGS" +echo "CFLAGS : $CFLAGS" +echo "--------------------" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index d400c15a5..392b34fcc 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -53,6 +53,11 @@ export LDFLAGS="--sysroot=${SYSROOT} \ export HOST="${GCC_PREFIX}" # Debugging output +echo "--------------------" +echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Toolchain Path: $RASP" echo "GCC Path: $GCCPATH" +echo "LDFLAGS : $LDFLAGS" +echo "CFLAGS : $CFLAGS" +echo "--------------------" From 265adf0fc41488bf4390cba29d786654646cb537 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 13:07:36 +1100 Subject: [PATCH 20/78] Cross compiler fix LD --- apothecary/formulas/zlib/zlib.sh | 1 - apothecary/linuxaarch64_configure.sh | 22 ++++++++++++---------- apothecary/linuxarmv6l_configure.sh | 14 +++++++------- apothecary/linuxarmv7l_configure.sh | 14 +++++++------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/apothecary/formulas/zlib/zlib.sh b/apothecary/formulas/zlib/zlib.sh index 5b08b2f21..ce743aac3 100644 --- a/apothecary/formulas/zlib/zlib.sh +++ b/apothecary/formulas/zlib/zlib.sh @@ -241,7 +241,6 @@ function build() { cmake --build . --target install --config Release cd .. fi - fi } # executed inside the lib src dir, first arg $1 is the dest libs dir root diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 9fb7dd083..31bb94e92 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -13,13 +13,13 @@ export GCC_PREFIX="aarch64-linux-gnu" export GCC_VERSION="14.2.0" # Adjust as needed # Define cross-compilation tools -export AR="${GCC_PREFIX}-gcc-ar" -export CC="${GCC_PREFIX}-gcc" -export CXX="${GCC_PREFIX}-g++" -export CPP="${GCC_PREFIX}-cpp" -export FC="${GCC_PREFIX}-gfortran" -export RANLIB="${GCC_PREFIX}-gcc-ranlib" -export LD="$CXX" +export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" +export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" +export CPP="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-cpp" +export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" +export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" +export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" +export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" @@ -38,14 +38,16 @@ export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ -I$SYSROOT/opt/vc/include \ -I$SYSROOT/opt/vc/include/IL \ + -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ + -D_FILE_OFFSET_BITS=64 \ -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" # Linker flags for ARM64 export LDFLAGS="--sysroot=${SYSROOT} \ -L${SYSROOT}/usr/lib/${GCC_PREFIX} \ - -L${SYSROOT}/usr/lib/aarch64-linux-gnu \ - -L${TOOLCHAIN_ROOT}/aarch64-linux-gnu/lib64 \ - -L${TOOLCHAIN_ROOT}/aarch64-linux-gnu/libc/lib64 \ + -L${SYSROOT}/usr/lib/${GCC_PREFIX} \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} \ -L${SYSROOT}/lib/${GCC_PREFIX}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 1218380bb..44382fa42 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -12,13 +12,13 @@ export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed # Define cross-compilation tools -export AR="${GCC_PREFIX}-gcc-ar" -export CC="${GCC_PREFIX}-gcc" -export CXX="${GCC_PREFIX}-g++" -export CPP="${GCC_PREFIX}-cpp" -export FC="${GCC_PREFIX}-gfortran" -export RANLIB="${GCC_PREFIX}-gcc-ranlib" -export LD="$CXX" +export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" +export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" +export CPP="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-cpp" +export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" +export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" +export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" +export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 392b34fcc..66379a5c1 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -12,13 +12,13 @@ export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed # Define cross-compilation tools -export AR="${GCC_PREFIX}-gcc-ar" -export CC="${GCC_PREFIX}-gcc" -export CXX="${GCC_PREFIX}-g++" -export CPP="${GCC_PREFIX}-cpp" -export FC="${GCC_PREFIX}-gfortran" -export RANLIB="${GCC_PREFIX}-gcc-ranlib" -export LD="$CXX" +export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" +export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" +export CPP="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-cpp" +export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" +export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" +export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" +export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" From 579a99e5606e77d37e35bf3dbd74c1772eae2338 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 13:24:19 +1100 Subject: [PATCH 21/78] Cross compiler LD flags --- apothecary/formulas/tess2/tess2.sh | 3 ++- apothecary/linuxaarch64_configure.sh | 9 ++++++--- apothecary/linuxarmv6l_configure.sh | 9 +++++---- apothecary/linuxarmv7l_configure.sh | 8 +++++--- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/apothecary/formulas/tess2/tess2.sh b/apothecary/formulas/tess2/tess2.sh index 5805cbc48..54d0ea8a7 100644 --- a/apothecary/formulas/tess2/tess2.sh +++ b/apothecary/formulas/tess2/tess2.sh @@ -211,6 +211,7 @@ function build() { -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_AR=${AR} \ -DCMAKE_RANLIB=${RANLIB} \ + -DCMAKE_LD=${LD} \ -DCMAKE_SYSROOT=${SYSROOT} \ -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ @@ -218,7 +219,7 @@ function build() { -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ - -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ + -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} -L${LIBRARY_PATH} ${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DZLIB_BUILD_EXAMPLES=OFF \ diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 31bb94e92..20ffff29f 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -4,14 +4,15 @@ export RPI_ROOT=$SYSROOT RASP="$RPI_ROOT/raspbian" -# Update PATH and library paths -export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib # Set GCC cross-compilation variables export GCC_PREFIX="aarch64-linux-gnu" export GCC_VERSION="14.2.0" # Adjust as needed +# Update PATH and library paths +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} +export PATH=$RASP/bin:$PATH + # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" @@ -58,8 +59,10 @@ export HOST="${GCC_PREFIX}" echo "--------------------" echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" +echo "Library Path: $LIBRARY_PATH" echo "Toolchain Path: $RASP" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" echo "CFLAGS : $CFLAGS" +echo "Path: $PATH" echo "--------------------" \ No newline at end of file diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 44382fa42..d90fd7ad4 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -3,14 +3,13 @@ export RPI_ROOT=$SYSROOT # Set Raspbian toolchain directory RASP="$RPI_ROOT/raspbianpi3ab45" -# Update PATH and library paths -export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib - # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} +export PATH=$RASP/bin:$PATH + # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" @@ -40,8 +39,10 @@ export HOST="${GCC_PREFIX}" echo "--------------------" echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" +echo "Library Path: $LIBRARY_PATH" echo "Toolchain Path: $RASP" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" echo "CFLAGS : $CFLAGS" +echo "Path: $PATH" echo "--------------------" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 66379a5c1..1ec520a8d 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -3,14 +3,14 @@ export RPI_ROOT=$SYSROOT # Set Raspbian toolchain directory RASP="$RPI_ROOT/raspbianpi3ab45" -# Update PATH and library paths -export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} +export PATH=$RASP/bin:$PATH + # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" @@ -56,8 +56,10 @@ export HOST="${GCC_PREFIX}" echo "--------------------" echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" +echo "Library Path: $LIBRARY_PATH" echo "Toolchain Path: $RASP" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" echo "CFLAGS : $CFLAGS" +echo "Path: $PATH" echo "--------------------" From 365641dd322ca3b1ec6bd04da623eab71add6382 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 13:41:24 +1100 Subject: [PATCH 22/78] GLEW VS arm64/arm64ec fixes exe flags --- apothecary/apothecary | 2 + apothecary/formulas/glew/glew.sh | 97 ++++++++++++++++++++++++++------ 2 files changed, 83 insertions(+), 16 deletions(-) diff --git a/apothecary/apothecary b/apothecary/apothecary index 97d286025..d6b67bc04 100755 --- a/apothecary/apothecary +++ b/apothecary/apothecary @@ -640,6 +640,7 @@ if [ "$TYPE" = "vs" ]; then export EXCEPTION_FLAGS="" export FLAGS_RELEASE="-O3 -DUNICODE -D_UNICODE" export FLAGS_DEBUG="-O0 -DUNICODE -D_UNICODE" + export EXE_FLAGS="" else if [ $ARCH == "arm64ec" ]; then export VS_C_FLAGS="/Gy /GL- /guard:cf" @@ -649,6 +650,7 @@ if [ "$TYPE" = "vs" ]; then export FLAGS_RELEASE="${MT_TYPE} ${CALLING_CONVENTION} /O2 /DNDEBUG -DUNICODE -D_UNICODE" export FLAGS_DEBUG="${MT_TYPE}d ${CALLING_CONVENTION} /Od /DDEBUG -DUNICODE -D_UNICODE" export EXCEPTION_FLAGS="/EHsc" + export EXE_FLAGS="/NODEFAULTLIB:libvcruntime.lib /DEFAULTLIB:ucrt.lib /DEFAULTLIB:msvcrt.lib" fi VS_BAT="vcvarsall.bat" diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index 526eb6a69..aa19139fb 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -8,7 +8,7 @@ # use "make glew.lib" to build only the lib without demos/tests # the OPT flag is used for CFLAGS (& LDFLAGS I think?) -FORMULA_TYPES=( "osx" "vs" ) +FORMULA_TYPES=( "osx" "vs" "linux64" "linuxaarch64" "linuxarmv6l" "linuxarmv7l" ) FORMULA_DEPENDS=( ) # define the version @@ -47,6 +47,9 @@ function prepare() { # executed inside the lib src dir function build() { + DEFINES="-DGLEW_X11=ON \ + -DGLEW_EGL=OFF \ + -DBUILD_UTILS=OFF" if [[ "$TYPE" =~ ^(osx|ios|tvos|xros|catos|watchos)$ ]]; then @@ -56,6 +59,7 @@ function build() { cd "build_${TYPE}_${PLATFORM}" rm -f CMakeCache.txt *.a *.o cmake ../build/cmake \ + ${DEFINES} \ -DCMAKE_C_STANDARD=${C_STANDARD} \ -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ @@ -72,9 +76,6 @@ function build() { -DENABLE_ARC=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DENABLE_VISIBILITY=OFF \ - -DGLEW_X11=ON \ - -DGLEW_EGL=OFF \ - -DBUILD_UTILS=OFF \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ @@ -86,42 +87,106 @@ function build() { echo "building $TYPE | $ARCH | $VS_VER | vs: $VS_VER_GEN C_FLAGS: ${VS_C_FLAGS} CONVENTION: ${CALLING_CONVENTION} SDK:${CMAKE_WIN_SDK}" echo "--------------------" GENERATOR_NAME="Visual Studio ${VS_VER_GEN}" - - mkdir -p "build_${TYPE}_${ARCH}" cd "build_${TYPE}_${ARCH}" - - rm -f CMakeCache.txt *.lib *.o - DEFS="-DLIBRARY_SUFFIX=${ARCH}" - - cmake ../build/cmake ${DEFS} \ + rm -f CMakeCache.txt *.lib *.o + cmake ../build/cmake \ + -DLIBRARY_SUFFIX=${ARCH} \ + ${DEFINES} \ -DCMAKE_C_STANDARD=${C_STANDARD} \ -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_C_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS} ${CALLING_CONVENTION}" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS} ${CALLING_CONVENTION}" \ + -DCMAKE_EXE_LINKER_FLAGS="${EXE_FLAGS}" \ -DCMAKE_CXX_EXTENSIONS=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_BUILD_TYPE=Release \ - -DGLEW_X11=ON \ - -DGLEW_EGL=OFF \ - -DBUILD_UTILS=OFF \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ -DCMAKE_INSTALL_INCLUDEDIR=include \ ${CMAKE_WIN_SDK} \ -A "${PLATFORM}" \ - -G "${GENERATOR_NAME}" - + -G "${GENERATOR_NAME}" cmake --build . --config Release --target install cd .. elif [ "$TYPE" == "msys2" ] ; then make clean make + elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] || [ "$TYPE" == "msys2" ]; then + echoVerbose "building $TYPE | $ARCH " + echoVerbose "--------------------" + mkdir -p "build_${TYPE}_${ARCH}" + cd "build_${TYPE}_${ARCH}" + rm -f CMakeCache.txt *.a *.o *.so + DEFINES="${DEFINES} -DLIBRARY_SUFFIX=${ARCH} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_STANDARD=${C_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF + -DBUILD_SHARED_LIBS=OFF" + cmake .. ${DEFINES} \ + -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_SYSTEM_NAME=$TYPE \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DENABLE_VISIBILITY=OFF \ + -DCMAKE_INSTALL_INCLUDEDIR=include + cmake --build . --target install --config Release + cd .. + elif [ "$TYPE" == "linuxaarch64" ] || [ "$TYPE" == "linuxarmv6l" ] || [ "$TYPE" == "linuxarmv7l" ] ; then + if [ $CROSSCOMPILING -eq 1 ]; then + source ../../${TYPE}_configure.sh + fi + echoVerbose "building $TYPE | $ARCH " + echoVerbose "--------------------" + mkdir -p "build_${TYPE}_${ARCH}" + cd "build_${TYPE}_${ARCH}" + rm -f CMakeCache.txt *.a *.o *.so + DEFINES="${DEFINES} -DLIBRARY_SUFFIX=${ARCH} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_STANDARD=${C_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF + -DBUILD_SHARED_LIBS=OFF" + cmake .. ${DEFINES} \ + -DCMAKE_C_COMPILER=${CC} \ + -DCMAKE_CXX_COMPILER=${CXX} \ + -DCMAKE_AR=${AR} \ + -DCMAKE_RANLIB=${RANLIB} \ + -DCMAKE_SYSROOT=${SYSROOT} \ + -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ + -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ + -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ + -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ + -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ + -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE ${CFLAGS}}" \ + -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_SYSTEM_NAME=$TYPE \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DENABLE_VISIBILITY=OFF \ + -DCMAKE_INSTALL_INCLUDEDIR=include + cmake --build . --target install --config Release + cd .. fi + } # executed inside the lib src dir, first arg $1 is the dest libs dir root From ef2ce2f845c0dc025efd3f8e5c67b50c8e20d957 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 13:44:51 +1100 Subject: [PATCH 23/78] Glew --- apothecary/formulas/glew/glew.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index aa19139fb..014119f7b 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -171,7 +171,7 @@ function build() { -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ - -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE ${CFLAGS}}" \ + -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ @@ -203,6 +203,12 @@ function copy() { cp -v -r build_${TYPE}_${PLATFORM}/Release/lib/libGLEW.a $1/lib/$TYPE/$PLATFORM/libGLEW.a . "$SECURE_SCRIPT" secure $1/lib/$TYPE/$PLATFORM/libGLEW.a glew.pkl + elif [[ "$TYPE" =~ ^(linuxaarch64|linuxarmv6l|linuxarmv7l)$ ]]; then + mkdir -p $1/lib/$TYPE/$PLATFORM/ + cp -v -r build_${TYPE}_${PLATFORM}/Release/include/* $1/include + cp -v -r build_${TYPE}_${PLATFORM}/Release/lib/libGLEW.a $1/lib/$TYPE/$PLATFORM/libGLEW.a + . "$SECURE_SCRIPT" + secure $1/lib/$TYPE/$PLATFORM/libGLEW.a glew.pkl elif [ "$TYPE" == "vs" ] ; then cp -Rv "build_${TYPE}_${ARCH}/Release/include/" $1/ mkdir -p $1/lib/$TYPE/$PLATFORM/ From b38e848578dd0ecab2532b9fbccaf043fe58ecfe Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 13:47:48 +1100 Subject: [PATCH 24/78] Glew linux --- apothecary/formulas/glew/glew.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index 014119f7b..bf17b9366 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -129,7 +129,8 @@ function build() { -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_SHARED_LIBS=OFF" - cmake .. ${DEFINES} \ + cmake ../build/cmake \ + ${DEFINES} \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_BUILD_TYPE=Release \ @@ -148,10 +149,12 @@ function build() { if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh fi - echoVerbose "building $TYPE | $ARCH " - echoVerbose "--------------------" - mkdir -p "build_${TYPE}_${ARCH}" - cd "build_${TYPE}_${ARCH}" + echo "building $TYPE | $PLATFORM" + echo "--------------------" + mkdir -p "build_${TYPE}_${PLATFORM}" + cd "build_${TYPE}_${PLATFORM}" + rm -f CMakeCache.txt *.a *.o + rm -f CMakeCache.txt *.a *.o *.so DEFINES="${DEFINES} -DLIBRARY_SUFFIX=${ARCH} \ -DCMAKE_BUILD_TYPE=Release \ @@ -160,7 +163,8 @@ function build() { -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_EXTENSIONS=OFF -DBUILD_SHARED_LIBS=OFF" - cmake .. ${DEFINES} \ + cmake ../build/cmake \ + ${DEFINES} \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_AR=${AR} \ @@ -203,7 +207,7 @@ function copy() { cp -v -r build_${TYPE}_${PLATFORM}/Release/lib/libGLEW.a $1/lib/$TYPE/$PLATFORM/libGLEW.a . "$SECURE_SCRIPT" secure $1/lib/$TYPE/$PLATFORM/libGLEW.a glew.pkl - elif [[ "$TYPE" =~ ^(linuxaarch64|linuxarmv6l|linuxarmv7l)$ ]]; then + elif [[ "$TYPE" =~ ^(linuxaarch64|linuxarmv6l|linuxarmv7l|linux64|linux)$ ]]; then mkdir -p $1/lib/$TYPE/$PLATFORM/ cp -v -r build_${TYPE}_${PLATFORM}/Release/include/* $1/include cp -v -r build_${TYPE}_${PLATFORM}/Release/lib/libGLEW.a $1/lib/$TYPE/$PLATFORM/libGLEW.a From 030e04b66e4246c3f0d389905e7e73508c962701 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 14:10:04 +1100 Subject: [PATCH 25/78] Cross configure --- apothecary/linuxaarch64_configure.sh | 3 ++- apothecary/linuxarmv6l_configure.sh | 4 ++-- apothecary/linuxarmv7l_configure.sh | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 20ffff29f..97d50404e 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -10,7 +10,7 @@ export GCC_PREFIX="aarch64-linux-gnu" export GCC_VERSION="14.2.0" # Adjust as needed # Update PATH and library paths -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 export PATH=$RASP/bin:$PATH # Define cross-compilation tools @@ -49,6 +49,7 @@ export LDFLAGS="--sysroot=${SYSROOT} \ -L${SYSROOT}/usr/lib/${GCC_PREFIX} \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} \ -L${SYSROOT}/lib/${GCC_PREFIX}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index d90fd7ad4..6fd37cadc 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -7,7 +7,7 @@ RASP="$RPI_ROOT/raspbianpi3ab45" export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib export PATH=$RASP/bin:$PATH # Define cross-compilation tools @@ -31,7 +31,7 @@ export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/shar export CFLAGS="--sysroot=${SYSROOT} -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include -I$SYSROOT/opt/vc/include/IL -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -I$SYSROOT/opt/vc/lib -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" # Linker flags for cross-compilation -export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -lm" +export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -lm" # Host system for cross-compilation export HOST="${GCC_PREFIX}" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 1ec520a8d..9683d226b 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -8,7 +8,7 @@ RASP="$RPI_ROOT/raspbianpi3ab45" export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib export PATH=$RASP/bin:$PATH # Define cross-compilation tools @@ -47,6 +47,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ export LDFLAGS="--sysroot=${SYSROOT} \ -L$SYSROOT/usr/lib \ -L$SYSROOT/usr/lib/arm-linux-gnueabihf \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L$SYSROOT/opt/vc/lib/" # Host system for cross-compilation From d9f70a3e24b1d9299dd1d21d0c69fb2e0d366619 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 14:29:47 +1100 Subject: [PATCH 26/78] Cross --- apothecary/linuxaarch64_configure.sh | 14 +++----------- apothecary/linuxarmv6l_configure.sh | 8 ++++++-- apothecary/linuxarmv7l_configure.sh | 14 ++++---------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 97d50404e..f5c3d7104 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -11,13 +11,14 @@ export GCC_VERSION="14.2.0" # Adjust as needed # Update PATH and library paths export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 -export PATH=$RASP/bin:$PATH +export PATH=$RASP/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" export CPP="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-cpp" export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" +export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" @@ -29,29 +30,20 @@ export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" # GStreamer version for dependencies export GST_VERSION="1.0" - -# Package configuration path -export PKG_CONFIG_PATH="$SYSROOT/usr/lib/pkgconfig:$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig" - # Compiler flags for ARM64 export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -I$SYSROOT/opt/vc/include \ - -I$SYSROOT/opt/vc/include/IL \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 \ -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" # Linker flags for ARM64 export LDFLAGS="--sysroot=${SYSROOT} \ - -L${SYSROOT}/usr/lib/${GCC_PREFIX} \ - -L${SYSROOT}/usr/lib/${GCC_PREFIX} \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ - -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION} \ - -L${SYSROOT}/lib/${GCC_PREFIX}" + -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}" # Host system for cross-compilation export HOST="${GCC_PREFIX}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 6fd37cadc..58711f394 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -8,13 +8,14 @@ export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib -export PATH=$RASP/bin:$PATH +export PATH=$RASP/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" export CPP="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-cpp" export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" +export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" @@ -28,7 +29,10 @@ export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig" # Compiler flags for cross-compilation -export CFLAGS="--sysroot=${SYSROOT} -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include -I$SYSROOT/opt/vc/include/IL -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -I$SYSROOT/opt/vc/lib -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" +export CFLAGS="--sysroot=${SYSROOT} \ + -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ + -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ + -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" # Linker flags for cross-compilation export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -lm" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 9683d226b..e440a2b54 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -9,13 +9,14 @@ export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib -export PATH=$RASP/bin:$PATH +export PATH=$RASP/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" export CXX="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-g++" export CPP="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-cpp" export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" +export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" @@ -25,17 +26,10 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" -# Package configuration path -export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig" - # Compiler flags for ARMv7 export CFLAGS="--sysroot=${SYSROOT} \ - -I$SYSROOT/usr/include \ - -I$SYSROOT/opt/vc/include \ - -I$SYSROOT/opt/vc/include/IL \ - -I$SYSROOT/opt/vc/include/interface/vcos/pthreads \ - -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux \ - -I$SYSROOT/opt/vc/lib \ + -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ + -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ -march=armv7-a -mfpu=vfp -mfloat-abi=hard \ -fPIC -ftree-vectorize -Wno-psabi -pipe \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ From 5c4783b59b2d0b0c76b970fafd516de5b9f579fd Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 1 Jan 2025 14:58:56 +1100 Subject: [PATCH 27/78] Cross compiler --- apothecary/linuxaarch64_configure.sh | 6 ++++-- apothecary/linuxarmv6l_configure.sh | 6 ++++-- apothecary/linuxarmv7l_configure.sh | 6 ++++-- scripts/linuxaarch64/install_and_build.sh | 9 +++++++-- scripts/linuxarmv6l/install_and_build.sh | 19 +++++++++++++++++-- scripts/linuxarmv7l/install_and_build.sh | 12 +++++++++--- 6 files changed, 45 insertions(+), 13 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index f5c3d7104..b67adbdcc 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -2,7 +2,7 @@ # Set Raspbian toolchain directory export RPI_ROOT=$SYSROOT -RASP="$RPI_ROOT/raspbian" +RASP="$RPI_ROOT" # Set GCC cross-compilation variables @@ -11,6 +11,7 @@ export GCC_VERSION="14.2.0" # Adjust as needed # Update PATH and library paths export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 +export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools @@ -21,7 +22,8 @@ export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" -export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" +# export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" +export LD="$CXX" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 58711f394..9967a52ab 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -1,13 +1,14 @@ # Set the root directory export RPI_ROOT=$SYSROOT # Set Raspbian toolchain directory -RASP="$RPI_ROOT/raspbianpi3ab45" +RASP="$RPI_ROOT" # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib +export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools @@ -18,7 +19,8 @@ export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" -export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" +# export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" +export LD="$CXX" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index e440a2b54..9c03fd585 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -1,7 +1,7 @@ # Set the root directory export RPI_ROOT=$SYSROOT # Set Raspbian toolchain directory -RASP="$RPI_ROOT/raspbianpi3ab45" +RASP="$RPI_ROOT" # Set GCC cross-compilation variables @@ -9,6 +9,7 @@ export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib +export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools @@ -19,7 +20,8 @@ export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" -export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" +# export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" +export LD="$CXX" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 1ba34fbe4..d2e4070d3 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -11,8 +11,9 @@ trapError() { exit 1 } -sudo apt-get install -y aptitude +sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet sudo aptitude install -y gperf +wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/master/utils/SSymlinker ROOT=/home/runner/work/apothecary/apothecary echo $ROOT @@ -20,7 +21,7 @@ cd $ROOT RASP="$ROOT/raspbian" PATH=$RASP/bin:$PATH -LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$RASP/lib export GCC_PREFIX=aarch64-linux-gnu export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/aarch64-linux-gnu/*/ @@ -37,6 +38,10 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" +echo 'export PATH=$PATH' >> .bashrc +echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc +source .bashrc + #echo "ROOT dir " #ls -la $ROOT # diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index a50ab880e..6d4b7dfd1 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -11,8 +11,9 @@ trapError() { exit 1 } -sudo apt-get install -y aptitude +sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet sudo aptitude install -y gperf +wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/master/utils/SSymlinker ROOT=/home/runner/work/apothecary/apothecary echo $ROOT @@ -20,7 +21,7 @@ cd $ROOT RASP="$ROOT/raspbianpi1zero" PATH=$RASP/bin:$PATH -LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH +LD_LIBRARY_PATH=$RASP/lib export GCC_PREFIX=arm-linux-gnueabihf export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/arm-linux-gnueabihf/*/ @@ -37,6 +38,20 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" +# sudo chmod +x SSymlinker +# ./SSymlinker -s /usr/include/${GCC_PREFIX}/asm -d /usr/include +# ./SSymlinker -s /usr/include/${GCC_PREFIX}/gnu -d /usr/include +# ./SSymlinker -s /usr/include/${GCC_PREFIX}/bits -d /usr/include +# ./SSymlinker -s /usr/include/${GCC_PREFIX}/sys -d /usr/include +# ./SSymlinker -s /usr/include/${GCC_PREFIX}/openssl -d /usr/include +# ./SSymlinker -s /usr/lib/${GCC_PREFIX}/crtn.o -d /usr/lib/crtn.o +# ./SSymlinker -s /usr/lib/${GCC_PREFIX}/crt1.o -d /usr/lib/crt1.o +# ./SSymlinker -s /usr/lib/${GCC_PREFIX}/crti.o -d /usr/lib/crti.o + +echo 'export PATH=$PATH' >> .bashrc +echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc +source .bashrc + #echo "ROOT dir " #ls -la $ROOT # diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index 5b7ba2541..cc57c176f 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -11,16 +11,18 @@ trapError() { exit 1 } -sudo apt-get install -y aptitude +sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet sudo aptitude install -y gperf +wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/master/utils/SSymlinker + ROOT=/home/runner/work/apothecary/apothecary echo $ROOT cd $ROOT RASP="$ROOT/raspbianpi3ab45" -PATH=$RASP/bin:$PATH -LD_LIBRARY_PATH=$RASP/lib:$LD_LIBRARY_PATH +export PATH=$RASP/bin:$PATH +export LD_LIBRARY_PATH=$RASP/lib export GCC_PREFIX=arm-linux-gnueabihf export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/arm-linux-gnueabihf/*/ @@ -37,6 +39,10 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" +echo 'export PATH=$PATH' >> .bashrc +echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc +source .bashrc + #echo "ROOT dir " #ls -la $ROOT # From d205a6dc6f77a2a6e9688e55ba3de280a00ac8ef Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 00:51:08 +1100 Subject: [PATCH 28/78] Linux arm toolchains --- apothecary/formulas/glew/glew.sh | 2 + apothecary/linuxaarch64_configure.sh | 2 +- apothecary/linuxarmv6l_configure.sh | 2 +- apothecary/linuxarmv7l_configure.sh | 2 +- .../linuxaarch64-clang.toolchain.cmake | 47 +++++++++++++++++++ .../linuxarmv6l-clang.toolchain.cmake | 44 +++++++++++++++++ .../linuxarmv7l-clang.toolchain.cmake | 44 +++++++++++++++++ 7 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 apothecary/toolchains/linuxaarch64-clang.toolchain.cmake create mode 100644 apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake create mode 100644 apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index bf17b9366..07ac16295 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -171,12 +171,14 @@ function build() { -DCMAKE_RANLIB=${RANLIB} \ -DCMAKE_SYSROOT=${SYSROOT} \ -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ + -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}-clang.toolchain.cmake \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ + -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_SYSTEM_NAME=$TYPE \ diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index b67adbdcc..ab8cf6d14 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -38,7 +38,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 \ - -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" + -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -mfpu=neon" # Linker flags for ARM64 export LDFLAGS="--sysroot=${SYSROOT} \ diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 9967a52ab..5c50b7b26 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -34,7 +34,7 @@ export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/shar export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" + -march=armv6 -mfpu=neon -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" # Linker flags for cross-compilation export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -lm" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 9c03fd585..884f83f45 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -32,7 +32,7 @@ export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -march=armv7-a -mfpu=vfp -mfloat-abi=hard \ + -march=armv7-a -mfpu=neon -mfpu=vfp -mfloat-abi=hard \ -fPIC -ftree-vectorize -Wno-psabi -pipe \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \ diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake new file mode 100644 index 000000000..dba038a70 --- /dev/null +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -0,0 +1,47 @@ +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) + +set(CMAKE_SYSTEM_PROCESSOR aarch64) +set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) +set(GCC_VERSION 14.2.0) + +set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) +set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) + +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ + -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ + -L${CMAKE_SYSROOT}/lib \ + -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib64") +## set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") +## Compiler Binary +SET(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu) + +SET (CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) +SET (CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) +SET (CMAKE_LINKER ${BIN_PREFIX}-ld + CACHE STRING "Set the cross-compiler tool LD" FORCE) +SET (CMAKE_AR ${BIN_PREFIX}-ar + CACHE STRING "Set the cross-compiler tool AR" FORCE) +SET (CMAKE_NM {BIN_PREFIX}-nm + CACHE STRING "Set the cross-compiler tool NM" FORCE) +SET (CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy + CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +SET (CMAKE_OBJDUMP ${BIN_PREFIX}-objdump + CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +SET (CMAKE_RANLIB ${BIN_PREFIX}-ranlib + CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +SET (CMAKE_STRIP {BIN_PREFIX}-strip + CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake new file mode 100644 index 000000000..8f2f86020 --- /dev/null +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -0,0 +1,44 @@ +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) + +# Change to ARMv6 +set(CMAKE_SYSTEM_PROCESSOR armv6) +set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) +set(GCC_VERSION 14.2.0) + +set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) +set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) + +# Update linker flags for ARMv7 +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ + -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${CMAKE_SYSROOT}/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib \ + -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") + +# Update compiler flags for ARMv7 +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfpu=neon -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfpu=neon -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") + +# Compiler Binary +set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) + +set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) +set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++) +set(CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) +set(CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) +set(CMAKE_NM ${BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) +set(CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake new file mode 100644 index 000000000..e052b933e --- /dev/null +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -0,0 +1,44 @@ +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) + +# Change to ARMv7 +set(CMAKE_SYSTEM_PROCESSOR armv7) +set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) +set(GCC_VERSION 14.2.0) + +set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) +set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) + +# Update linker flags for ARMv7 +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ + -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${CMAKE_SYSROOT}/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib \ + -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") + +# Update compiler flags for ARMv7 +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") + +# Compiler Binary +set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) + +set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) +set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++) +set(CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) +set(CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) +set(CMAKE_NM ${BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) +set(CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) From 5055977d32a32f28bb976866ec10cfea8a8a3130 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 00:55:53 +1100 Subject: [PATCH 29/78] Fix backslash in paths --- .../toolchains/linuxaarch64-clang.toolchain.cmake | 14 ++++++++------ .../toolchains/linuxarmv6l-clang.toolchain.cmake | 12 ++++++------ .../toolchains/linuxarmv7l-clang.toolchain.cmake | 12 ++++++------ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index dba038a70..7aca6ba11 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -13,15 +13,17 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib64") + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") ## set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib64 \ +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib64 \ + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") + ## Compiler Binary SET(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index 8f2f86020..73be26d38 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -14,17 +14,17 @@ set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") # Update compiler flags for ARMv7 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfpu=neon -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfpu=neon -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index e052b933e..cf6c97d87 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -14,17 +14,17 @@ set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") # Update compiler flags for ARMv7 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}\libc\usr\lib") + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) From 616ca8c0f5e8a5e6a52d33fac99db2967673d5c3 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:03:00 +1100 Subject: [PATCH 30/78] Toolchain root --- apothecary/formulas/glew/glew.sh | 1 + apothecary/toolchains/linuxaarch64-clang.toolchain.cmake | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index 07ac16295..bff95bac5 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -171,6 +171,7 @@ function build() { -DCMAKE_RANLIB=${RANLIB} \ -DCMAKE_SYSROOT=${SYSROOT} \ -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ + -DTOOLCHAIN_ROOT=${TOOLCHAIN_ROOT} \ -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}-clang.toolchain.cmake \ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 7aca6ba11..229c69cb7 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -15,7 +15,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") -## set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") + set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") From bcdf4b55b1035ed87dbd284ef4563e699f1f0425 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:13:44 +1100 Subject: [PATCH 31/78] Toolchain configure --- apothecary/formulas/glew/glew.sh | 4 ++-- apothecary/linuxaarch64_configure.sh | 9 +++++---- apothecary/linuxarmv6l_configure.sh | 3 ++- apothecary/linuxarmv7l_configure.sh | 5 +++-- apothecary/toolchains/linuxaarch64-clang.toolchain.cmake | 6 +++--- apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake | 4 ++-- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index bff95bac5..43ae6af87 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -153,8 +153,8 @@ function build() { echo "--------------------" mkdir -p "build_${TYPE}_${PLATFORM}" cd "build_${TYPE}_${PLATFORM}" - rm -f CMakeCache.txt *.a *.o - + + echo "TOOLCHAIN_ROOT is set to: $TOOLCHAIN_ROOT" rm -f CMakeCache.txt *.a *.o *.so DEFINES="${DEFINES} -DLIBRARY_SUFFIX=${ARCH} \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index ab8cf6d14..eb66e090f 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -10,7 +10,7 @@ export GCC_PREFIX="aarch64-linux-gnu" export GCC_VERSION="14.2.0" # Adjust as needed # Update PATH and library paths -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH @@ -27,8 +27,8 @@ export LD="$CXX" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" -export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" -export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export ARFLAGS="--plugin ${GCCPATH}/liblto_plugin.so" +export RANLIBFLAGS="--plugin ${GCCPATH}/liblto_plugin.so" # GStreamer version for dependencies export GST_VERSION="1.0" @@ -38,7 +38,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 \ - -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -mfpu=neon" + -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" # Linker flags for ARM64 export LDFLAGS="--sysroot=${SYSROOT} \ @@ -56,6 +56,7 @@ echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Library Path: $LIBRARY_PATH" echo "Toolchain Path: $RASP" +echo "Toolchain ROOT: $TOOLCHAIN_ROOT" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" echo "CFLAGS : $CFLAGS" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 5c50b7b26..b575066dd 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -7,7 +7,7 @@ RASP="$RPI_ROOT" export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH @@ -47,6 +47,7 @@ echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Library Path: $LIBRARY_PATH" echo "Toolchain Path: $RASP" +echo "Toolchain ROOT: $TOOLCHAIN_ROOT" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" echo "CFLAGS : $CFLAGS" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 884f83f45..046277d25 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -8,7 +8,7 @@ RASP="$RPI_ROOT" export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH @@ -32,7 +32,7 @@ export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -march=armv7-a -mfpu=neon -mfpu=vfp -mfloat-abi=hard \ + -march=armv7-a -mfpu=vfp -mfloat-abi=hard \ -fPIC -ftree-vectorize -Wno-psabi -pipe \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \ @@ -55,6 +55,7 @@ echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Library Path: $LIBRARY_PATH" echo "Toolchain Path: $RASP" +echo "Toolchain ROOT: $TOOLCHAIN_ROOT" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" echo "CFLAGS : $CFLAGS" diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 229c69cb7..443c0f346 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -15,12 +15,12 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") - -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ + +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -fexec-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index cf6c97d87..df88b5222 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -19,10 +19,10 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") # Update compiler flags for ARMv7 -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") From 3398d7b9829d6571be99bec7938ba668193437c6 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:25:21 +1100 Subject: [PATCH 32/78] Toolchain fixes --- .../linuxaarch64-clang.toolchain.cmake | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 443c0f346..70b6b48ac 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -9,20 +9,18 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ +set(EXTA_LINKS "-fPIC \ -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ - -L${CMAKE_SYSROOT}/lib \ - -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") - -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64") + -Wl,-rpath-link,${CMAKE_SYSROOT}/lib \ + -Wl,-rpath-link,${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ + -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ + -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") + +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTA_LINKS}") + +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 ${EXTA_LINKS}") + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 ${EXTA_LINKS}) ## Compiler Binary SET(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu) From f772b90734cd9888949d16b6288408b573e9059e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:32:38 +1100 Subject: [PATCH 33/78] Toolchain formatting --- .../linuxaarch64-clang.toolchain.cmake | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 70b6b48ac..178f10717 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.15) + set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) @@ -18,29 +20,22 @@ set(EXTA_LINKS "-fPIC \ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTA_LINKS}") -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 ${EXTA_LINKS}") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTA_LINKS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -finput-charset=UTF-8 ${EXTA_LINKS}) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTA_LINKS}) ## Compiler Binary -SET(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu) +SET(BIN_PREFIX "${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu") SET (CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) SET (CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) -SET (CMAKE_LINKER ${BIN_PREFIX}-ld - CACHE STRING "Set the cross-compiler tool LD" FORCE) -SET (CMAKE_AR ${BIN_PREFIX}-ar - CACHE STRING "Set the cross-compiler tool AR" FORCE) -SET (CMAKE_NM {BIN_PREFIX}-nm - CACHE STRING "Set the cross-compiler tool NM" FORCE) -SET (CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy - CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) -SET (CMAKE_OBJDUMP ${BIN_PREFIX}-objdump - CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) -SET (CMAKE_RANLIB ${BIN_PREFIX}-ranlib - CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) -SET (CMAKE_STRIP {BIN_PREFIX}-strip - CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +SET (CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) +SET (CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) +SET (CMAKE_NM {BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) +SET (CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +SET (CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +SET (CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +SET (CMAKE_STRIP {BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) From 75f95688de78f65e717fa80a5622d5e16a75709a Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:38:43 +1100 Subject: [PATCH 34/78] Toolchain update --- .../linuxaarch64-clang.toolchain.cmake | 39 +++++++++---------- .../linuxarmv6l-clang.toolchain.cmake | 17 ++++---- .../linuxarmv7l-clang.toolchain.cmake | 18 ++++----- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 178f10717..bc33565f4 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -11,31 +11,30 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -set(EXTA_LINKS "-fPIC \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/lib \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") +set(EXTRA_LINKS "-L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ + -L${CMAKE_SYSROOT}/lib \ + -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ + -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTA_LINKS}") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTA_LINKS}") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTA_LINKS}) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}) ## Compiler Binary -SET(BIN_PREFIX "${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu") - -SET (CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) -SET (CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) -SET (CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) -SET (CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) -SET (CMAKE_NM {BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) -SET (CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) -SET (CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) -SET (CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) -SET (CMAKE_STRIP {BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) +set(BIN_PREFIX "${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu") + +set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) +set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) +set(CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) +set(CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) +set(CMAKE_NM {BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) +SET(CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +set(CMAKE_STRIP {BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index 73be26d38..e3162d5ad 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.15) + set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) @@ -10,21 +12,18 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -# Update linker flags for ARMv7 -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ +set(EXTRA_LINKS "-L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") +# Update linker flags for ARMv7 +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") + # Update compiler flags for ARMv7 -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfpu=neon -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfpu=neon -mfloat-abi=hard -finput-charset=UTF-8 -fexec-charset=UTF-8 -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index df88b5222..f137929f7 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.15) + set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) @@ -10,21 +12,19 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -# Update linker flags for ARMv7 -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC \ - -Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ +set(EXTRA_LINKS "-L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") + +# Update linker flags for ARMv7 +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") + # Update compiler flags for ARMv7 -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard -rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) From 1472cc800b6f324a6f9b52e645f52d64f4268eaa Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:52:37 +1100 Subject: [PATCH 35/78] Toolchain fixes and symlinks for install --- .../linuxaarch64-clang.toolchain.cmake | 4 +-- scripts/linuxaarch64/install_and_build.sh | 15 +++++++++++ scripts/linuxarmv6l/install_and_build.sh | 26 ++++++++++++------- scripts/linuxarmv7l/install_and_build.sh | 17 +++++++++++- 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index bc33565f4..3c093a6a4 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -21,7 +21,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") ## Compiler Binary set(BIN_PREFIX "${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu") @@ -34,7 +34,7 @@ set(CMAKE_NM {BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE SET(CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) -set(CMAKE_STRIP {BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) +set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index d2e4070d3..090f23377 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -38,6 +38,21 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export LIBC_USR=${RASP}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/ +export CRT=${LIBC_USR}/lib64 + +sudo chmod +x SSymlinker +./SSymlinker -s ${LIBC_USR}/include/asm -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/gnu -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/bits -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/sys -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include +./SSymlinker -s ${LIBC_USR}/include -d /usr/include +./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o +./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o +./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o + echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc source .bashrc diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index 6d4b7dfd1..b16a60b96 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -21,11 +21,12 @@ cd $ROOT RASP="$ROOT/raspbianpi1zero" PATH=$RASP/bin:$PATH -LD_LIBRARY_PATH=$RASP/lib export GCC_PREFIX=arm-linux-gnueabihf export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/arm-linux-gnueabihf/*/ +LD_LIBRARY_PATH=${RASP}/${GCC_PREFIX}/libc/usr/lib:${RASP}/${GCC_PREFIX}/libc/lib:${RASP}/lib + export AR="${GCC_PREFIX}-gcc-ar" export CC="${GCC_PREFIX}-gcc" export CXX="${GCC_PREFIX}-g++" @@ -38,15 +39,20 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" -# sudo chmod +x SSymlinker -# ./SSymlinker -s /usr/include/${GCC_PREFIX}/asm -d /usr/include -# ./SSymlinker -s /usr/include/${GCC_PREFIX}/gnu -d /usr/include -# ./SSymlinker -s /usr/include/${GCC_PREFIX}/bits -d /usr/include -# ./SSymlinker -s /usr/include/${GCC_PREFIX}/sys -d /usr/include -# ./SSymlinker -s /usr/include/${GCC_PREFIX}/openssl -d /usr/include -# ./SSymlinker -s /usr/lib/${GCC_PREFIX}/crtn.o -d /usr/lib/crtn.o -# ./SSymlinker -s /usr/lib/${GCC_PREFIX}/crt1.o -d /usr/lib/crt1.o -# ./SSymlinker -s /usr/lib/${GCC_PREFIX}/crti.o -d /usr/lib/crti.o +export LIBC_USR=${RASP}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/ +export CRT=${LIBC_USR}/lib + +sudo chmod +x SSymlinker +./SSymlinker -s ${LIBC_USR}/include/asm -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/gnu -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/bits -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/sys -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include +./SSymlinker -s ${LIBC_USR}/include -d /usr/include +./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o +./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o +./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index cc57c176f..179d46157 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -22,10 +22,10 @@ cd $ROOT RASP="$ROOT/raspbianpi3ab45" export PATH=$RASP/bin:$PATH -export LD_LIBRARY_PATH=$RASP/lib export GCC_PREFIX=arm-linux-gnueabihf export GCC_VERSION="14.2.0" # UPDATE THIS AS NEEDED /libexec/gcc/arm-linux-gnueabihf/*/ +LD_LIBRARY_PATH=${RASP}/${GCC_PREFIX}/libc/usr/lib:${RASP}/${GCC_PREFIX}/libc/lib:${RASP}/lib export AR="${GCC_PREFIX}-gcc-ar" export CC="${GCC_PREFIX}-gcc" @@ -39,6 +39,21 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" +export LIBC_USR=${RASP}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/ +export CRT=${LIBC_USR}/lib64 + +sudo chmod +x SSymlinker +./SSymlinker -s ${LIBC_USR}/include/asm -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/gnu -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/bits -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/sys -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include +./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include +./SSymlinker -s ${LIBC_USR}/include -d /usr/include +./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o +./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o +./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o + echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc source .bashrc From 678c7096bb7868f6f297b720263d9092980ec60c Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 01:56:58 +1100 Subject: [PATCH 36/78] GCC prefix --- scripts/linuxaarch64/install_and_build.sh | 4 ++-- scripts/linuxarmv6l/install_and_build.sh | 4 ++-- scripts/linuxarmv7l/install_and_build.sh | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 090f23377..ddff14d69 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -18,7 +18,7 @@ wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/m ROOT=/home/runner/work/apothecary/apothecary echo $ROOT cd $ROOT -RASP="$ROOT/raspbian" +export RASP="$ROOT/raspbian" PATH=$RASP/bin:$PATH LD_LIBRARY_PATH=$RASP/lib @@ -38,7 +38,7 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" -export LIBC_USR=${RASP}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/ +export LIBC_USR=${RASP}/${GCC_PREFIX}/libc/usr/ export CRT=${LIBC_USR}/lib64 sudo chmod +x SSymlinker diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index b16a60b96..906a7a2ee 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -18,7 +18,7 @@ wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/m ROOT=/home/runner/work/apothecary/apothecary echo $ROOT cd $ROOT -RASP="$ROOT/raspbianpi1zero" +export RASP="$ROOT/raspbianpi1zero" PATH=$RASP/bin:$PATH @@ -39,7 +39,7 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" -export LIBC_USR=${RASP}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/ +export LIBC_USR=${RASP}/${GCC_PREFIX}/libc/usr/ export CRT=${LIBC_USR}/lib sudo chmod +x SSymlinker diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index 179d46157..f642dabac 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -19,7 +19,7 @@ wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/m ROOT=/home/runner/work/apothecary/apothecary echo $ROOT cd $ROOT -RASP="$ROOT/raspbianpi3ab45" +export RASP="$ROOT/raspbianpi3ab45" export PATH=$RASP/bin:$PATH @@ -39,7 +39,7 @@ GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" -export LIBC_USR=${RASP}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/ +export LIBC_USR=${RASP}/${GCC_PREFIX}/libc/usr/ export CRT=${LIBC_USR}/lib64 sudo chmod +x SSymlinker From 2a5909cbcc887b0037551b0bf88fc64a7310ea77 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 02:01:59 +1100 Subject: [PATCH 37/78] Symlink --- scripts/linuxaarch64/install_and_build.sh | 2 +- scripts/linuxarmv6l/install_and_build.sh | 2 +- scripts/linuxarmv7l/install_and_build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index ddff14d69..8a7dabbaa 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -46,7 +46,7 @@ sudo chmod +x SSymlinker ./SSymlinker -s ${LIBC_USR}/include/gnu -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/bits -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/sys -d /usr/include -./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include +# ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include ./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index 906a7a2ee..6021daef0 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -47,7 +47,7 @@ sudo chmod +x SSymlinker ./SSymlinker -s ${LIBC_USR}/include/gnu -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/bits -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/sys -d /usr/include -./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include +# ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include ./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index f642dabac..3c175e8e0 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -47,7 +47,7 @@ sudo chmod +x SSymlinker ./SSymlinker -s ${LIBC_USR}/include/gnu -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/bits -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/sys -d /usr/include -./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include +# ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include ./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o From 13207e6c2722c2c21009b3e3cb3a041214b5a92e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 02:17:27 +1100 Subject: [PATCH 38/78] rpath --- apothecary/toolchains/linuxaarch64-clang.toolchain.cmake | 4 ++-- apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake | 2 +- apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 3c093a6a4..29546cf8a 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -11,7 +11,7 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -set(EXTRA_LINKS "-L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ @@ -24,7 +24,7 @@ set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") ## Compiler Binary -set(BIN_PREFIX "${TOOLCHAIN_ROOT}/bin/aarch64-linux-gnu") +set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index e3162d5ad..78b788d84 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -12,7 +12,7 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -set(EXTRA_LINKS "-L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index f137929f7..307fb13e7 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -12,7 +12,7 @@ set(GCC_VERSION 14.2.0) set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) -set(EXTRA_LINKS "-L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ From 800100b1838148abf75ccefdb7e72f226eb1641e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 02:26:47 +1100 Subject: [PATCH 39/78] Toolchain fix LD --- apothecary/linuxaarch64_configure.sh | 3 +-- apothecary/linuxarmv6l_configure.sh | 3 +-- apothecary/linuxarmv7l_configure.sh | 3 +-- scripts/linuxaarch64/install_and_build.sh | 4 ++-- scripts/linuxarmv6l/install_and_build.sh | 4 ++-- scripts/linuxarmv7l/install_and_build.sh | 4 ++-- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index eb66e090f..525ee8561 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -22,8 +22,7 @@ export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" -# export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" -export LD="$CXX" +export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index b575066dd..81300b9d4 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -19,8 +19,7 @@ export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" -# export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" -export LD="$CXX" +export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 046277d25..85a4e0b13 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -20,8 +20,7 @@ export AR="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ar" export AS="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-as" export RANLIB="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ranlib" export FC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gfortran" -# export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" -export LD="$CXX" +export LD="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-ld" # GCC plugin path for LTO GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 8a7dabbaa..a82d4a2b9 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -31,8 +31,8 @@ export CC="${GCC_PREFIX}-gcc" export CXX="${GCC_PREFIX}-g++" export CPP="${GCC_PREFIX}-cpp" export FC="${GCC_PREFIX}-gfortran" -export RANLIB="${GCC_PREFIX}-gcc-ranlib" -export LD="$CXX" +export RANLIB="${GCC_PREFIX}-ranlib" +export LD="${GCC_PREFIX}-ld" GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index 6021daef0..205c20cea 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -32,8 +32,8 @@ export CC="${GCC_PREFIX}-gcc" export CXX="${GCC_PREFIX}-g++" export CPP="${GCC_PREFIX}-cpp" export FC="${GCC_PREFIX}-gfortran" -export RANLIB="${GCC_PREFIX}-gcc-ranlib" -export LD="$CXX" +export RANLIB="${GCC_PREFIX}-ranlib" +export LD="${GCC_PREFIX}-ld" GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index 3c175e8e0..023228c0a 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -32,8 +32,8 @@ export CC="${GCC_PREFIX}-gcc" export CXX="${GCC_PREFIX}-g++" export CPP="${GCC_PREFIX}-cpp" export FC="${GCC_PREFIX}-gfortran" -export RANLIB="${GCC_PREFIX}-gcc-ranlib" -export LD="$CXX" +export RANLIB="${GCC_PREFIX}-ranlib" +export LD="${GCC_PREFIX}-ld" GCCPATH="$RASP/libexec/gcc/${GCC_PREFIX}/${GCC_VERSION}" export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" From 5ffacc8180898110557d252bf39c276ffc177593 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 02:42:53 +1100 Subject: [PATCH 40/78] crt plz --- apothecary/linuxaarch64_configure.sh | 2 +- apothecary/linuxarmv6l_configure.sh | 7 +++++-- apothecary/linuxarmv7l_configure.sh | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 525ee8561..70194e020 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -41,7 +41,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ # Linker flags for ARM64 export LDFLAGS="--sysroot=${SYSROOT} \ - -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 81300b9d4..60b2afd01 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -33,10 +33,13 @@ export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/shar export CFLAGS="--sysroot=${SYSROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -march=armv6 -mfpu=neon -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" + -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" # Linker flags for cross-compilation -export LDFLAGS="--sysroot=${SYSROOT} -L$SYSROOT/usr/lib -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib -L$SYSROOT/usr/lib/arm-linux-gnueabihf -lm" +export LDFLAGS="--sysroot=${SYSROOT} -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ + -L${TOOLCHAIN_ROOT}/lib \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib -lm" # Host system for cross-compilation export HOST="${GCC_PREFIX}" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 85a4e0b13..683088a23 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -40,10 +40,10 @@ export CFLAGS="--sysroot=${SYSROOT} \ # Linker flags for ARMv7 export LDFLAGS="--sysroot=${SYSROOT} \ - -L$SYSROOT/usr/lib \ - -L$SYSROOT/usr/lib/arm-linux-gnueabihf \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ + -L${TOOLCHAIN_ROOT}/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ - -L$SYSROOT/opt/vc/lib/" + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib" # Host system for cross-compilation export HOST="${GCC_PREFIX}" From 467da72d00a51baa2d16e78405501d29ba4964de Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 02:58:15 +1100 Subject: [PATCH 41/78] Sysroot --- apothecary/formulas/glew/glew.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index 43ae6af87..c880e5c31 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -154,7 +154,7 @@ function build() { mkdir -p "build_${TYPE}_${PLATFORM}" cd "build_${TYPE}_${PLATFORM}" - echo "TOOLCHAIN_ROOT is set to: $TOOLCHAIN_ROOT" + echo "TOOLCHAIN_ROOT is set to: $TOOLCHAIN_ROOT --sysroot=${SYSROOT}" rm -f CMakeCache.txt *.a *.o *.so DEFINES="${DEFINES} -DLIBRARY_SUFFIX=${ARCH} \ -DCMAKE_BUILD_TYPE=Release \ @@ -167,17 +167,10 @@ function build() { ${DEFINES} \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ - -DCMAKE_AR=${AR} \ - -DCMAKE_RANLIB=${RANLIB} \ - -DCMAKE_SYSROOT=${SYSROOT} \ - -DCMAKE_FIND_ROOT_PATH=${SYSROOT} \ -DTOOLCHAIN_ROOT=${TOOLCHAIN_ROOT} \ -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}-clang.toolchain.cmake \ - -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \ - -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ - -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ - -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ - -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE} ${CFLAGS}" \ + -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 ${FLAG_RELEASE} ${CFLAGS}" \ + -DCMAKE_C_FLAGS="--sysroot=${SYSROOT} -DUSE_PTHREADS=1 ${FLAG_RELEASE} ${CFLAGS}" \ -DCMAKE_EXE_LINKER_FLAGS="--sysroot=${SYSROOT} ${LDFLAGS}" \ -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \ -DCMAKE_BUILD_TYPE=Release \ @@ -189,7 +182,8 @@ function build() { -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ -DENABLE_VISIBILITY=OFF \ - -DCMAKE_INSTALL_INCLUDEDIR=include + -DCMAKE_INSTALL_INCLUDEDIR=include \ + -DCMAKE_VERBOSE_MAKEFILE=true cmake --build . --target install --config Release cd .. fi From d4dffd1369601300f3e17bc9fec3bd23d647c56e Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 03:08:21 +1100 Subject: [PATCH 42/78] Symlink --- apothecary/linuxaarch64_configure.sh | 1 + apothecary/linuxarmv6l_configure.sh | 1 + apothecary/linuxarmv7l_configure.sh | 1 + apothecary/toolchains/linuxaarch64-clang.toolchain.cmake | 1 + scripts/linuxaarch64/install_and_build.sh | 6 +++--- scripts/linuxarmv7l/install_and_build.sh | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 70194e020..6661264bb 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -43,6 +43,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ export LDFLAGS="--sysroot=${SYSROOT} \ -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ + -L/usr/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 60b2afd01..d33620489 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -38,6 +38,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ # Linker flags for cross-compilation export LDFLAGS="--sysroot=${SYSROOT} -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ -L${TOOLCHAIN_ROOT}/lib \ + -L/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib -lm" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 683088a23..7d912dccb 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -42,6 +42,7 @@ export CFLAGS="--sysroot=${SYSROOT} \ export LDFLAGS="--sysroot=${SYSROOT} \ -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ -L${TOOLCHAIN_ROOT}/lib \ + -L/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib" diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 29546cf8a..1e5591895 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -13,6 +13,7 @@ set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ -L${CMAKE_SYSROOT}/lib \ + -L/usr/lib64/ \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index a82d4a2b9..87e590934 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -49,9 +49,9 @@ sudo chmod +x SSymlinker # ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include -./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o -./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o -./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o +./SSymlinker -s ${CRT}/crtn.o -d /usr/lib64/crtn.o +./SSymlinker -s ${CRT}/crt1.o -d /usr/lib64/crt1.o +./SSymlinker -s ${CRT}/crti.o -d /usr/lib64/crti.o echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index 023228c0a..9d72951a1 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -40,7 +40,7 @@ export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" export LIBC_USR=${RASP}/${GCC_PREFIX}/libc/usr/ -export CRT=${LIBC_USR}/lib64 +export CRT=${LIBC_USR}/lib sudo chmod +x SSymlinker ./SSymlinker -s ${LIBC_USR}/include/asm -d /usr/include From 31b5d1c78ee8de679de8dd7cf18b32e6ccd4caf8 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 03:14:42 +1100 Subject: [PATCH 43/78] link --- .../toolchains/linuxaarch64-clang.toolchain.cmake | 2 +- scripts/linuxaarch64/install_and_build.sh | 10 +++++++--- scripts/linuxarmv6l/install_and_build.sh | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 1e5591895..37a045c9b 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -13,7 +13,7 @@ set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ -L${CMAKE_SYSROOT}/lib \ - -L/usr/lib64/ \ + -L/usr/lib/ \ -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index 87e590934..ed5cf167d 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -49,9 +49,13 @@ sudo chmod +x SSymlinker # ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include -./SSymlinker -s ${CRT}/crtn.o -d /usr/lib64/crtn.o -./SSymlinker -s ${CRT}/crt1.o -d /usr/lib64/crt1.o -./SSymlinker -s ${CRT}/crti.o -d /usr/lib64/crti.o +./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o +./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o +./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o + +ln -sf ${CRT}/crti.o /usr/lib/crti.o +ln -sf ${CRT}/crt1.o /usr/lib/crt1.o +ln -sf ${CRT}/crtn.o /usr/lib/crtn.o echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index 205c20cea..12d822eaf 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -54,6 +54,10 @@ sudo chmod +x SSymlinker ./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o ./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o +ln -sf ${CRT}/crti.o /usr/lib/crti.o +ln -sf ${CRT}/crt1.o /usr/lib/crt1.o +ln -sf ${CRT}/crtn.o /usr/lib/crtn.o + echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc source .bashrc From 4cc334909cf16e895bf46ce30e3c8b26b4fb78d6 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 09:46:00 +1100 Subject: [PATCH 44/78] Toolchain and raspberry pi image --- .github/workflows/build-linux-arm.yml | 54 ++++++++++++++++--- apothecary/formulas/glew/glew.sh | 1 + apothecary/linuxaarch64_configure.sh | 3 +- .../linuxaarch64-clang.toolchain.cmake | 12 ++++- .../linuxarmv7l-clang.toolchain.cmake | 7 ++- scripts/linuxaarch64/install_and_build.sh | 13 +++-- 6 files changed, 72 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 624b17578..bb65d9544 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -14,7 +14,7 @@ jobs: TARGET: linuxaarch64 ARCH: arm64 WORKDIR: "/home/runner/work/apothecary/apothecary" - SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian" + SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian_rootfs" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" TOOLCHAIN_PREFIX: "aarch64-linux-gnu" steps: @@ -29,7 +29,7 @@ jobs: - name: Check if folder exists id: folder-check run: > - if [ -d $SYSROOT ]; then + if [ -d $TOOLCHAIN_ROOT ]; then echo "Raspbian folder already exists. Skipping download and extract." echo "::set-output name=folder-exists::true" else @@ -41,6 +41,18 @@ jobs: run: > cd $WORKDIR && wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/cross-gcc-14.2.0-pi_64.tar.gz/download" -O cross-gcc-14.2.0-pi_64.tar.gz && tar xf cross-gcc-14.2.0-pi_64.tar.gz &&rm cross-gcc-14.2.0-pi_64.tar.gz &&mv cross-pi-gcc-14.2.0-64 raspbian + - name: Clone rpi_rootfs Repository + run: | + mkdir -p $SYSROOT + cd $SYSROOT + git clone https://github.com/danoli3/rpi_rootfs.git $SYSROOT + + - name: Build RootFS + run: | + cd $SYSROOT && + sudo chmod +x ./build_rootfs_arm64.sh && + ./build_rootfs_arm64.sh create . + - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh - name: Update Release @@ -59,7 +71,7 @@ jobs: TARGET: linuxarmv6l ARCH: armv6 WORKDIR: "/home/runner/work/apothecary/apothecary" - SYSROOT: "/home/runner/work/apothecary/apothecary/raspbianpi1zero" + SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian_rootfs" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbianpi1zero" TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" steps: @@ -74,7 +86,7 @@ jobs: - name: Check if folder exists id: folder-check run: > - if [ -d $SYSROOT ]; then + if [ -d $TOOLCHAIN_ROOT ]; then echo "Raspbian folder already exists. Skipping download and extract." echo "::set-output name=folder-exists::true" else @@ -86,6 +98,19 @@ jobs: run: > cd $WORKDIR && wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0 raspbianpi1zero + + - name: Clone rpi_rootfs Repository + run: | + mkdir -p $SYSROOT + cd $SYSROOT + git clone https://github.com/danoli3/rpi_rootfs.git $SYSROOT + + - name: Build RootFS + run: | + cd $SYSROOT && + sudo chmod +x ./build_rootfs.sh && + ./build_rootfs.sh create . + - name: Ensure Script is Executable run: chmod +x ./scripts/$TARGET/install_and_build.sh - name: Script Install and Build @@ -106,11 +131,16 @@ jobs: TARGET: linuxarmv7l ARCH: armv7 WORKDIR: "/home/runner/work/apothecary/apothecary" - SYSROOT: "/home/runner/work/apothecary/apothecary/raspbianpi3ab45" + SYSROOT: "/home/runner/work/apothecary/apothecary/raspbianrootfs" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbianpi3ab45" TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" steps: - uses: actions/checkout@v2 + + - name: Update and Upgrade System Packages + run: | + sudo apt update && sudo apt dist-upgrade -y + sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync - name: Cache raspbian folder uses: actions/cache@v2 @@ -121,7 +151,7 @@ jobs: - name: Check if folder exists id: folder-check run: > - if [ -d $SYSROOT ]; then + if [ -d $TOOLCHAIN_ROOT ]; then echo "Raspbian folder already exists. Skipping download and extract." echo "::set-output name=folder-exists::true" else @@ -134,6 +164,18 @@ jobs: cd $WORKDIR && wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-pi-gcc-14.2.0-2 raspbianpi3ab45 + - name: Clone rpi_rootfs Repository + run: | + mkdir -p $SYSROOT + cd $SYSROOT + git clone https://github.com/danoli3/rpi_rootfs.git $SYSROOT + + - name: Build RootFS + run: | + cd $SYSROOT && + sudo chmod +x ./build_rootfs.sh && + ./build_rootfs.sh create . + - name: Ensure Script is Executable run: chmod +x ./scripts/$TARGET/install_and_build.sh - name: Script Install and Build diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index c880e5c31..dac15e1ba 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -156,6 +156,7 @@ function build() { echo "TOOLCHAIN_ROOT is set to: $TOOLCHAIN_ROOT --sysroot=${SYSROOT}" rm -f CMakeCache.txt *.a *.o *.so + DEFINES="${DEFINES} -DLIBRARY_SUFFIX=${ARCH} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_STANDARD=${C_STANDARD} \ diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 6661264bb..c9305d137 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -10,7 +10,7 @@ export GCC_PREFIX="aarch64-linux-gnu" export GCC_VERSION="14.2.0" # Adjust as needed # Update PATH and library paths -export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64:${TOOLCHAIN_ROOT}/lib +export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib export PATH=$RASP/bin:$LIBRARY_PATH:$PATH @@ -44,6 +44,7 @@ export LDFLAGS="--sysroot=${SYSROOT} \ -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ -L/usr/lib64 \ + -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 37a045c9b..07ed107d5 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -8,8 +8,16 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64) set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) set(GCC_VERSION 14.2.0) -set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) -set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD 17) +set(CMAKE_C_STANDARD_REQUIRED ON) + +set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. +set(rootfs_dir ${SYSROOT}/rootfs>) # warning change compiled rootfs path here. + +set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) +set(CMAKE_SYSROOT ${rootfs_dir}) set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ -L${CMAKE_SYSROOT}/lib \ diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index 307fb13e7..a01bd2531 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -9,8 +9,11 @@ set(CMAKE_SYSTEM_PROCESSOR armv7) set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) set(GCC_VERSION 14.2.0) -set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) -set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) +set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. +set(rootfs_dir ${SYSROOT}/rootfs>) # warning change compiled rootfs path here. + +set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) +set(CMAKE_SYSROOT ${rootfs_dir}) set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index ed5cf167d..f2ca7f28d 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -49,13 +49,12 @@ sudo chmod +x SSymlinker # ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include -./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o -./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o -./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o - -ln -sf ${CRT}/crti.o /usr/lib/crti.o -ln -sf ${CRT}/crt1.o /usr/lib/crt1.o -ln -sf ${CRT}/crtn.o /usr/lib/crtn.o +./SSymlinker -s ${CRT}/crtn.o -d /usr/lib64/crtn.o +./SSymlinker -s ${CRT}/crt1.o -d /usr/lib64/crt1.o +./SSymlinker -s ${CRT}/crti.o -d /usr/lib64/crti.o +./SSymlinker -s ${LIBC_USR}/lib/crtn.o -d /usr/lib/crtn.o +./SSymlinker -s ${LIBC_USR}/lib/crt1.o -d /usr/lib/crt1.o +./SSymlinker -s ${LIBC_USR}/lib/crti.o -d /usr/lib/crti.o echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc From da42e9c9c3b16fb455742aa8e8e0c40387776761 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 10:00:27 +1100 Subject: [PATCH 45/78] Actions fix Distribution --- .github/workflows/build-linux-arm.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index bb65d9544..1f3453520 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -19,6 +19,11 @@ jobs: TOOLCHAIN_PREFIX: "aarch64-linux-gnu" steps: - uses: actions/checkout@v2 + + - name: Update and Upgrade System Packages + run: | + sudo apt update && sudo apt dist-upgrade -y + sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync - name: Cache raspbian folder uses: actions/cache@v2 @@ -76,6 +81,11 @@ jobs: TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" steps: - uses: actions/checkout@v2 + + - name: Update and Upgrade System Packages + run: | + sudo apt update && sudo apt dist-upgrade -y + sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync - name: Cache raspbian folder uses: actions/cache@v2 From c0e66ef6c91ea672bc826ee882b1eccb613e6e3d Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 15:11:37 +1100 Subject: [PATCH 46/78] Raspberry Pi rootfs create fix --- .github/workflows/build-linux-arm.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 1f3453520..90f3efeb6 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -56,7 +56,7 @@ jobs: run: | cd $SYSROOT && sudo chmod +x ./build_rootfs_arm64.sh && - ./build_rootfs_arm64.sh create . + ./build_rootfs_arm64.sh create - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh @@ -119,7 +119,7 @@ jobs: run: | cd $SYSROOT && sudo chmod +x ./build_rootfs.sh && - ./build_rootfs.sh create . + ./build_rootfs.sh create - name: Ensure Script is Executable run: chmod +x ./scripts/$TARGET/install_and_build.sh @@ -184,7 +184,7 @@ jobs: run: | cd $SYSROOT && sudo chmod +x ./build_rootfs.sh && - ./build_rootfs.sh create . + ./build_rootfs.sh create - name: Ensure Script is Executable run: chmod +x ./scripts/$TARGET/install_and_build.sh From b8c427e250117cf75f6fa6f5504a7a6e9ae43833 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 16:30:22 +1100 Subject: [PATCH 47/78] Raspbian rootfs download then mount --- .github/workflows/build-linux-arm.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 90f3efeb6..971d28a54 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -55,7 +55,8 @@ jobs: - name: Build RootFS run: | cd $SYSROOT && - sudo chmod +x ./build_rootfs_arm64.sh && + sudo chmod +x ./build_rootfs_arm64.sh + ./build_rootfs_arm64.sh download ./build_rootfs_arm64.sh create - name: Script Install and Build @@ -118,7 +119,8 @@ jobs: - name: Build RootFS run: | cd $SYSROOT && - sudo chmod +x ./build_rootfs.sh && + sudo chmod +x ./build_rootfs.sh + ./build_rootfs_arm64.sh download ./build_rootfs.sh create - name: Ensure Script is Executable @@ -183,7 +185,8 @@ jobs: - name: Build RootFS run: | cd $SYSROOT && - sudo chmod +x ./build_rootfs.sh && + sudo chmod +x ./build_rootfs.sh + ./build_rootfs_arm64.sh download ./build_rootfs.sh create - name: Ensure Script is Executable From a76c2916c112cc95c245adad51d5313a2a034f6c Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 17:21:56 +1100 Subject: [PATCH 48/78] xz-utils --- .github/workflows/build-linux-arm.yml | 6 +++--- scripts/linuxaarch64/install_and_build.sh | 2 +- scripts/linuxarmv6l/install_and_build.sh | 2 +- scripts/linuxarmv7l/install_and_build.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 971d28a54..0bec04018 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -23,7 +23,7 @@ jobs: - name: Update and Upgrade System Packages run: | sudo apt update && sudo apt dist-upgrade -y - sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync + sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils - name: Cache raspbian folder uses: actions/cache@v2 @@ -86,7 +86,7 @@ jobs: - name: Update and Upgrade System Packages run: | sudo apt update && sudo apt dist-upgrade -y - sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync + sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils - name: Cache raspbian folder uses: actions/cache@v2 @@ -152,7 +152,7 @@ jobs: - name: Update and Upgrade System Packages run: | sudo apt update && sudo apt dist-upgrade -y - sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync + sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils - name: Cache raspbian folder uses: actions/cache@v2 diff --git a/scripts/linuxaarch64/install_and_build.sh b/scripts/linuxaarch64/install_and_build.sh index f2ca7f28d..60678ff29 100755 --- a/scripts/linuxaarch64/install_and_build.sh +++ b/scripts/linuxaarch64/install_and_build.sh @@ -11,7 +11,7 @@ trapError() { exit 1 } -sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet +sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet xz-utils sudo aptitude install -y gperf wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/master/utils/SSymlinker diff --git a/scripts/linuxarmv6l/install_and_build.sh b/scripts/linuxarmv6l/install_and_build.sh index 12d822eaf..e33d8d4ec 100644 --- a/scripts/linuxarmv6l/install_and_build.sh +++ b/scripts/linuxarmv6l/install_and_build.sh @@ -11,7 +11,7 @@ trapError() { exit 1 } -sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet +sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet xz-utils sudo aptitude install -y gperf wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/master/utils/SSymlinker diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index 9d72951a1..4769c4a34 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -11,7 +11,7 @@ trapError() { exit 1 } -sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet +sudo apt-get install -y aptitude build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev cmake unzip pkg-config flex openssl pigz autoconf automake tar figlet xz-utils sudo aptitude install -y gperf wget https://raw.githubusercontent.com/abhiTronix/raspberry-pi-cross-compilers/master/utils/SSymlinker From a83c8e6b8843104d7bf47a3068f00903963c8a01 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 18:20:08 +1100 Subject: [PATCH 49/78] Fix rootfs --- apothecary/linuxaarch64_configure.sh | 2 +- .../toolchains/linuxaarch64-clang.toolchain.cmake | 6 +++--- .../toolchains/linuxarmv6l-clang.toolchain.cmake | 11 +++++++---- .../toolchains/linuxarmv7l-clang.toolchain.cmake | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index c9305d137..a4184ff9a 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -12,7 +12,7 @@ export GCC_VERSION="14.2.0" # Adjust as needed # Update PATH and library paths export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib -export PATH=$RASP/bin:$LIBRARY_PATH:$PATH +export PATH=$TOOLCHAIN_ROOT/bin:$LIBRARY_PATH:$PATH # Define cross-compilation tools export CC="${TOOLCHAIN_ROOT}/bin/${GCC_PREFIX}-gcc" diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 07ed107d5..ac33d864f 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -14,7 +14,7 @@ set(CMAKE_C_STANDARD 17) set(CMAKE_C_STANDARD_REQUIRED ON) set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. -set(rootfs_dir ${SYSROOT}/rootfs>) # warning change compiled rootfs path here. +set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) @@ -28,9 +28,9 @@ set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=cortex-a53") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=cortex-a53") ## Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index 78b788d84..668082a3a 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -9,8 +9,11 @@ set(CMAKE_SYSTEM_PROCESSOR armv6) set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) set(GCC_VERSION 14.2.0) -set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}) -set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}) +set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. +set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. + +set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) +set(CMAKE_SYSROOT ${rootfs_dir}) set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ @@ -22,8 +25,8 @@ set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") # Update compiler flags for ARMv7 -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index a01bd2531..62fe85b15 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -10,7 +10,7 @@ set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) set(GCC_VERSION 14.2.0) set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. -set(rootfs_dir ${SYSROOT}/rootfs>) # warning change compiled rootfs path here. +set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) @@ -26,8 +26,8 @@ set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") # Update compiler flags for ARMv7 -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv7-a -mfpu=vfp -mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard ${EXTRA_LINKS}") # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) From 2ff68f88f4bdc1851f1c023b0a1ad968da71a4d5 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Mon, 19 Aug 2024 18:21:22 +1000 Subject: [PATCH 50/78] Linux GCC8 --- .github/disabled/build-linux64.yml | 5 +---- scripts/linux/install.sh | 13 ++++++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/disabled/build-linux64.yml b/.github/disabled/build-linux64.yml index 93166043c..e1e51a642 100644 --- a/.github/disabled/build-linux64.yml +++ b/.github/disabled/build-linux64.yml @@ -26,6 +26,7 @@ jobs: matrix: cfg: - {target: linux64, opt: gcc6} + - {target: linux64, opt: gcc8} - {target: linux64, opt: gcc11} env: TARGET: ${{matrix.cfg.target}} @@ -42,13 +43,10 @@ jobs: run: | if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then echo "RELEASE=nightly" >> $GITHUB_ENV - echo "PRERELEASE=false" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=bleeding" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV else echo "RELEASE=bleeding" >> $GITHUB_ENV - echo "PRERELEASE=true" >> $GITHUB_ENV fi - name: BuildLinux64 working-directory: ${{env.GITHUB_WORKSPACE}} @@ -68,6 +66,5 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ env.RELEASE }} release: ${{ env.RELEASE }} - prerelease: ${{ env.PRERELEASE }} files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ matrix.cfg.opt }}.tar.bz2 \ No newline at end of file diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index bada50577..ce07c4435 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -43,7 +43,7 @@ echoDots(){ done } -echo "GCC Version: $OPT" +echo "GCC Version: [$OPT]" if [ "$OPT" == "gcc4" ]; then sudo add-apt-repository -y ppa:dns/gnu @@ -97,6 +97,17 @@ elif [ "$OPT" == "gcc7" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 sudo add-apt-repository -r "deb http://cz.archive.ubuntu.com/ubuntu bionic main universe" g++ -v +elif [ "$OPT" == "gcc8" ]; then + #https://gcc.gnu.org/gcc-8/changes.html + sudo apt update + sudo apt install software-properties-common + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt install gcc-8 g++-8 gcc-13 g++-13 -y + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 --slave /usr/bin/g++ g++ /usr/bin/g++-8 + sudo update-alternatives --config gcc + gcc --version + g++ -v elif [ "$OPT" == "gcc11" ]; then # https://gcc.gnu.org/gcc-11/changes.html sudo apt update From 9b98210df424119cdc5d8572edb00953c8f4dbbe Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 18:43:00 +1100 Subject: [PATCH 51/78] Cleanup toolchains of old --- .../aarch64-linux-gnu.toolchain.cmake | 31 -- .../arm-linux-gnueabi.toolchain.cmake | 28 -- .../toolchains/linux-clang.toolchain.cmake | 13 - scripts/linuxaarch64/install.sh | 84 ----- .../CROSS_BUILD_TOOLS/build_cross_gcc.sh | 155 --------- scripts/linuxarmv6l/install.sh | 82 ----- scripts/linuxarmv6l/setup.sh | 102 ------ .../CROSS_BUILD_TOOLS/build_cross_gcc.sh | 172 ---------- scripts/linuxarmv7l/arch-bootstrap.sh | 237 -------------- .../arch-bootstrap_downloadonly.sh | 296 ------------------ scripts/linuxarmv7l/install.sh | 102 ------ scripts/linuxarmv7l/multistrap.conf | 29 ++ 12 files changed, 29 insertions(+), 1302 deletions(-) delete mode 100644 apothecary/toolchains/aarch64-linux-gnu.toolchain.cmake delete mode 100644 apothecary/toolchains/arm-linux-gnueabi.toolchain.cmake delete mode 100644 apothecary/toolchains/linux-clang.toolchain.cmake delete mode 100755 scripts/linuxaarch64/install.sh delete mode 100755 scripts/linuxarmv6l/CROSS_BUILD_TOOLS/build_cross_gcc.sh delete mode 100755 scripts/linuxarmv6l/install.sh delete mode 100755 scripts/linuxarmv6l/setup.sh delete mode 100755 scripts/linuxarmv7l/CROSS_BUILD_TOOLS/build_cross_gcc.sh delete mode 100755 scripts/linuxarmv7l/arch-bootstrap.sh delete mode 100755 scripts/linuxarmv7l/arch-bootstrap_downloadonly.sh delete mode 100755 scripts/linuxarmv7l/install.sh create mode 100644 scripts/linuxarmv7l/multistrap.conf diff --git a/apothecary/toolchains/aarch64-linux-gnu.toolchain.cmake b/apothecary/toolchains/aarch64-linux-gnu.toolchain.cmake deleted file mode 100644 index 5b032eea4..000000000 --- a/apothecary/toolchains/aarch64-linux-gnu.toolchain.cmake +++ /dev/null @@ -1,31 +0,0 @@ -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR aarch64) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_STANDARD 17) -set(CMAKE_C_STANDARD_REQUIRED ON) - -set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc") -set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++") - -if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -endif() -if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -endif() -if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() -if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -endif() - -set(CMAKE_C_FLAGS "-march=armv8-a") -set(CMAKE_CXX_FLAGS "-march=armv8-a") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags") - -set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64) \ No newline at end of file diff --git a/apothecary/toolchains/arm-linux-gnueabi.toolchain.cmake b/apothecary/toolchains/arm-linux-gnueabi.toolchain.cmake deleted file mode 100644 index 83580a2a8..000000000 --- a/apothecary/toolchains/arm-linux-gnueabi.toolchain.cmake +++ /dev/null @@ -1,28 +0,0 @@ -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR arm) - -set(CMAKE_C_COMPILER "arm-linux-gnueabi-gcc") -set(CMAKE_CXX_COMPILER "arm-linux-gnueabi-g++") - -if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -endif() -if(NOT CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -endif() -if(NOT CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() -if(NOT CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -endif() - - -set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=softfp -mfpu=neon") -set(CMAKE_CXX_FLAGS "-march=armv7-a -mfloat-abi=softfp -mfpu=neon") - -add_definitions(-D__STDC_CONSTANT_MACROS) - -# cache flags -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags") diff --git a/apothecary/toolchains/linux-clang.toolchain.cmake b/apothecary/toolchains/linux-clang.toolchain.cmake deleted file mode 100644 index a320562de..000000000 --- a/apothecary/toolchains/linux-clang.toolchain.cmake +++ /dev/null @@ -1,13 +0,0 @@ -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR arm) - -set(triple arm-linux-gnueabihf) - -set(CMAKE_C_COMPILER clang) -set(CMAKE_C_COMPILER_TARGET ${triple}) -set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_CXX_COMPILER_TARGET ${triple}) - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/scripts/linuxaarch64/install.sh b/scripts/linuxaarch64/install.sh deleted file mode 100755 index 448b3364f..000000000 --- a/scripts/linuxaarch64/install.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -set -e -set -o pipefail -# trap any script errors and exit -trap "trapError" ERR - -trapError() { - echo - echo " ^ Received error ^" - cat formula.log - exit 1 -} - -installPackages(){ - sudo apt-get update -q - sudo apt-get -y install multistrap unzip coreutils gperf - sudo apt-get -y install libasound-dev libjack-dev libpulse-dev oss4-dev #rtaudio - sudo apt-get update && sudo apt-get install -y autoconf libtool automake -} - -createRaspbianImg(){ - mkdir -p raspbian/etc/apt/apt.conf.d/ - echo 'Acquire::AllowInsecureRepositories "true";' | sudo tee raspbian/etc/apt/apt.conf.d/90insecure - multistrap -a arm64 -d raspbian -f multistrap.conf -} - -downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0-1 raspbianpi1zero - -} - -downloadFirmware(){ - echo "no firmware" - # wget -nv https://github.com/raspberrypi/firmware/archive/master.zip -O firmware.zip - # unzip firmware.zip - # cp -r firmware-master/opt raspbian/ - # rm -r firmware-master - # rm firmware.zip -} - -relativeSoftLinks(){ - for link in $(ls -la | grep "\-> /" | sed "s/.* \([^ ]*\) \-> \/\(.*\)/\1->\/\2/g"); do - lib=$(echo $link | sed "s/\(.*\)\->\(.*\)/\1/g"); - link=$(echo $link | sed "s/\(.*\)\->\(.*\)/\2/g"); - rm $lib - ln -s ../../..$link $lib - done - - for f in *; do - error=$(grep " \/lib/" $f > /dev/null 2>&1; echo $?) - if [ $error -eq 0 ]; then - sed -i "s/ \/lib/ ..\/..\/..\/lib/g" $f - sed -i "s/ \/usr/ ..\/..\/..\/usr/g" $f - fi - done -} - -# run install -ROOT=$( cd "$(dirname "$0")" ; pwd -P ) -echo $ROOT -cd $ROOT -installPackages -# createRaspbianImg -downloadToolchain -# downloadFirmware - -# cp -rn rpi_toolchain/aarch64-linux-gnu/libc/lib/* $ROOT/raspbian/usr/lib/ -# cp -rn rpi_toolchain/aarch64-linux-gnu/libc/usr/lib/* $ROOT/raspbian/usr/lib/ -# cp -rn rpi_toolchain/aarch64-linux-gnu/lib/* $ROOT/raspbian/usr/lib/ - -# cd $ROOT/raspbian/usr/lib -# relativeSoftLinks -# cd $ROOT/raspbian/usr/lib/aarch64-linux-gnu -# relativeSoftLinks - -sudo apt-get update && sudo apt-get install -y autoconf libtool automake dos2unix -sudo apt-get update && sudo apt-get install -y cmake - -# CMAKE_VERSION=3.30.0 -# wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-aarch64.sh -# chmod +x cmake-${CMAKE_VERSION}-linux-aarch64.sh -# sudo ./cmake-${CMAKE_VERSION}-linux-aarch64.sh --skip-license --prefix=/usr/local -# export PATH="/usr/local/bin:$PATH" - diff --git a/scripts/linuxarmv6l/CROSS_BUILD_TOOLS/build_cross_gcc.sh b/scripts/linuxarmv6l/CROSS_BUILD_TOOLS/build_cross_gcc.sh deleted file mode 100755 index e1020547a..000000000 --- a/scripts/linuxarmv6l/CROSS_BUILD_TOOLS/build_cross_gcc.sh +++ /dev/null @@ -1,155 +0,0 @@ -#! /bin/bash -set -e -trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG -trap 'echo FAILED COMMAND: $previous_command' EXIT - -#------------------------------------------------------------------------------------------- -# This script will download packages for, configure, build and install a GCC cross-compiler. -# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running. -# If you get an error and need to resume the script from some point in the middle, -# just delete/comment the preceding lines before running it again. -# -# See: http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler -#------------------------------------------------------------------------------------------- - -export SYSROOT=$(cd $(dirname $0)/../raspbian; pwd -P) - - -INSTALL_PATH=$(cd $(dirname $0)/..; pwd -P)/rpi_toolchain -TARGET=arm-linux-gnueabihf -LINUX_ARCH=arm -CONFIGURATION_OPTIONS="--disable-werror" -SYSROOT_OPTIONS="--with-sysroot=$SYSROOT --with-build-sysroot=$SYSROOT" - -PARALLEL_MAKE=-j4 -BINUTILS_VERSION=binutils-2.28 -GCC_VERSION=gcc-6.3.0 -LINUX_KERNEL_VERSION=linux-4.9.1 -GLIBC_VERSION=glibc-2.24 -MPFR_VERSION=mpfr-3.1.5 -GMP_VERSION=gmp-6.1.2 -MPC_VERSION=mpc-1.0.3 -ISL_VERSION=isl-0.18 -CLOOG_VERSION=cloog-0.18.1 -USE_NEWLIB=0 -export PATH=$INSTALL_PATH/bin:$PATH - -# Install dependencies -sudo apt-get install -y gawk - -# Download packages -export http_proxy=$HTTP_PROXY https_proxy=$HTTP_PROXY ftp_proxy=$HTTP_PROXY -if [ ! -f $BINUTILS_VERSION.tar.gz ]; then - wget -nc https://ftp.gnu.org/gnu/binutils/$BINUTILS_VERSION.tar.gz -fi -if [ ! -f $GCC_VERSION.tar.gz ]; then - wget -nc https://ftp.gnu.org/gnu/gcc/$GCC_VERSION/$GCC_VERSION.tar.gz -fi -if [ ! -f $LINUX_KERNEL_VERSION.tar.xz ]; then - wget -nc https://www.kernel.org/pub/linux/kernel/v4.x/$LINUX_KERNEL_VERSION.tar.xz -fi -if [ ! -f $GLIBC_VERSION.tar.xz ]; then - wget -nc https://ftp.gnu.org/gnu/glibc/$GLIBC_VERSION.tar.xz -fi -if [ ! -f $MPFR_VERSION.tar.xz ]; then - wget -nc https://ftp.gnu.org/gnu/mpfr/$MPFR_VERSION.tar.xz -fi -if [ ! -f $GMP_VERSION.tar.xz ]; then - wget -nc https://ftp.gnu.org/gnu/gmp/$GMP_VERSION.tar.xz -fi -if [ ! -f $MPC_VERSION.tar.gz ]; then - wget -nc https://ftp.gnu.org/gnu/mpc/$MPC_VERSION.tar.gz -fi -if [ ! -f $ISL_VERSION.tar.bz2 ]; then - wget -nc ftp://gcc.gnu.org/pub/gcc/infrastructure/$ISL_VERSION.tar.bz2 -fi -if [ ! -f $CLOOG_VERSION.tar.gz ]; then - wget -nc ftp://gcc.gnu.org/pub/gcc/infrastructure/$CLOOG_VERSION.tar.gz -fi - - -# Extract everything -echo "Uncompressing toolchain source" -for f in *.tar*; do tar xf $f; done - -# Make symbolic links -cd $GCC_VERSION -ln -sf `ls -1d ../mpfr-*/` mpfr -ln -sf `ls -1d ../gmp-*/` gmp -ln -sf `ls -1d ../mpc-*/` mpc -ln -sf `ls -1d ../isl-*/` isl -ln -sf `ls -1d ../cloog-*/` cloog -cd .. - - -# Step 1. Binutils -mkdir -p build-binutils -cd build-binutils -../$BINUTILS_VERSION/configure --prefix=$INSTALL_PATH --target=$TARGET $CONFIGURATION_OPTIONS $SYSROOT_OPTIONS -make $PARALLEL_MAKE -make install -cd .. - -# Step 2. Linux Kernel Headers -if [ $USE_NEWLIB -eq 0 ]; then - cd $LINUX_KERNEL_VERSION - make ARCH=$LINUX_ARCH INSTALL_HDR_PATH=$INSTALL_PATH/$TARGET headers_install - cd .. -fi - -# Step 3. C/C++ Compilers -mkdir -p build-gcc -cd build-gcc -if [ $USE_NEWLIB -ne 0 ]; then - NEWLIB_OPTION=--with-newlib -fi -../$GCC_VERSION/configure --prefix=$INSTALL_PATH --target=$TARGET --enable-languages=c,c++ --with-float=hard --enable-multiarch --target=arm-linux-gnueabihf $CONFIGURATION_OPTIONS $SYSROOT_OPTIONS -make $PARALLEL_MAKE all-gcc -make install-gcc -cd .. - -if [ $USE_NEWLIB -ne 0 ]; then - # Steps 4-6: Newlib - mkdir -p build-newlib - cd build-newlib - ../newlib-master/configure --prefix=$INSTALL_PATH --target=$TARGET $CONFIGURATION_OPTIONS - make $PARALLEL_MAKE - make install - cd .. -else - # Step 4. Standard C Library Headers and Startup Files - echo "Building sub glibc" - mkdir -p build-glibc - cd build-glibc - ../$GLIBC_VERSION/configure --prefix=$INSTALL_PATH/$TARGET --build=$MACHTYPE --host=$TARGET --target=$TARGET --with-headers=$INSTALL_PATH/$TARGET/include $CONFIGURATION_OPTIONS libc_cv_forced_unwind=yes - make install-bootstrap-headers=yes install-headers - make $PARALLEL_MAKE csu/subdir_lib - install csu/crt1.o csu/crti.o csu/crtn.o $INSTALL_PATH/$TARGET/lib - $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $INSTALL_PATH/$TARGET/lib/libc.so - touch $INSTALL_PATH/$TARGET/include/gnu/stubs.h - cd .. - - # Step 5. Compiler Support Library - echo "Building gcc" - cd build-gcc - make $PARALLEL_MAKE all-target-libgcc - make install-target-libgcc - cd .. - - # Step 6. Standard C Library & the rest of Glibc - echo "Building glibc" - cd build-glibc - make $PARALLEL_MAKE - make install - cd .. -fi - -# Step 7. Standard C++ Library & the rest of GCC -cd build-gcc -make $PARALLEL_MAKE all -make install -cd .. - -trap - EXIT -echo 'Success!' - diff --git a/scripts/linuxarmv6l/install.sh b/scripts/linuxarmv6l/install.sh deleted file mode 100755 index 3592293cc..000000000 --- a/scripts/linuxarmv6l/install.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -set -e -set -o pipefail -# trap any script errors and exit -trap "trapError" ERR - -trapError() { - echo - echo " ^ Received error ^" - cat formula.log - exit 1 -} - -installPackages(){ - IS_UBUNTU=`uname -a | grep Ubuntu > /dev/null; echo $?` - UBUNTU_VERSION=`lsb_release -r | awk '{ print $2 }'` - if [ $IS_UBUNTU -eq 0 ] && [ "$UBUNTU_VERSION" == "14.04" ]; then - echo "installing ppa" - #sudo add-apt-repository ppa:dns/gnu -y - else - echo "$UBUNTU_VERSION doesn\'t need ppa" - fi - sudo apt-get update -q - sudo apt-get -y install gcc-arm-linux-gnueabihf - sudo apt-get -y install multistrap unzip coreutils gperf build-essential - sudo apt-get install -y pkgconf rsync - #workaround for https://bugs.launchpad.net/ubuntu/+source/multistrap/+bug/1313787 - if [ $IS_UBUNTU -eq 0 ] && [ "$UBUNTU_VERSION"=="14.04" ]; then - sudo sed -i s/\$forceyes//g /usr/sbin/multistrap - fi -} - -createRaspbianImg(){ - #needed since Ubuntu 18.04 - allow non https repositories - mkdir -p raspbian/etc/apt/apt.conf.d/ - echo 'Acquire::AllowInsecureRepositories "true";' | sudo tee raspbian/etc/apt/apt.conf.d/90insecure - multistrap -a armhf -d raspbian -f multistrap.conf -} - -downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2014.2.0/Raspberry%20Pi%203A%2B%2C%203B%2B%2C%204%2C%205/cross-gcc-14.2.0-pi_3%2B.tar.gz/download" -O cross-gcc-14.2.0-pi_3+.tar.gz && tar xf cross-gcc-14.2.0-pi_3+.tar.gz && rm cross-gcc-14.2.0-pi_3+.tar.gz && mv cross-pi-gcc-14.2.0-2 raspbianpi3ab45 - -} - -downloadFirmware(){ - echo "no firmware" - # wget -nv https://github.com/raspberrypi/firmware/archive/master.zip -O firmware.zip - # unzip -q firmware.zip - # cp -r firmware-master/opt raspbian/ - # rm -r firmware-master - # rm firmware.zip -} - -relativeSoftLinks(){ - for link in $(ls -la | grep "\-> /" | sed "s/.* \([^ ]*\) \-> \/\(.*\)/\1->\/\2/g"); do - lib=$(echo $link | sed "s/\(.*\)\->\(.*\)/\1/g"); - link=$(echo $link | sed "s/\(.*\)\->\(.*\)/\2/g"); - rm $lib - ln -s ../../..$link $lib - done - - for f in *; do - error=$(grep " \/lib/" $f > /dev/null 2>&1; echo $?) - if [ $error -eq 0 ]; then - sed -i "s/ \/lib/ ..\/..\/..\/lib/g" $f - sed -i "s/ \/usr/ ..\/..\/..\/usr/g" $f - fi - done -} - -if [[ $(uname -m) != armv* ]]; then - - ROOT=$( cd "$(dirname "$0")" ; pwd -P ) - echo $ROOT - cd $ROOT - installPackages - # createRaspbianImg - # downloadFirmware - downloadToolchain - - -fi diff --git a/scripts/linuxarmv6l/setup.sh b/scripts/linuxarmv6l/setup.sh deleted file mode 100755 index 5528739e8..000000000 --- a/scripts/linuxarmv6l/setup.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -set -e -set -o pipefail -# trap any script errors and exit -trap "trapError" ERR - -SILENT_ARGS="" - -CRIPT_DIR="${BASH_SOURCE%/*}" -if [[ ! -d "$SCRIPT_DIR" ]]; then SCRIPT_DIR="$PWD"; fi -. "$SCRIPT_DIR/../downloader.sh" - -trapError() { - echo - echo " ^ Received error ^" - cat formula.log - exit 1 -} - -installPackages(){ - echo "install" - # IS_UBUNTU=`uname -a | grep Ubuntu > /dev/null; echo $?` - # UBUNTU_VERSION=`lsb_release -r | awk '{ print $2 }'` - # if [ $IS_UBUNTU -eq 0 ] && [ "$UBUNTU_VERSION" == "14.04" ]; then - # echo "installing ppa" - # #sudo add-apt-repository ppa:dns/gnu -y - # else - # echo "$UBUNTU_VERSION doesn\'t need ppa" - # fi - # sudo apt-get update -q - # sudo apt-get -y install multistrap unzip coreutils gperf build-essential - # sudo apt-get install -y autoconf automake pkgconf rsync - # #workaround for https://bugs.launchpad.net/ubuntu/+source/multistrap/+bug/1313787 - # if [ $IS_UBUNTU -eq 0 ] && [ "$UBUNTU_VERSION"=="14.04" ]; then - # sudo sed -i s/\$forceyes//g /usr/sbin/multistrap - # fi -} - -createRaspbianImg(){ - echo " createRaspbianImg " - #needed since Ubuntu 18.04 - allow non https repositories - mkdir -p raspbian/etc/apt/apt.conf.d/ - echo 'Acquire::AllowInsecureRepositories "true";' | sudo tee raspbian/etc/apt/apt.conf.d/90insecure - multistrap -a armhf -d raspbian -f multistrap.conf -} - -downloadToolchain(){ - echo " downloadToolchain " - downloader http://ci.openframeworks.cc/rpi_toolchain_gcc6.tar.bz2 $SILENT_ARGS - tar xjf rpi_toolchain_gcc6.tar.bz2 - rm rpi_toolchain_gcc6.tar.bz2 -} - -downloadFirmware(){ - echo " downloadFirmware " - downloader https://github.com/raspberrypi/firmware/archive/master.zip - unzip master.zip - cp -r firmware-master/opt raspbian/ - rm -r firmware-master - rm master.zip -} - -relativeSoftLinks(){ - for link in $(ls -la | grep "\-> /" | sed "s/.* \([^ ]*\) \-> \/\(.*\)/\1->\/\2/g"); do - lib=$(echo $link | sed "s/\(.*\)\->\(.*\)/\1/g"); - link=$(echo $link | sed "s/\(.*\)\->\(.*\)/\2/g"); - rm $lib - ln -s ../../..$link $lib - done - - for f in *; do - error=$(grep " \/lib/" $f > /dev/null 2>&1; echo $?) - if [ $error -eq 0 ]; then - sed -i "s/ \/lib/ ..\/..\/..\/lib/g" $f - sed -i "s/ \/usr/ ..\/..\/..\/usr/g" $f - fi - done -} - -if [[ $(uname -m) != armv* ]]; then - - ROOT=$( cd "$(dirname "$0")" ; pwd -P ) - echo $ROOT - cd $ROOT - #installPackages - #createRaspbianImg - downloadToolchain - downloadFirmware - - cd $ROOT/raspbian/usr/lib - relativeSoftLinks - cd $ROOT/raspbian/usr/lib/arm-linux-gnueabihf - relativeSoftLinks - cd $ROOT/raspbian/usr/lib/gcc/arm-linux-gnueabihf/4.9 - - cd $ROOT/rpi_toolchain/arm-linux-gnueabihf/lib - #sed -i "s|/home/arturo/Code/openFrameworks/apothecary/scripts/linuxarm/rpi_toolchain/arm-linux-gnueabihf/lib|$ROOT/rpi_toolchain/arm-linux-gnueabihf/lib|g" libc.so - # for f in *.so; do - # sed -i "s|/home/arturo/Code/openFrameworks/apothecary/scripts/linuxarm/rpi_toolchain/arm-linux-gnueabihf/lib|$ROOT/rpi_toolchain/arm-linux-gnueabihf/lib|g" $f - # done - -fi diff --git a/scripts/linuxarmv7l/CROSS_BUILD_TOOLS/build_cross_gcc.sh b/scripts/linuxarmv7l/CROSS_BUILD_TOOLS/build_cross_gcc.sh deleted file mode 100755 index 7780a8b9d..000000000 --- a/scripts/linuxarmv7l/CROSS_BUILD_TOOLS/build_cross_gcc.sh +++ /dev/null @@ -1,172 +0,0 @@ -#! /bin/bash -set -e -trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG -trap 'echo FAILED COMMAND: $previous_command' EXIT - -#------------------------------------------------------------------------------------------- -# This script will download packages for, configure, build and install a GCC cross-compiler. -# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running. -# If you get an error and need to resume the script from some point in the middle, -# just delete/comment the preceding lines before running it again. -# -# See: http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler -#------------------------------------------------------------------------------------------- - -export BUILDROOT=$(cd $(dirname $0); pwd -P) -export SYSROOT=$(dirname $0)/../archlinux - -if [ ! -d $SYSROOT ]; then - wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz - mkdir $SYSROOT - tar xzf ArchLinuxARM-rpi-2-latest.tar.gz -C $SYSROOT 2> /dev/null - rm ArchLinuxARM-rpi-2-latest.tar.gz -fi - -export SYSROOT=$(cd $(dirname $0)/../archlinux; pwd -P) -mkdir -p $BUILDROOT/logs - - -INSTALL_PATH=$(cd $(dirname $0)/..; pwd -P)/rpi2_toolchain -TARGET=arm-linux-gnueabihf -LINUX_ARCH=arm -CONFIGURATION_OPTIONS="--disable-werror --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16" -SYSROOT_OPTIONS="--with-sysroot=$SYSROOT --with-build-sysroot=$SYSROOT" - -PARALLEL_MAKE=-j8 -BINUTILS_VERSION=binutils-2.28 -GCC_VERSION=gcc-6.4.0 -LINUX_KERNEL_VERSION=linux-4.9.35 -GLIBC_VERSION=glibc-2.25 -MPFR_VERSION=mpfr-3.1.5 -GMP_VERSION=gmp-6.1.2 -MPC_VERSION=mpc-1.0.3 -ISL_VERSION=isl-0.12.2 -CLOOG_VERSION=cloog-0.18.1 -USE_NEWLIB=0 -export PATH=$INSTALL_PATH/bin:$PATH - -cd $(dirname $0) - -# Download packages -export http_proxy=$HTTP_PROXY https_proxy=$HTTP_PROXY ftp_proxy=$HTTP_PROXY -if [ ! -f $BINUTILS_VERSION.tar.gz ]; then - wget -nc https://ftp.gnu.org/gnu/binutils/$BINUTILS_VERSION.tar.gz -fi -if [ ! -f $GCC_VERSION.tar.gz ]; then - wget -nc https://ftp.gnu.org/gnu/gcc/$GCC_VERSION/$GCC_VERSION.tar.gz -fi -if [ ! -f $LINUX_KERNEL_VERSION.tar.xz ]; then - wget -nc https://www.kernel.org/pub/linux/kernel/v4.x/$LINUX_KERNEL_VERSION.tar.xz -fi -if [ ! -f $GLIBC_VERSION.tar.xz ]; then - wget -nc https://ftp.gnu.org/gnu/glibc/$GLIBC_VERSION.tar.xz -fi -if [ ! -f $MPFR_VERSION.tar.xz ]; then - wget -nc https://ftp.gnu.org/gnu/mpfr/$MPFR_VERSION.tar.xz -fi -if [ ! -f $GMP_VERSION.tar.xz ]; then - wget -nc https://ftp.gnu.org/gnu/gmp/$GMP_VERSION.tar.xz -fi -if [ ! -f $MPC_VERSION.tar.gz ]; then - wget -nc https://ftp.gnu.org/gnu/mpc/$MPC_VERSION.tar.gz -fi -if [ ! -f $ISL_VERSION.tar.bz2 ]; then - wget -nc ftp://gcc.gnu.org/pub/gcc/infrastructure/$ISL_VERSION.tar.bz2 -fi -if [ ! -f $CLOOG_VERSION.tar.gz ]; then - wget -nc ftp://gcc.gnu.org/pub/gcc/infrastructure/$CLOOG_VERSION.tar.gz -fi - - -# Extract everything -echo "Uncompressing toolchain source" -for f in *.tar*; do tar xf $f; done - -# Make symbolic links -cd $GCC_VERSION -ln -sf `ls -1d ../mpfr-*/` mpfr -ln -sf `ls -1d ../gmp-*/` gmp -ln -sf `ls -1d ../mpc-*/` mpc -ln -sf `ls -1d ../isl-*/` isl -ln -sf `ls -1d ../cloog-*/` cloog -cd .. - - -# Step 1. Binutils -mkdir -p build-binutils -cd build-binutils -echo Compiling binutils -../$BINUTILS_VERSION/configure --prefix=$INSTALL_PATH --target=$TARGET $CONFIGURATION_OPTIONS $SYSROOT_OPTIONS &> $BUILDROOT/logs/binutils.log -make $PARALLEL_MAKE &> $BUILDROOT/logs/binutils.log -make install &> $BUILDROOT/logs/binutils.log -cd .. - -# Step 2. Linux Kernel Headers -if [ $USE_NEWLIB -eq 0 ]; then - cd $LINUX_KERNEL_VERSION - echo Compiling headers_install - make ARCH=$LINUX_ARCH INSTALL_HDR_PATH=$INSTALL_PATH/$TARGET headers_install &> $BUILDROOT/logs/headers_install.log - cd .. -fi - -# Step 3. C/C++ Compilers -mkdir -p build-gcc -cd build-gcc -echo Compiling gcc -if [ $USE_NEWLIB -ne 0 ]; then - NEWLIB_OPTION=--with-newlib -fi -../$GCC_VERSION/configure --prefix=$INSTALL_PATH --target=$TARGET --enable-languages=c,c++ --with-float=hard --enable-multiarch --target=arm-linux-gnueabihf $CONFIGURATION_OPTIONS $SYSROOT_OPTIONS &> $SYSROOT/logs/gcc.log -make $PARALLEL_MAKE all-gcc &> $BUILDROOT/logs/gcc.log -make install-gcc &> $BUILDROOT/logs/gcc.log -cd .. - -if [ $USE_NEWLIB -ne 0 ]; then - # Steps 4-6: Newlib - mkdir -p build-newlib - cd build-newlib - echo Compiling newlib - ../newlib-master/configure --prefix=$INSTALL_PATH --target=$TARGET $CONFIGURATION_OPTIONS &> $BUILDROOT/logs/newlib.log - make $PARALLEL_MAKE &> $BUILDROOT/logs/newlib.log - make install &> $BUILDROOT/logs/newlib.log - cd .. -else - # Step 4. Standard C Library Headers and Startup Files - mkdir -p build-glibc - cd build-glibc - echo Compiling glibc - ../$GLIBC_VERSION/configure --prefix=$INSTALL_PATH/$TARGET --build=$MACHTYPE --host=$TARGET --target=$TARGET --with-headers=$INSTALL_PATH/$TARGET/include $CONFIGURATION_OPTIONS libc_cv_forced_unwind=yes &> $BUILDROOT/logs/glibc.log - make install-bootstrap-headers=yes install-headers &> $BUILDROOT/logs/glibc.log - make $PARALLEL_MAKE csu/subdir_lib &> $BUILDROOT/logs/glibc.log - install csu/crt1.o csu/crti.o csu/crtn.o $INSTALL_PATH/$TARGET/lib &> $BUILDROOT/logs/glibc.log - $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $INSTALL_PATH/$TARGET/lib/libc.so &> $BUILDROOT/logs/glibc.log - touch $INSTALL_PATH/$TARGET/include/gnu/stubs.h - cd .. - - # Step 5. Compiler Support Library - cd build-gcc - echo compiling Compiler Support Library - make $PARALLEL_MAKE all-target-libgcc &> $BUILDROOT/logs/gcclib.log - make install-target-libgcc &> $BUILDROOT/logs/gcclib.log - cd .. - - # Step 6. Standard C Library & the rest of Glibc - cd build-glibc - echo comiling rest of glibc - make $PARALLEL_MAKE &> $BUILDROOT/logs/glibc.log - make install &> $BUILDROOT/logs/glibc.log - cd .. -fi - -# Step 7. Standard C++ Library & the rest of GCC -cd build-gcc -echo compiling rest of gcc -make $PARALLEL_MAKE all &> $BUILDROOT/logs/gcc.log -make install &> $BUILDROOT/logs/gcc.log -cd .. - -sed -i "s|${INSTALL_PATH}/arm-linux-gnueabihf/lib/||g" ${INSTALL_PATH}/arm-linux-gnueabihf/lib/libpthread.so -sed -i "s|${INSTALL_PATH}/arm-linux-gnueabihf/lib/||g" ${INSTALL_PATH}/arm-linux-gnueabihf/lib/libc.so - -trap - EXIT -echo 'Success!' diff --git a/scripts/linuxarmv7l/arch-bootstrap.sh b/scripts/linuxarmv7l/arch-bootstrap.sh deleted file mode 100755 index 47eb67ebd..000000000 --- a/scripts/linuxarmv7l/arch-bootstrap.sh +++ /dev/null @@ -1,237 +0,0 @@ -#!/bin/bash -# -# arch-bootstrap: Bootstrap a base Arch Linux system using any GNU distribution. -# -# Dependencies: bash >= 4, coreutils, wget, sed, gawk, tar, gzip, chroot, xz. -# Project: https://github.com/tokland/arch-bootstrap -# -# Install: -# -# # install -m 755 arch-bootstrap.sh /usr/local/bin/arch-bootstrap -# -# Usage: -# -# # arch-bootstrap destination -# # arch-bootstrap -a x86_64 -r ftp://ftp.archlinux.org destination-64 -# -# And then you can chroot to the destination directory (user: root, password: root): -# -# # chroot destination - -#set -e -u -o pipefail - -# Packages needed by pacman (see get-pacman-dependencies.sh) -PACMAN_PACKAGES=( - acl archlinux-keyring attr bzip2 curl expat glibc gpgme libarchive - libassuan libgpg-error libssh2 lzo openssl pacman pacman-mirrorlist xz zlib - krb5 e2fsprogs keyutils libidn gcc-libs -) -BASIC_PACKAGES=(${PACMAN_PACKAGES[*]} filesystem) -EXTRA_PACKAGES=(coreutils bash grep gawk file tar systemd sed) -DEFAULT_REPO_URL="http://mirrors.kernel.org/archlinux" -DEFAULT_ARM_REPO_URL="http://mirror.archlinuxarm.org" - -PACMAN_PACKAGES_ARM=( -acl archlinux-keyring attr bzip2 curl expat glibc gpgme libarchive libassuan libgpg-error libssh2 lzo openssl pacman pacman-mirrorlist xz zlib linux-raspberrypi linux-raspberrypi-headers libutil-linux linux-api-headers linux-firmware krb5 e2fsprogs keyutils libidn gcc-libs coreutils bash grep gawk file tar systemd sed gcc glibc coreutils systemd make pkg-config openal glew freeimage freetype2 libsndfile openssl mesa mesa-libgl fontconfig gstreamer gst-plugins-base gst-plugins-base-libs gst-plugins-good gst-plugins-bad gst-libav assimp boost cairo pixman libpng harfbuzz graphite libdrm libx11 xproto kbproto libxcb libxau libxdmcp libxext xextproto libxdamage damageproto libxfixes fixesproto libxxf86vm xf86vidmodeproto libxrender renderproto alsa-lib flex libxrandr libxi libxcursor libxshmfence wayland opencv libxml2 pugixml libpsl icu -) -BASIC_PACKAGE_ARMS=(${PACMAN_PACKAGES_ARM[*]} filesystem) - -stderr() { - echo "$@" >&2 -} - -debug() { - stderr "--- $@" -} - -extract_href() { - sed -n '/]*href="\([^\"]*\)".*$/\1/p' -} - -fetch() { - curl -L -s "$@" -} - -uncompress() { - local FILEPATH=$1 DEST=$2 - - case "$FILEPATH" in - *.gz) tar xzf "$FILEPATH" -C "$DEST";; - *.xz) xz -dc "$FILEPATH" | tar x -C "$DEST";; - *) debug "Error: unknown package format: $FILEPATH" - return 1;; - esac -} - -### -get_default_repo() { - local ARCH=$1 - if [[ "$ARCH" == arm* ]]; then - echo $DEFAULT_ARM_REPO_URL - else - echo $DEFAULT_REPO_URL - fi -} - -get_core_repo_url() { - local REPO_URL=$1 ARCH=$2 - if [[ "$ARCH" == arm* ]]; then - echo "${REPO_URL%/}/$ARCH/core" - else - echo "${REPO_URL%/}/core/os/$ARCH" - fi -} - -get_template_repo_url() { - local REPO_URL=$1 ARCH=$2 - if [[ "$ARCH" == arm* ]]; then - echo "${REPO_URL%/}/$ARCH" - else - echo "${REPO_URL%/}/\$repo/os/$ARCH" - fi -} - -configure_pacman() { - local DEST=$1 ARCH=$2 - debug "configure DNS and pacman" - cp "/etc/resolv.conf" "$DEST/etc/resolv.conf" - SERVER=$(get_template_repo_url "$REPO_URL" "$ARCH") - echo "Server = $SERVER" >> "$DEST/etc/pacman.d/mirrorlist" -} - -configure_minimal_system() { - local DEST=$1 - - mkdir -p "$DEST/dev" - echo "root:x:0:0:root:/root:/bin/bash" > "$DEST/etc/passwd" - echo 'root:$1$GT9AUpJe$oXANVIjIzcnmOpY07iaGi/:14657::::::' > "$DEST/etc/shadow" - touch "$DEST/etc/group" - echo "bootstrap" > "$DEST/etc/hostname" - - test -e "$DEST/etc/mtab" || echo "rootfs / rootfs rw 0 0" > "$DEST/etc/mtab" - #test -e "$DEST/dev/null" || mknod "$DEST/dev/null" c 1 3 - #test -e "$DEST/dev/random" || mknod -m 0644 "$DEST/dev/random" c 1 8 - #test -e "$DEST/dev/urandom" || mknod -m 0644 "$DEST/dev/urandom" c 1 9 - mount -o bind /dev $DEST/dev - mount -o bind /proc $DEST/proc - - sed -i "s/^[[:space:]]*\(CheckSpace\)/# \1/" "$DEST/etc/pacman.conf" - sed -i "s/^[[:space:]]*SigLevel[[:space:]]*=.*$/SigLevel = Never/" "$DEST/etc/pacman.conf" -} - -install_rpi_image(){ - mkdir -p $DEST/root/archlinux_arm - wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz - tar xzf ArchLinuxARM-rpi-2-latest.tar.gz -C $DEST/root/archlinux_arm - echo "Server = http://eu.mirror.archlinuxarm.org/\$arch/\$repo" > $DEST/etc/pacman.d/mirrorlist - sed -i "s/Architecture = auto/Architecture = armv7h/g" $DEST/etc/pacman.conf - rm $DEST/var/cache/pacman/pkg/* - install_packages_to "armv7h" "$DEST" "${PACMAN_PACKAGES_ARM[*]}" /root/archlinux_arm - umount $DEST/dev - umount $DEST/proc - printf "In $PWD\n" - printf "mv $DEST/root/archlinux_arm archlinux_arm\n" - mv $DEST/root/archlinux_arm archlinux_arm - rm -r $DEST - mv archlinux_arm $DEST -} - -fetch_packages_list() { - local REPO=$1 - - debug "fetch packages list: $REPO/" - fetch "$REPO/" | extract_href | awk -F"/" '{print $NF}' | sort -rn || - { debug "Error: cannot fetch packages list: $REPO"; return 1; } -} - -install_pacman_packages() { - local BASIC_PACKAGES=$1 DEST=$2 LIST=$3 DOWNLOAD_DIR=$4 - debug "pacman package and dependencies: $BASIC_PACKAGES" - - for PACKAGE in $BASIC_PACKAGES; do - local FILE=$(echo "$LIST" | grep -m1 "^$PACKAGE-[[:digit:]].*\(\.gz\|\.xz\)$") - test "$FILE" || { debug "Error: cannot find package: $PACKAGE"; return 1; } - local FILEPATH="$DOWNLOAD_DIR/$FILE" - - debug "download package: $REPO/$FILE" - fetch -o "$FILEPATH" "$REPO/$FILE" - debug "uncompress package: $FILEPATH" - uncompress "$FILEPATH" "$DEST" - done -} - -configure_static_qemu() { - local ARCH=$1 DEST=$2 - [[ "$ARCH" == arm* ]] && ARCH=arm - QEMU_STATIC_BIN=$(which qemu-$ARCH-static || echo ) - [[ -e "$QEMU_STATIC_BIN" ]] ||\ - { debug "no static qemu for $ARCH, ignoring"; return 0; } - cp "$QEMU_STATIC_BIN" "$DEST/usr/bin" -} - -install_packages() { - local ARCH=$1 DEST=$2 PACKAGES=$3 - debug "install packages: $PACKAGES" - LC_ALL=C chroot "$DEST" /usr/bin/pacman \ - --noconfirm --arch $ARCH -Sy --force $PACKAGES -} - -install_packages_to() { - local ARCH=$1 DEST=$2 PACKAGES=$3 TO=$4 - debug "install packages: $PACKAGES" - LC_ALL=C chroot "$DEST" /usr/bin/pacman \ - --noconfirm --arch $ARCH -Sy --force $PACKAGES -r $TO -} - -show_usage() { - stderr "Usage: $(basename "$0") [-q] [-a i686|x86_64|arm] [-r REPO_URL] [-d DOWNLOAD_DIR] DESTDIR" -} - -main() { - # Process arguments and options - test $# -eq 0 && set -- "-h" - local ARCH= - local REPO_URL= - local USE_QEMU= - local DOWNLOAD_DIR= - - while getopts "qa:r:d:h" ARG; do - case "$ARG" in - a) ARCH=$OPTARG;; - r) REPO_URL=$OPTARG;; - q) USE_QEMU=true;; - d) DOWNLOAD_DIR=$OPTARG;; - *) show_usage; return 1;; - esac - done - shift $(($OPTIND-1)) - test $# -eq 1 || { show_usage; return 1; } - - [[ -z "$ARCH" ]] && ARCH=$(uname -m) - [[ -z "$REPO_URL" ]] &&REPO_URL=$(get_default_repo "$ARCH") - - local DEST=$1 - local REPO=$(get_core_repo_url "$REPO_URL" "$ARCH") - [[ -z "$DOWNLOAD_DIR" ]] && DOWNLOAD_DIR=$(mktemp -d) - mkdir -p "$DOWNLOAD_DIR" - [[ "$DOWNLOAD_DIR" ]] && trap "rm -rf '$DOWNLOAD_DIR'" KILL TERM EXIT - debug "destination directory: $DEST" - debug "core repository: $REPO" - debug "temporary directory: $DOWNLOAD_DIR" - - # Fetch packages, install system and do a minimal configuration - mkdir -p "$DEST" - local LIST=$(fetch_packages_list $REPO) - install_pacman_packages "${BASIC_PACKAGES[*]}" "$DEST" "$LIST" "$DOWNLOAD_DIR" - configure_pacman "$DEST" "$ARCH" - configure_minimal_system "$DEST" - [[ -n "$USE_QEMU" ]] && configure_static_qemu "$ARCH" "$DEST" - install_packages "$ARCH" "$DEST" "${BASIC_PACKAGES[*]} ${EXTRA_PACKAGES[*]}" - configure_pacman "$DEST" "$ARCH" # Pacman must be re-configured - [[ "$DOWNLOAD_DIR" ]] && rm -rf "$DOWNLOAD_DIR" - install_rpi_image - - debug "done" -} - -main "$@" diff --git a/scripts/linuxarmv7l/arch-bootstrap_downloadonly.sh b/scripts/linuxarmv7l/arch-bootstrap_downloadonly.sh deleted file mode 100755 index 6eafeea70..000000000 --- a/scripts/linuxarmv7l/arch-bootstrap_downloadonly.sh +++ /dev/null @@ -1,296 +0,0 @@ -#!/bin/bash -# -# arch-bootstrap: Bootstrap a base Arch Linux system using any GNU distribution. -# -# Dependencies: bash >= 4, coreutils, wget, sed, gawk, tar, gzip, chroot, xz. -# Project: https://github.com/tokland/arch-bootstrap -# -# Install: -# -# # install -m 755 arch-bootstrap.sh /usr/local/bin/arch-bootstrap -# -# Usage: -# -# # arch-bootstrap destination -# # arch-bootstrap -a x86_64 -r ftp://ftp.archlinux.org destination-64 -# -# And then you can chroot to the destination directory (user: root, password: root): -# -# # chroot destination - -set -e -u -o pipefail -error() { - local parent_lineno="$1" - local message="$2" - local code="${3:-1}" - if [[ -n "$message" ]] ; then - echo "Error on or near line ${parent_lineno}: ${message}; exiting with status ${code}" - else - echo "Error on or near line ${parent_lineno}; exiting with status ${code}" - fi - exit "${code}" -} -#trap 'error ${LINENO}' ERR - - -# Packages needed by pacman (see get-pacman-dependencies.sh) -# PACMAN_PACKAGES=( -# acl archlinux-keyring attr bzip2 curl expat glibc gpgme libarchive libassuan libgpg-error libssh2 lzo openssl pacman pacman-mirrorlist xz zlib linux-raspberrypi linux-raspberrypi-headers libutil-linux linux-api-headers linux-firmware krb5 e2fsprogs keyutils libidn gcc-libs gcc glibc coreutils systemd make pkg-config openal glew freeimage freetype2 libsndfile openssl mesa fontconfig gstreamer gst-plugins-base gst-plugins-base-libs gst-plugins-good gst-plugins-bad gst-libav assimp boost cairo pixman libpng harfbuzz graphite libdrm libx11 xproto kbproto libxcb libxau libxdmcp libxext xextproto libxdamage damageproto libxfixes fixesproto libxxf86vm xf86vidmodeproto libxrender renderproto alsa-lib flex libxrandr libxi libxcursor libxshmfence wayland opencv glib2 pcre libsystemd filesystem libcap libffi libx11 xorg-server libsm libice libxinerama libxrandr libxext randrproto libxi inputproto glfw-x11 xineramaproto uriparser curl libxml2 pugixml orc libpsl icu -# ) -PACMAN_PACKAGES=( -make pkg-config gcc raspberrypi-firmware -) -BASIC_PACKAGES=(${PACMAN_PACKAGES[*]} ) -EXTRA_PACKAGES=() -declare -A DEPENDENCIES_PACKAGES -INSTALLED=() -DEFAULT_REPO_URL="http://mirrors.kernel.org/archlinux" -DEFAULT_ARM_REPO_URL="http://mirror.archlinuxarm.org" -declare -A ALIASES -ALIASES["sh"]="bash" -ALIASES["libltdl"]="libtool" -ALIASES["libjpeg"]="libjpeg-turbo" -ALIASES["libusbx"]="libusb" -ALIASES["libgl"]="mesa" -ALIASES["opengl-driver"]="mesa" - -stderr() { - echo "$@" >&2 -} - -debug() { - stderr "--- $@" -} - -extract_href() { - sed -n '/]*href="\([^\"]*\)".*$/\1/p' -} - -fetch() { - curl -L -s "$@" -} - -uncompress() { - local FILEPATH=$1 DEST=$2 - - case "$FILEPATH" in - *.gz) tar xzf "$FILEPATH" -C "$DEST" > /dev/null;; - *.xz) xz -dc "$FILEPATH" | tar x -C "$DEST" 2> /dev/null;; - *) debug "Error: unknown package format: $FILEPATH" - return 1;; - esac -} - -### -get_default_repo() { - local ARCH=$1 - if [[ "$ARCH" == arm* ]]; then - echo $DEFAULT_ARM_REPO_URL - else - echo $DEFAULT_REPO_URL - fi -} - -get_repo_url() { - local REPO_URL=$1 ARCH=$2 SUBREPO=$3 - if [[ "$ARCH" == arm* ]]; then - echo "${REPO_URL%/}/$ARCH/$SUBREPO" - else - echo "${REPO_URL%/}/$SUBREPO/os/$ARCH" - fi -} - - -get_template_repo_url() { - local REPO_URL=$1 ARCH=$2 - if [[ "$ARCH" == arm* ]]; then - echo "${REPO_URL%/}/$ARCH" - else - echo "${REPO_URL%/}/\$repo/os/$ARCH" - fi -} - -configure_pacman() { - local DEST=$1 ARCH=$2 - debug "configure DNS and pacman" - cp "/etc/resolv.conf" "$DEST/etc/resolv.conf" - SERVER=$(get_template_repo_url "$REPO_URL" "$ARCH") - echo "Server = $SERVER" >> "$DEST/etc/pacman.d/mirrorlist" -} - -configure_minimal_system() { - local DEST=$1 - - mkdir -p "$DEST/dev" - echo "root:x:0:0:root:/root:/bin/bash" > "$DEST/etc/passwd" - echo 'root:$1$GT9AUpJe$oXANVIjIzcnmOpY07iaGi/:14657::::::' > "$DEST/etc/shadow" - touch "$DEST/etc/group" - echo "bootstrap" > "$DEST/etc/hostname" - - test -e "$DEST/etc/mtab" || echo "rootfs / rootfs rw 0 0" > "$DEST/etc/mtab" - #test -e "$DEST/dev/null" || mknod "$DEST/dev/null" c 1 3 - #test -e "$DEST/dev/random" || mknod -m 0644 "$DEST/dev/random" c 1 8 - #test -e "$DEST/dev/urandom" || mknod -m 0644 "$DEST/dev/urandom" c 1 9 - - sed -i "s/^[[:space:]]*\(CheckSpace\)/# \1/" "$DEST/etc/pacman.conf" - sed -i "s/^[[:space:]]*SigLevel[[:space:]]*=.*$/SigLevel = Never/" "$DEST/etc/pacman.conf" -} - -fetch_packages_list() { - local REPO=$1 - - debug "fetch packages list: $REPO/" - fetch "$REPO/" | extract_href | awk -F"/" '{print $NF}' | sort -rn || - { debug "Error: cannot fetch packages list: $REPO"; return 1; } -} - -parse_dependencies() { - local DEST=$1 - if grep -q ^depend $DEST/.PKGINFO; then - DEPS=`cat $DEST/.PKGINFO | grep -q ^depend | sed "s/^depend = \([^=<>:]*\)\(.*\)/\1/g"` - for DEP in $DEPS; do - if [[ ${ALIASES[$DEP]+foobar} ]]; then - echo "Adding aliased dependency $DEP to ${ALIASES[$DEP]}" - DEP=${ALIASES[$DEP]} - fi - if echo $DEP | grep -qv lib[^.]*\.so; then - DEPENDENCIES_PACKAGES["${DEP##*::}"]=1 - fi - done - fi -} - -install_pacman_packages() { - local BASIC_PACKAGES=$1 DEST=$2 DOWNLOAD_DIR=$3 - debug "pacman package and dependencies: $BASIC_PACKAGES" - - for PACKAGE in $BASIC_PACKAGES; do - local FILE=$(echo "$LIST" | grep -m1 "^$PACKAGE-[[:digit:]].*\(\.gz\|\.xz\)$") - local FILE_EXTRA=$(echo "$LIST_EXTRA" | grep -m1 "^$PACKAGE-[[:digit:]].*\(\.gz\|\.xz\)$") - local FILE_COMMUNITY=$(echo "$LIST_COMMUNITY" | grep -m1 "^$PACKAGE-[[:digit:]].*\(\.gz\|\.xz\)$") - local FILE_ALARM=$(echo "$LIST_ALARM" | grep -m1 "^$PACKAGE-[[:digit:]].*\(\.gz\|\.xz\)$") - DOWNLOAD_REPO=$REPO - if [ ! "$FILE" ]; then - if [ ! "$FILE_EXTRA" ]; then - if [ ! "$FILE_COMMUNITY" ]; then - if [ ! "$FILE_ALARM" ]; then - debug "Error: cannot find package: $PACKAGE"; return 1; - else - DOWNLOAD_REPO=$REPO_ALARM - FILE=$FILE_ALARM - fi - else - DOWNLOAD_REPO=$REPO_COMMUNITY - FILE=$FILE_COMMUNITY - fi - else - DOWNLOAD_REPO=$REPO_EXTRA - FILE=$FILE_EXTRA - fi - fi - - local FILEPATH="$DOWNLOAD_DIR/$FILE" - - debug "download package: $DOWNLOAD_REPO/$FILE" - fetch -o "$FILEPATH" "$DOWNLOAD_REPO/$FILE" - debug "uncompress package: $FILEPATH" - uncompress "$FILEPATH" "$DEST" - debug "parse dependencies package: $FILEPATH" - parse_dependencies "$DEST" - done -} - -configure_static_qemu() { - local ARCH=$1 DEST=$2 - [[ "$ARCH" == arm* ]] && ARCH=arm - QEMU_STATIC_BIN=$(which qemu-$ARCH-static || echo ) - [[ -e "$QEMU_STATIC_BIN" ]] ||\ - { debug "no static qemu for $ARCH, ignoring"; return 0; } - cp "$QEMU_STATIC_BIN" "$DEST/usr/bin" -} - -install_packages() { - local ARCH=$1 DEST=$2 PACKAGES=$3 - debug "install packages: $PACKAGES" - LC_ALL=C chroot "$DEST" /usr/bin/pacman \ - --noconfirm --arch $ARCH -Sy --force $PACKAGES -} - -show_usage() { - stderr "Usage: $(basename "$0") [-q] [-a i686|x86_64|arm] [-r REPO_URL] [-d DOWNLOAD_DIR] DESTDIR" -} - -main() { - # Process arguments and options - test $# -eq 0 && set -- "-h" - local ARCH= - local REPO_URL= - local USE_QEMU= - local DOWNLOAD_DIR= - - while getopts "qa:r:d:h" ARG; do - case "$ARG" in - a) ARCH=$OPTARG;; - r) REPO_URL=$OPTARG;; - q) USE_QEMU=true;; - d) DOWNLOAD_DIR=$OPTARG;; - *) show_usage; return 1;; - esac - done - shift $(($OPTIND-1)) - test $# -eq 1 || { show_usage; return 1; } - - [[ -z "$ARCH" ]] && ARCH=$(uname -m) - [[ -z "$REPO_URL" ]] &&REPO_URL=$(get_default_repo "$ARCH") - - local DEST=$1 - local REPO=$(get_repo_url "$REPO_URL" "$ARCH" "core") - local REPO_EXTRA=$(get_repo_url "$REPO_URL" "$ARCH" "extra") - local REPO_COMMUNITY=$(get_repo_url "$REPO_URL" "$ARCH" "community") - local REPO_ALARM=$(get_repo_url "$REPO_URL" "$ARCH" "alarm") - [[ -z "$DOWNLOAD_DIR" ]] && DOWNLOAD_DIR=$(mktemp -d) - mkdir -p "$DOWNLOAD_DIR" - [[ "$DOWNLOAD_DIR" ]] && trap "rm -rf '$DOWNLOAD_DIR'" KILL TERM EXIT - debug "destination directory: $DEST" - debug "core repository: $REPO" - debug "temporary directory: $DOWNLOAD_DIR" - - # Fetch packages, install system and do a minimal configuration - mkdir -p "$DEST" - local LIST=$(fetch_packages_list $REPO) - local LIST_EXTRA=$(fetch_packages_list $REPO_EXTRA) - local LIST_COMMUNITY=$(fetch_packages_list $REPO_COMMUNITY) - local LIST_ALARM=$(fetch_packages_list $REPO_ALARM) - install_pacman_packages "${BASIC_PACKAGES[*]}" "$DEST" "$DOWNLOAD_DIR" - for DEP in ${BASIC_PACKAGES[*]}; do - INSTALLED+=($DEP) - done - while [ ${#DEPENDENCIES_PACKAGES[@]} -ne 0 ]; do - for DEP in ${INSTALLED[*]}; do - unset -v DEPENDENCIES_PACKAGES[\$DEP] - done - # unique values - NEW_DEPENDENCIES=() - for DEP in ${!DEPENDENCIES_PACKAGES[@]}; do - NEW_DEPENDENCIES+=($DEP) - done - DEPENDENCIES_PACKAGES=() - - if [ ${#NEW_DEPENDENCIES[@]} -ne 0 ]; then - install_pacman_packages "${NEW_DEPENDENCIES[*]}" "$DEST" "$DOWNLOAD_DIR" - for DEP in ${NEW_DEPENDENCIES[*]}; do - INSTALLED+=($DEP) - done - fi - done - #configure_pacman "$DEST" "$ARCH" - #configure_minimal_system "$DEST" - #[[ -n "$USE_QEMU" ]] && configure_static_qemu "$ARCH" "$DEST" - #install_packages "$ARCH" "$DEST" "${BASIC_PACKAGES[*]}" - #configure_pacman "$DEST" "$ARCH" # Pacman must be re-configured - #[[ "$DOWNLOAD_DIR" ]] && rm -rf "$DOWNLOAD_DIR" - - debug "done" -} - -main "$@" diff --git a/scripts/linuxarmv7l/install.sh b/scripts/linuxarmv7l/install.sh deleted file mode 100755 index e9456e338..000000000 --- a/scripts/linuxarmv7l/install.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -#set -e -#set -o pipefail -# trap any script errors and exit -trap "trapError" ERR - -SUDO= - -trapError() { - echo - echo " ^ Received error ^" - exit 1 -} - -createArchImg(){ - - sudo add-apt-repository ppa:dns/gnu -y - sudo apt-get update -q - sudo apt-get install -y coreutils gperf - sudo apt-get update && sudo apt-get install -y autoconf libtool automake - mkdir ~/archlinux - cd ~/archlinux - wget -v http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz - - #./arch-bootstrap_downloadonly.sh -a armv7h -r "http://eu.mirror.archlinuxarm.org/" archlinux - junest -- < /dev/null - sed -i s_/etc/pacman_$HOME/archlinux/etc/pacman_g ~/archlinux/etc/pacman.conf - pacman --noconfirm -r ~/archlinux/ --config ~/archlinux/etc/pacman.conf --arch=armv7h -Syu - pacman --noconfirm -r ~/archlinux/ --config ~/archlinux/etc/pacman.conf --arch=armv7h -S make pkg-config gcc raspberrypi-firmware -EOF - touch $HOME/archlinux/timestamp -} - -downloadToolchain(){ - wget "https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Bookworm/GCC%2014.2.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-14.2.0-pi_0-1.tar.gz/download" -O cross-gcc-14.2.0-pi_0-1.tar.gz && tar xf cross-gcc-14.2.0-pi_0-1.tar.gz && rm cross-gcc-14.2.0-pi_0-1.tar.gz && mv cross-pi-gcc-14.2.0-0 raspbianpi1zero - -} - -downloadFirmware(){ - echo "no firmware" - # wget -q https://github.com/raspberrypi/firmware/archive/master.zip -O firmware.zip - # unzip -q firmware.zip - # ${SUDO} cp -r firmware-master/opt archlinux/ - # rm -r firmware-master - # rm firmware.zip -} - - -relativeSoftLinks(){ - rel_link=$1 - escaped_rel_link=$2 - for link in $(ls -la | grep "\-> /" | sed "s/.* \([^ ]*\) \-> \/\(.*\)/\1->\/\2/g"); do - lib=$(echo $link | sed "s/\(.*\)\->\(.*\)/\1/g"); - link=$(echo $link | sed "s/\(.*\)\->\(.*\)/\2/g"); - ${SUDO} rm $lib - ${SUDO} ln -s ${rel_link}/${link} $lib - done - - for f in *; do - error_lib=$(grep " \/lib/" $f > /dev/null 2>&1; echo $?) - error_usr=$(grep " \/usr/" $f > /dev/null 2>&1; echo $?) - if [ $error_lib -eq 0 ] || [ $error_usr -eq 0 ]; then - ${SUDO} sed -i "s/ \/lib/ $escaped_rel_link\/lib/g" $f - ${SUDO} sed -i "s/ \/usr/ $escaped_rel_link\/usr/g" $f - fi - done -} - -installJunest(){ - git clone https://github.com/fsquillace/junest ~/.local/share/junest - export PATH=~/.local/share/junest/bin:$PATH - junest setup - junest -- << EOF - echo updating keys - sudo pacman -S gnupg --noconfirm - sudo pacman-key --populate archlinux - sudo pacman-key --refresh-keys - echo updating packages - sudo pacman -Syyu --noconfirm - sudo pacman -S --noconfirm git flex grep gcc pkg-config make wget sed -EOF -} - -if [[ $(uname -m) != armv* ]]; then - - ROOT=$( cd "$(dirname "$0")" ; pwd -P ) - echo $ROOT - cd $ROOT - # installJunest - # createArchImg - # downloadFirmware - downloadToolchain - - #cd $HOME/archlinux/usr/lib - #relativeSoftLinks "../.." "..\/.." - #cd $ROOT/archlinux/usr/lib/arm-unknown-linux-gnueabihf - #relativeSoftLinks "../../.." "..\/..\/.." - #cd $ROOT/raspbian/usr/lib/gcc/arm-unknown-linux-gnueabihf/5.3 - #relativeSoftLinks "../../../.." "..\/..\/..\/.." - -fi diff --git a/scripts/linuxarmv7l/multistrap.conf b/scripts/linuxarmv7l/multistrap.conf new file mode 100644 index 000000000..d20a57732 --- /dev/null +++ b/scripts/linuxarmv7l/multistrap.conf @@ -0,0 +1,29 @@ +[General] +arch=armhf +directory=raspbian +cleanup=true +noauth=true +unpack=true +aptsources=Raspbian-Base OpenFrameworks +debootstrap=Raspbian-Base OpenFrameworks + +[Raspbian-Bare] +packages=busybox busybox-syslogd udhcpc +source=http://archive.raspbian.org/raspbian +keyring=raspbian-archive-keyring +components=main contrib non-free rpi +suite=buster + +[Raspbian-Base] +packages=base-files dbus dpkg dropbear initscripts iputils-ping isc-dhcp-client kmod login locales lsb-base lsb-release makedev netbase net-tools sysvinit-utils sysv-rc udev +source=http://archive.raspbian.org/raspbian +keyring=raspbian-archive-keyring +components=main contrib non-free rpi +suite=buster + +[OpenFrameworks] +packages=libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libssl-dev libpulse-dev libusb-1.0-0-dev libopencv-dev libegl1-mesa-dev libgles2-mesa-dev libassimp-dev librtaudio-dev libboost-filesystem-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-x gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good libxml2-dev +source=http://archive.raspbian.org/raspbian +keyring=raspbian-archive-keyring +components=main contrib non-free rpi +suite=buster From 70bcd4345682bdac197c818960b390b2bf712bb6 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 19:18:57 +1100 Subject: [PATCH 52/78] Linux Wayland fix GLFW. toolchains updated - rpi added android toolchain. added linux64 toolchain 64 --- .github/disabled/build-linux-arm.yml | 163 ------------------ .../{disabled => workflows}/build-linux64.yml | 0 apothecary/formulas/glfw.sh | 74 +++++--- .../toolchains/android-clang.toolchain.cmake | 106 ++++++++++++ apothecary/toolchains/linux64.toolchain.cmake | 59 +++++++ .../linuxaarch64-clang.toolchain.cmake | 20 ++- .../linuxarmv6l-clang.toolchain.cmake | 19 ++ .../linuxarmv7l-clang.toolchain.cmake | 19 ++ 8 files changed, 268 insertions(+), 192 deletions(-) delete mode 100644 .github/disabled/build-linux-arm.yml rename .github/{disabled => workflows}/build-linux64.yml (100%) create mode 100644 apothecary/toolchains/android-clang.toolchain.cmake create mode 100644 apothecary/toolchains/linux64.toolchain.cmake diff --git a/.github/disabled/build-linux-arm.yml b/.github/disabled/build-linux-arm.yml deleted file mode 100644 index 5531348fb..000000000 --- a/.github/disabled/build-linux-arm.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: build-linux-arm -on: - push: - paths-ignore: - - "**/README.md" - pull_request: - paths-ignore: - - "**/README.md" - - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - # build-linux-arm6: - # runs-on: ubuntu-latest - # env: - # TARGET: "linuxarmv6l" - # SYSROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/raspbian" - # TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/rpi_toolchain" - # TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" - # steps: - # - uses: actions/checkout@v4 - # - name: Scripts Calc Formula - # run: ./scripts/calculate_formulas.sh - # - name: Scripts Install - # run: ./scripts/$TARGET/install.sh - # - name: build - # run: ./scripts/build.sh - # env: - # GA_CI_SECRET: ${{ secrets.CI_SECRET }} - # - name: Update Release - # uses: johnwbyrd/update-release@v1.0.0 - # with: - # token: ${{ secrets.GITHUB_TOKEN }} - # tag: nightly - # release: nightly - # prerelease: false - # files: out/openFrameworksLibs_linuxarmv6l.tar.bz2 - # if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' - build-linux-aarch64: - runs-on: ubuntu-latest - env: - TARGET: "linuxaarch64" - SYSROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxaarch64/raspbian" - TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxaarch64/rpi_toolchain" - TOOLCHAIN_PREFIX: "aarch64-linux-gnu" - steps: - - name: Determine Release - id: vars - shell: bash - run: | - if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then - echo "release=nightly" >> $GITHUB_ENV - echo "prerelease=false" >> $GITHUB_ENV - elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then - echo "release=bleeding" >> $GITHUB_ENV - echo "prerelease=true" >> $GITHUB_ENV - fi - - uses: actions/checkout@v4 - - name: Scripts Calc Formula - run: ./scripts/calculate_formulas.sh - - name: Scripts Install - run: ./scripts/$TARGET/install.sh - - name: build - run: ./scripts/build.sh - env: - GA_CI_SECRET: ${{ secrets.CI_SECRET }} - - name: Package - working-directory: ${{ env.GITHUB_WORKSPACE }} - run: scripts/package.sh - env: - BUNDLE: ${{ matrix.bundle }} - GA_CI_SECRET: ${{ secrets.CI_SECRET }} - - name: Update Release - uses: johnwbyrd/update-release@v1.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ steps.vars.outputs.tag }} - release: ${{ steps.vars.outputs.release }} - prerelease: false - files: out/openFrameworksLibs_linuxaarch64.tar.bz2 - if: (github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')) - -#old -# build-linux-aarch64: -# runs-on: ubuntu-latest -# env: -# TARGET: linuxaarch64 -# WORKDIR: "/home/runner/work/apothecary/apothecary" -# SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian" -# TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" -# TOOLCHAIN_PREFIX: "aarch64-linux-gnu" -# steps: -# - uses: actions/checkout@v4 -# -# - name: Cache raspbian folder -# uses: actions/cache@v2 -# with: -# path: /home/runner/work/apothecary/apothecary/raspbian -# key: raspbian-cache-2 -# -# - name: Check if folder exists -# id: folder-check -# run: > -# if [ -d $SYSROOT ]; then -# echo "Raspbian folder already exists. Skipping download and extract." -# echo "::set-output name=folder-exists::true" -# else -# echo "::set-output name=folder-exists::false" -# fi -# -# - name: Download and extract tar file -# if: steps.folder-check.outputs.folder-exists == 'false' -# run: > -# cd $WORKDIR && -# wget https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Bullseye/GCC%2010.3.0/cross-gcc-10.3.0-pi_64.tar.gz -# --no-check-certificate && -# tar xf cross-gcc-10.3.0-pi_64.tar.gz && -# rm cross-gcc-10.3.0-pi_64.tar.gz && -# mv cross-pi-gcc-10.3.0-64 raspbian -# -# - name: Script Install and Build -# run: ./scripts/$TARGET/install_and_build.sh -# - name: Update Release -# uses: johnwbyrd/update-release@v1.0.0 -# with: -# token: ${{ secrets.GITHUB_TOKEN }} -# tag: nightly -# release: nightly -# prerelease: false -# files: out/openFrameworksLibs_master_linuxaarch64.tar.bz2 -# if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' -# - -# build-linux-arm7: -# runs-on: ubuntu-latest -# environment: CI -# env: -# TARGET: "linuxarmv7l" -# SYSROOT: "/home/runner/archlinux" -# TOOLCHAIN_ROOT: "/home/runner/rpi2_toolchain" -# TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" -# steps: -# - uses: actions/checkout@v4 -# - name: Scripts Calc Formula -# run: ./scripts/calculate_formulas.sh -# - name: Scripts Install -# run: ./scripts/$TARGET/install.sh -# - name: build -# run: ./scripts/build.sh -# env: -# GA_CI_SECRET: ${{ secrets.CI_SECRET }} -# - name: Update Release -# uses: johnwbyrd/update-release@v1.0.0 -# with: -# token: ${{ secrets.GITHUB_TOKEN }} -# tag: nightly -# release: nightly -# prerelease: false -# files: out/openFrameworksLibs_master_linuxarmv7l.tar.bz2 -# if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' diff --git a/.github/disabled/build-linux64.yml b/.github/workflows/build-linux64.yml similarity index 100% rename from .github/disabled/build-linux64.yml rename to .github/workflows/build-linux64.yml diff --git a/apothecary/formulas/glfw.sh b/apothecary/formulas/glfw.sh index 081a35b5e..bd538522e 100644 --- a/apothecary/formulas/glfw.sh +++ b/apothecary/formulas/glfw.sh @@ -6,15 +6,10 @@ # # uses a CMake build system -FORMULA_TYPES=( "osx" "vs" ) +FORMULA_TYPES=( "osx" "vs" "linux" "linux64") FORMULA_DEPENDS=( ) -# define the version by branch -# VER=2018-cmake-fix -# tools for git use -# GIT_URL=https://github.com/ofTheo/glfw/ GIT_URL=https://github.com/glfw/glfw -# VER=master VER=3.4 GIT_BRANCH=$VER BUILD_ID=1 @@ -55,12 +50,9 @@ function build() { GENERATOR_NAME="Visual Studio ${VS_VER_GEN}" mkdir -p "build_${TYPE}_${ARCH}" cd "build_${TYPE}_${ARCH}" - rm -f CMakeCache.txt *.o *.lib - ZLIB_ROOT="$LIBS_ROOT/zlib/" - ZLIB_INCLUDE_DIR="$LIBS_ROOT/zlib/include" - ZLIB_LIBRARY="$LIBS_ROOT/zlib/lib/$TYPE/$PLATFORM/zlib.lib" + rm -f CMakeCache.txt *.o *.lib - DEFS=" + DEFINES=" -DCMAKE_VERBOSE_MAKEFILE=${VERBOSE_MAKEFILE} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_C_STANDARD=${C_STANDARD} \ @@ -72,7 +64,7 @@ function build() { -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ -DCMAKE_INSTALL_INCLUDEDIR=include" - cmake .. ${DEFS} \ + cmake .. ${DEFINES} \ -DLIBRARY_SUFFIX=${ARCH} \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1" \ @@ -96,9 +88,9 @@ function build() { elif [ "$TYPE" == "osx" ] ; then if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh - EXTRA_CONFIG="-DGLFW_USE_EGL=1 -DGLFW_CLIENT_LIBRARY=glesv2 -DCMAKE_LIBRARY_PATH=$SYSROOT/usr/lib -DCMAKE_INCLUDE_PATH=$SYSROOT/usr/include" + DEFINES="-DGLFW_USE_EGL=1 -DGLFW_CLIENT_LIBRARY=glesv2 -DCMAKE_LIBRARY_PATH=$SYSROOT/usr/lib -DCMAKE_INCLUDE_PATH=$SYSROOT/usr/include" else - EXTRA_CONFIG=" " + DEFINES=" " fi # *nix build system @@ -106,8 +98,6 @@ function build() { cd "build_${TYPE}_${PLATFORM}" rm -f CMakeCache.txt *.o *.a - # OS X needs both arches specified to be universal - # for some reason it doesn't build if passed through EXTRA_CONFIG so have do break it up into a separate cmake call cmake .. -DGLFW_BUILD_DOCS=OFF \ -DGLFW_BUILD_TESTS=OFF \ -DGLFW_BUILD_EXAMPLES=OFF \ @@ -132,25 +122,58 @@ function build() { -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ -DCMAKE_INSTALL_INCLUDEDIR=include \ -DCMAKE_INSTALL_LIBDIR=lib \ - $EXTRA_CONFIG + $DEFINES cmake --build . --config Release --target install cd .. + if [[ "$TYPE" =~ ^(linux|linux64)$ ]]; then + if [ $CROSSCOMPILING -eq 1 ]; then + source ../../${TYPE}_configure.sh + DEFINES="-DGLFW_USE_EGL=1 -DGLFW_CLIENT_LIBRARY=glesv2 -DCMAKE_LIBRARY_PATH=$SYSROOT/usr/lib -DCMAKE_INCLUDE_PATH=$SYSROOT/usr/include -DGLFW_BUILD_WAYLAND=OFF" + else + DEFINES="-DGLFW_BUILD_WAYLAND=OFF" + fi + mkdir -p "build_${TYPE}_${PLATFORM}" + cd "build_${TYPE}_${PLATFORM}" + rm -f CMakeCache.txt *.o *.a + + # OS X needs both arches specified to be universal + # for some reason it doesn't build if passed through EXTRA_CONFIG so have do break it up into a separate cmake call + cmake .. -DGLFW_BUILD_DOCS=OFF \ + -DGLFW_BUILD_TESTS=OFF \ + -DGLFW_BUILD_EXAMPLES=OFF \ + -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}.toolchain.cmake \ + -DPLATFORM=$PLATFORM \ + -DCMAKE_PREFIX_PATH="${LIBS_ROOT}" \ + -DDEPLOYMENT_TARGET=${MIN_SDK_VER} \ + -DCMAKE_CXX_FLAGS="-fPIC ${FLAG_RELEASE}" \ + -DCMAKE_C_FLAGS="-fPIC ${FLAG_RELEASE}" \ + -DENABLE_VISIBILITY=OFF \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + -DCMAKE_VERBOSE_MAKEFILE=${VERBOSE_MAKEFILE} \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_STANDARD=${C_STANDARD} \ + -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ + -DCMAKE_CXX_STANDARD_REQUIRED=ON \ + -DCMAKE_CXX_EXTENSIONS=OFF \ + -DCMAKE_INSTALL_PREFIX=Release \ + -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ + -DCMAKE_INSTALL_INCLUDEDIR=include \ + -DCMAKE_INSTALL_LIBDIR=lib \ + $DEFINES + cmake --build . --config Release --target install + cd .. else if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh - EXTRA_CONFIG="-DGLFW_USE_EGL=1 -DGLFW_CLIENT_LIBRARY=glesv2 -DCMAKE_LIBRARY_PATH=$SYSROOT/usr/lib -DCMAKE_INCLUDE_PATH=$SYSROOT/usr/include" + DEFINES="-DGLFW_USE_EGL=1 -DGLFW_CLIENT_LIBRARY=glesv2 -DCMAKE_LIBRARY_PATH=$SYSROOT/usr/lib -DCMAKE_INCLUDE_PATH=$SYSROOT/usr/include" else - EXTRA_CONFIG=" " + DEFINES=" " fi - # *nix build system - mkdir -p build cd build - - # OS X needs both arches specified to be universal - # for some reason it doesn't build if passed through EXTRA_CONFIG so have do break it up into a separate cmake call cmake .. -DGLFW_BUILD_DOCS=OFF \ -DGLFW_BUILD_TESTS=OFF \ -DGLFW_BUILD_EXAMPLES=OFF \ @@ -160,8 +183,7 @@ function build() { -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_EXTENSIONS=OFF \ - $EXTRA_CONFIG - + $DEFINES make clean make -j${PARALLEL_MAKE} diff --git a/apothecary/toolchains/android-clang.toolchain.cmake b/apothecary/toolchains/android-clang.toolchain.cmake new file mode 100644 index 000000000..b5b5965b2 --- /dev/null +++ b/apothecary/toolchains/android-clang.toolchain.cmake @@ -0,0 +1,106 @@ +# Android Toolchain CMake Configuration +cmake_minimum_required(VERSION 3.10) + +# Add additional flags or settings if needed +set(CMAKE_ANDROID_STL_TYPE "c++_shared") # Adjust STL type if needed + +if(NOT DEFINED C_STANDARD) + set(C_STANDARD 17) # Default to C17 +endif() +if(NOT DEFINED CPP_STANDARD) + set(CPP_STANDARD 17) # Default to C++17 +endif() +set(CMAKE_C_STANDARD ${C_STANDARD}) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# User-defined inputs for ABI and NDK path +if(NOT DEFINED ANDROID_ABI) + message(FATAL_ERROR "ANDROID_ABI must be specified (e.g., armeabi-v7a, arm64-v8a, x86, x86_64)") +endif() + +if(NOT DEFINED NDK_ROOT) + message(FATAL_ERROR "NDK_ROOT must be specified as the path to the Android NDK") +endif() + +# Detect Host Platform +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(HOST_PLATFORM "darwin-x86_64") +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(HOST_PLATFORM "windows-x86_64") +else() + set(HOST_PLATFORM "linux-x86_64") +endif() + +message(STATUS "Detected Host Platform: ${HOST_PLATFORM}") + +# NDK Configuration +set(TOOLCHAIN_TYPE "llvm") +set(TOOLCHAIN "${NDK_ROOT}/toolchains/${TOOLCHAIN_TYPE}/prebuilt/${HOST_PLATFORM}") +set(SYSROOT "${TOOLCHAIN}/sysroot") + +# ABI-specific configuration +if(ANDROID_ABI STREQUAL "armeabi-v7a") + set(MACHINE "armv7") + set(ANDROID_PREFIX "arm-linux-androideabi") + set(CMAKE_ANDROID_ARM_MODE ON) + set(CMAKE_ANDROID_ARM_NEON ON) + set(CMAKE_SYSTEM_PROCESSOR "arm") + set(CMAKE_C_FLAGS "-mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard") + set(CMAKE_CXX_FLAGS "-mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard") +elseif(ANDROID_ABI STREQUAL "arm64-v8a") + set(MACHINE "arm64") + set(ANDROID_PREFIX "aarch64-linux-android") + set(CMAKE_SYSTEM_PROCESSOR "aarch64") +elseif(ANDROID_ABI STREQUAL "x86") + set(MACHINE "i686") + set(ANDROID_PREFIX "i686-linux-android") + set(CMAKE_SYSTEM_PROCESSOR "x86") +elseif(ANDROID_ABI STREQUAL "x86_64") + set(MACHINE "x86_64") + set(ANDROID_PREFIX "x86_64-linux-android") + set(CMAKE_SYSTEM_PROCESSOR "x86_64") +else() + message(FATAL_ERROR "Unsupported ANDROID_ABI: ${ANDROID_ABI}") +endif() + +message(STATUS "Configuring for ABI: ${ANDROID_ABI}") +message(STATUS "Machine: ${MACHINE}") +message(STATUS "Android Prefix: ${ANDROID_PREFIX}") + +# Set compilers +set(CMAKE_C_COMPILER "${TOOLCHAIN}/bin/${ANDROID_PREFIX}${CMAKE_ANDROID_API}-clang") +set(CMAKE_CXX_COMPILER "${TOOLCHAIN}/bin/${ANDROID_PREFIX}${CMAKE_ANDROID_API}-clang++") +set(CMAKE_LINKER "${TOOLCHAIN}/bin/${ANDROID_PREFIX}${CMAKE_ANDROID_API}-ld") + +# Paths +set(CMAKE_SYSROOT ${SYSROOT}) +set(CMAKE_FIND_ROOT_PATH ${SYSROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# Include and library paths +set(CMAKE_INCLUDE_PATH "${SYSROOT}/usr/include") +set(CMAKE_LIBRARY_PATH "${SYSROOT}/usr/lib/${ANDROID_PREFIX}/${CMAKE_ANDROID_API}") + +# Toolchain Debug Output +message(STATUS "NDK Root: ${NDK_ROOT}") +message(STATUS "Sysroot: ${SYSROOT}") +message(STATUS "Toolchain Path: ${TOOLCHAIN}") +message(STATUS "C Compiler: ${CMAKE_C_COMPILER}") +message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}") +message(STATUS "Linker: ${CMAKE_LINKER}") + +# Finalize toolchain settings +set(CMAKE_SYSTEM_NAME "Android") +set(CMAKE_SYSTEM_VERSION ${CMAKE_ANDROID_API}) +set(CMAKE_ANDROID_NDK ${NDK_ROOT}) + +if(NOT EXISTS ${CMAKE_C_COMPILER}) + message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") +endif() +if(NOT EXISTS ${CMAKE_CXX_COMPILER}) + message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") +endif() diff --git a/apothecary/toolchains/linux64.toolchain.cmake b/apothecary/toolchains/linux64.toolchain.cmake new file mode 100644 index 000000000..57e1ea085 --- /dev/null +++ b/apothecary/toolchains/linux64.toolchain.cmake @@ -0,0 +1,59 @@ +# Linux Ubuntu 64-bit Toolchain File + +# Specify the system +set(CMAKE_SYSTEM_NAME Linux) # Cross-compilation target system +set(CMAKE_SYSTEM_PROCESSOR x86_64) # Architecture (64-bit) + +set(CMAKE_VERBOSE_MAKEFILE ON) + +# GCC Version (Set this variable when invoking CMake) +if(NOT DEFINED GCC_VERSION) + message(FATAL_ERROR "Please specify GCC_VERSION (e.g., -DGCC_VERSION=11)") +endif() + +# Path to GCC +if(NOT DEFINED GCC_PATH) + set(GCC_PATH "/usr/bin") # Default GCC path +endif() + +if(NOT DEFINED C_STANDARD) + set(C_STANDARD 17) # Default to C17 +endif() +if(NOT DEFINED CPP_STANDARD) + set(CPP_STANDARD 17) # Default to C++17 +endif() +set(CMAKE_C_STANDARD ${C_STANDARD}) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Compiler Binary Paths +set(CMAKE_C_COMPILER "${GCC_PATH}/gcc-${GCC_VERSION}") +set(CMAKE_CXX_COMPILER "${GCC_PATH}/g++-${GCC_VERSION}") + +# Check for the existence of the specified GCC version +if(NOT EXISTS ${CMAKE_C_COMPILER}) + message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") +endif() +if(NOT EXISTS ${CMAKE_CXX_COMPILER}) + message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") +endif() + +# Paths to system libraries and includes +set(CMAKE_SYSROOT "/usr") # Base system path for includes and libraries +set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +# Compiler and linker flags +set(CMAKE_C_FLAGS "-fPIC -O3 -Wall -Wextra -march=x86-64 -mtune=generic") +set(CMAKE_CXX_FLAGS "-fPIC -O3 -Wall -Wextra -std=c++17 -march=x86-64 -mtune=generic") +set(CMAKE_EXE_LINKER_FLAGS "-fPIE -pie") +set(CMAKE_SHARED_LINKER_FLAGS "-shared -fPIC") + + +message(STATUS "Using GCC Version: ${GCC_VERSION}") +message(STATUS "C Compiler: ${CMAKE_C_COMPILER}") +message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}") +message(STATUS "System Root: ${CMAKE_SYSROOT}") diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index ac33d864f..5c3d04d11 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -8,10 +8,16 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64) set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) set(GCC_VERSION 14.2.0) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_STANDARD 17) +if(NOT DEFINED C_STANDARD) + set(C_STANDARD 17) # Default to C17 +endif() +if(NOT DEFINED CPP_STANDARD) + set(CPP_STANDARD 17) # Default to C++17 +endif() +set(CMAKE_C_STANDARD ${C_STANDARD}) set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) +set(CMAKE_CXX_STANDARD_REQUIRED ON) set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. @@ -45,6 +51,14 @@ set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler too set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) +if(NOT EXISTS ${CMAKE_C_COMPILER}) + message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") +endif() + +if(NOT EXISTS ${CMAKE_CXX_COMPILER}) + message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") +endif() + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index 668082a3a..ab134abea 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -15,6 +15,17 @@ set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) +if(NOT DEFINED C_STANDARD) + set(C_STANDARD 17) # Default to C17 +endif() +if(NOT DEFINED CPP_STANDARD) + set(CPP_STANDARD 17) # Default to C++17 +endif() +set(CMAKE_C_STANDARD ${C_STANDARD}) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ @@ -41,6 +52,14 @@ set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler too set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) +if(NOT EXISTS ${CMAKE_C_COMPILER}) + message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") +endif() + +if(NOT EXISTS ${CMAKE_CXX_COMPILER}) + message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") +endif() + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index 62fe85b15..28521bd8f 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -15,6 +15,17 @@ set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) +if(NOT DEFINED C_STANDARD) + set(C_STANDARD 17) # Default to C17 +endif() +if(NOT DEFINED CPP_STANDARD) + set(CPP_STANDARD 17) # Default to C++17 +endif() +set(CMAKE_C_STANDARD ${C_STANDARD}) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${CMAKE_SYSROOT}/lib \ -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ @@ -42,6 +53,14 @@ set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler too set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) +if(NOT EXISTS ${CMAKE_C_COMPILER}) + message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") +endif() + +if(NOT EXISTS ${CMAKE_CXX_COMPILER}) + message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") +endif() + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) From b9afc347ad4e22e887a6bc46292f71ffc00896ee Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 19:23:54 +1100 Subject: [PATCH 53/78] GLFW fix --- apothecary/formulas/glfw.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apothecary/formulas/glfw.sh b/apothecary/formulas/glfw.sh index bd538522e..3ff2e7844 100644 --- a/apothecary/formulas/glfw.sh +++ b/apothecary/formulas/glfw.sh @@ -62,7 +62,11 @@ function build() { -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \ - -DCMAKE_INSTALL_INCLUDEDIR=include" + -DCMAKE_INSTALL_INCLUDEDIR=include \ + -DGLFW_BUILD_EXAMPLES=OFF \ + -DGLFW_BUILD_TESTS=OFF \ + -DGLFW_BUILD_DOCS=OFF \ + -DGLFW_VULKAN_STATIC=OFF" cmake .. ${DEFINES} \ -DLIBRARY_SUFFIX=${ARCH} \ @@ -72,11 +76,7 @@ function build() { -DCMAKE_C_FLAGS_RELEASE="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ -DCMAKE_CXX_EXTENSIONS=OFF \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_LIBDIR="lib" \ - -DGLFW_BUILD_EXAMPLES=OFF \ - -DGLFW_BUILD_TESTS=OFF \ - -DGLFW_BUILD_DOCS=OFF \ - -DGLFW_VULKAN_STATIC=OFF \ + -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ ${CMAKE_WIN_SDK} \ -A "${PLATFORM}" \ @@ -94,14 +94,15 @@ function build() { fi # *nix build system + DEFINES="${DEFINES} -DGLFW_BUILD_DOCS=OFF \ + -DGLFW_BUILD_TESTS=OFF \ + -DGLFW_BUILD_EXAMPLES=OFF" + mkdir -p "build_${TYPE}_${PLATFORM}" cd "build_${TYPE}_${PLATFORM}" rm -f CMakeCache.txt *.o *.a - cmake .. -DGLFW_BUILD_DOCS=OFF \ - -DGLFW_BUILD_TESTS=OFF \ - -DGLFW_BUILD_EXAMPLES=OFF \ - -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/ios.toolchain.cmake \ + cmake .. -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/ios.toolchain.cmake \ -DPLATFORM=$PLATFORM \ -DCMAKE_PREFIX_PATH="${LIBS_ROOT}" \ -DENABLE_BITCODE=OFF \ @@ -126,7 +127,7 @@ function build() { cmake --build . --config Release --target install cd .. - if [[ "$TYPE" =~ ^(linux|linux64)$ ]]; then + elif [[ "$TYPE" =~ ^(linux|linux64)$ ]]; then if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh DEFINES="-DGLFW_USE_EGL=1 -DGLFW_CLIENT_LIBRARY=glesv2 -DCMAKE_LIBRARY_PATH=$SYSROOT/usr/lib -DCMAKE_INCLUDE_PATH=$SYSROOT/usr/include -DGLFW_BUILD_WAYLAND=OFF" @@ -164,7 +165,6 @@ function build() { $DEFINES cmake --build . --config Release --target install cd .. - else if [ $CROSSCOMPILING -eq 1 ]; then source ../../${TYPE}_configure.sh From 20108a76374b3695c2b2eee35ebfdefe6cb1a71f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 19:55:47 +1100 Subject: [PATCH 54/78] GLFW fix - build id 2 --- apothecary/formulas/glfw.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apothecary/formulas/glfw.sh b/apothecary/formulas/glfw.sh index 3ff2e7844..ce557a089 100644 --- a/apothecary/formulas/glfw.sh +++ b/apothecary/formulas/glfw.sh @@ -12,7 +12,7 @@ FORMULA_DEPENDS=( ) GIT_URL=https://github.com/glfw/glfw VER=3.4 GIT_BRANCH=$VER -BUILD_ID=1 +BUILD_ID=2 DEFINES="" # download the source code and unpack it into LIB_NAME @@ -66,7 +66,7 @@ function build() { -DGLFW_BUILD_EXAMPLES=OFF \ -DGLFW_BUILD_TESTS=OFF \ -DGLFW_BUILD_DOCS=OFF \ - -DGLFW_VULKAN_STATIC=OFF" + -DGLFW_VULKAN_STATIC=OFF" cmake .. ${DEFINES} \ -DLIBRARY_SUFFIX=${ARCH} \ @@ -76,7 +76,7 @@ function build() { -DCMAKE_C_FLAGS_RELEASE="-DUSE_PTHREADS=1 ${VS_C_FLAGS} ${FLAGS_RELEASE} ${EXCEPTION_FLAGS}" \ -DCMAKE_CXX_EXTENSIONS=OFF \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_LIBDIR="lib" \ + -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ ${CMAKE_WIN_SDK} \ -A "${PLATFORM}" \ @@ -183,7 +183,7 @@ function build() { -DCMAKE_CXX_STANDARD=${CPP_STANDARD} \ -DCMAKE_CXX_STANDARD_REQUIRED=ON \ -DCMAKE_CXX_EXTENSIONS=OFF \ - $DEFINES + $DEFINES make clean make -j${PARALLEL_MAKE} From 2415ce83ee055a5f2f5f897a709751d7b795635f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 20:16:47 +1100 Subject: [PATCH 55/78] Linux GCC 14. Linux Arm upload action fixed to latest --- .github/workflows/build-linux-arm.yml | 96 +++++---------------------- .github/workflows/build-linux64.yml | 27 +++++--- scripts/linux/install.sh | 30 +++++++-- 3 files changed, 58 insertions(+), 95 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 0bec04018..901507b7a 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -61,15 +61,14 @@ jobs: - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh - - name: Update Release - uses: johnwbyrd/update-release@v1.0.0 + - name: Update Release ARM64 + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} - tag: nightly - release: nightly - prerelease: false - files: out/openFrameworksLibs_master_linuxaarch64.tar.bz2 - if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' + tag_name: ${{ env.RELEASE }} + draft: false + files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv6l-pi-1zero: runs-on: ubuntu-latest @@ -127,15 +126,14 @@ jobs: run: chmod +x ./scripts/$TARGET/install_and_build.sh - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh - - name: Update Release - uses: johnwbyrd/update-release@v1.0.0 + - name: Update Release armv6l + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} - tag: nightly - release: nightly - prerelease: false - files: out/openFrameworksLibs_master_linuxarmv6l.tar.bz2 - if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' + tag_name: ${{ env.RELEASE }} + draft: false + files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv7-pi3ab45: runs-on: ubuntu-latest @@ -193,69 +191,11 @@ jobs: run: chmod +x ./scripts/$TARGET/install_and_build.sh - name: Script Install and Build run: ./scripts/$TARGET/install_and_build.sh - - name: Update Release - uses: johnwbyrd/update-release@v1.0.0 + - name: Update Release armv7l + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.1.0 with: token: ${{ secrets.GITHUB_TOKEN }} - tag: nightly - release: nightly - prerelease: false - files: out/openFrameworksLibs_master_linuxarmv7l.tar.bz2 - if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' - - - # build-linux-arm6: - # runs-on: ubuntu-latest - # env: - # TARGET: "linuxarmv6l" - # ARCH: armv6l - # SYSROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/raspbian" - # TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/scripts/linuxarmv6l/rpi_toolchain" - # TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" - # steps: - # - uses: actions/checkout@v2 - # - name: Scripts Calc Formula - # run: ./scripts/calculate_formulas.sh - # - name: Scripts Install - # run: ./scripts/$TARGET/install.sh - # - name: build - # run: ./scripts/build.sh - # env: - # GA_CI_SECRET: ${{ secrets.CI_SECRET }} - # - name: Update Release - # uses: johnwbyrd/update-release@v1.0.0 - # with: - # token: ${{ secrets.GITHUB_TOKEN }} - # tag: nightly - # release: nightly - # prerelease: false - # files: out/openFrameworksLibs_master_linuxarmv6l.tar.bz2 - # if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' - -# build-linux-arm7: -# runs-on: ubuntu-latest -# environment: CI -# env: -# TARGET: "linuxarmv7l" -# SYSROOT: "/home/runner/archlinux" -# TOOLCHAIN_ROOT: "/home/runner/rpi2_toolchain" -# TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" -# steps: -# - uses: actions/checkout@v2 -# - name: Scripts Calc Formula -# run: ./scripts/calculate_formulas.sh -# - name: Scripts Install -# run: ./scripts/$TARGET/install.sh -# - name: build -# run: ./scripts/build.sh -# env: -# GA_CI_SECRET: ${{ secrets.CI_SECRET }} -# - name: Update Release -# uses: johnwbyrd/update-release@v1.0.0 -# with: -# token: ${{ secrets.GITHUB_TOKEN }} -# tag: nightly -# release: nightly -# prerelease: false -# files: out/openFrameworksLibs_master_linuxarmv7l.tar.bz2 -# if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && github.ref == 'refs/heads/master' + tag_name: ${{ env.RELEASE }} + draft: false + files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 \ No newline at end of file diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index e1e51a642..21132ab9c 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -10,7 +10,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + # cancel-in-progress: true env: TARGET: "linux64" @@ -25,9 +25,12 @@ jobs: strategy: matrix: cfg: - - {target: linux64, opt: gcc6} - - {target: linux64, opt: gcc8} + - {target: linux64, opt: gcc6} - {target: linux64, opt: gcc11} + - {target: linux64, opt: gcc12} + - {target: linux64, opt: gcc13} + - {target: linux64, opt: gcc14} + - {target: linux64, opt: gcc15} env: TARGET: ${{matrix.cfg.target}} OPT: ${{matrix.cfg.opt}} @@ -59,12 +62,14 @@ jobs: run: scripts/package.sh env: BUNDLE: ${{ matrix.bundle }} - - name: Update Release - uses: johnwbyrd/update-release@v1.0.0 - if: (github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding')) - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ env.RELEASE }} - release: ${{ env.RELEASE }} - files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ matrix.cfg.opt }}.tar.bz2 + - name: Update Release 64 + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ env.RELEASE }} + draft: false + files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}_{{ matrix.cfg.opt }}.tar.bz2 + + \ No newline at end of file diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index ce07c4435..c28209544 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -144,16 +144,34 @@ elif [ "$OPT" == "gcc13" ]; then elif [ "$OPT" == "gcc14" ]; then # https://gcc.gnu.org/gcc-14/changes.html sudo apt update - sudo apt install software-properties-common - sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt install -y software-properties-common + # Add the Ubuntu Toolchain PPA for newer GCC versions + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install gcc-13 g++-13 -y - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 --slave /usr/bin/g++ g++ /usr/bin/g++-14 - sudo update-alternatives --config gcc + sudo apt install -y gcc-14 g++-14 # Install GCC and G++ version 14 + # Configure alternatives to set GCC 14 as default + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-14 + sudo update-alternatives --config gcc # GCC 14 as the default gcc --version g++ -v +elif [ "$OPT" == "gcc15" ]; then + # https://gcc.gnu.org/gcc-15/changes.html + sudo apt update + sudo apt install -y software-properties-common + # Add the Ubuntu Toolchain PPA for newer GCC versions + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt install -y gcc-15 g++-15 # Install experimental GCC and G++ version 15 + # Configure alternatives to set GCC 15 as default + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 15 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-15 + sudo update-alternatives --config gcc # GCC 15 as the default + gcc --version + g++ -v + else - echo "GCC version not specified on OPT env var, set one of gcc4, gcc5 or gcc6" + echo "GCC version not specified on OPT env var, set one of gcc14, gcc6 or gcc13" fi sudo apt-get -y install libasound-dev libjack-dev libpulse-dev oss4-dev #rtaudio From 097a2502ecda4e91a7abb57ce22c6841ca933b1a Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 20:22:57 +1100 Subject: [PATCH 56/78] Fix Github Action --- .github/workflows/build-linux-arm.yml | 4 ++-- .github/workflows/build-linux64.yml | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 901507b7a..de9ed2cf0 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -119,7 +119,7 @@ jobs: run: | cd $SYSROOT && sudo chmod +x ./build_rootfs.sh - ./build_rootfs_arm64.sh download + ./build_rootfs.sh download ./build_rootfs.sh create - name: Ensure Script is Executable @@ -184,7 +184,7 @@ jobs: run: | cd $SYSROOT && sudo chmod +x ./build_rootfs.sh - ./build_rootfs_arm64.sh download + ./build_rootfs.sh download ./build_rootfs.sh create - name: Ensure Script is Executable diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index 21132ab9c..bd48ce237 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -63,13 +63,11 @@ jobs: env: BUNDLE: ${{ matrix.bundle }} - name: Update Release 64 - if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') - uses: softprops/action-gh-release@v2.1.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - tag_name: ${{ env.RELEASE }} - draft: false - files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}_{{ matrix.cfg.opt }}.tar.bz2 - - + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') + uses: softprops/action-gh-release@v2.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ env.RELEASE }} + draft: false + files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}_{{ matrix.cfg.opt }}.tar.bz2 \ No newline at end of file From 536cbda451f4defb6231b7a733a277dde66481e8 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Wed, 8 Jan 2025 20:38:25 +1100 Subject: [PATCH 57/78] gcc15 from source --- .github/workflows/build-linux64.yml | 2 +- scripts/linux/install.sh | 40 +++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index bd48ce237..190e70cf5 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -10,7 +10,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - # cancel-in-progress: true + cancel-in-progress: false env: TARGET: "linux64" diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index c28209544..9ed347c07 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -157,18 +157,36 @@ elif [ "$OPT" == "gcc14" ]; then g++ -v elif [ "$OPT" == "gcc15" ]; then # https://gcc.gnu.org/gcc-15/changes.html + sudo apt update - sudo apt install -y software-properties-common - # Add the Ubuntu Toolchain PPA for newer GCC versions - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - sudo apt update - sudo apt install -y gcc-15 g++-15 # Install experimental GCC and G++ version 15 - # Configure alternatives to set GCC 15 as default - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 15 \ - --slave /usr/bin/g++ g++ /usr/bin/g++-15 - sudo update-alternatives --config gcc # GCC 15 as the default - gcc --version - g++ -v + sudo apt install -y build-essential flex bison libgmp-dev libmpc-dev libmpfr-dev texinfo wget + + wget https://ftp.gnu.org/gnu/gcc/gcc-15.0.0/gcc-15.0.0.tar.gz + tar -xvzf gcc-15.0.0.tar.gz + cd gcc-15.0.0 + + mkdir build + cd build + + ../configure --prefix=/usr/local/gcc-15 --enable-languages=c,c++ --disable-multilib + + make -j$(nproc) + sudo make install + + echo "export PATH=/usr/local/gcc-15/bin:\$PATH" >> ~/.bashrc + source ~/.bashrc + # sudo apt update + # sudo apt install -y software-properties-common + # # Add the Ubuntu Toolchain PPA for newer GCC versions + # sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + # sudo apt update + # sudo apt install -y gcc-15 g++-15 # Install experimental GCC and G++ version 15 + # # Configure alternatives to set GCC 15 as default + # sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 15 \ + # --slave /usr/bin/g++ g++ /usr/bin/g++-15 + # sudo update-alternatives --config gcc # GCC 15 as the default + # gcc --version + # g++ -v else echo "GCC version not specified on OPT env var, set one of gcc14, gcc6 or gcc13" From b8bc4ed82715563b474061bdc7ccb4aebf534495 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Thu, 9 Jan 2025 01:38:21 +1100 Subject: [PATCH 58/78] Linux64 test --- .github/workflows/build-linux64.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index 190e70cf5..f8b7a08a2 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -8,9 +8,9 @@ on: paths-ignore: - '**/README.md' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: false env: TARGET: "linux64" @@ -30,7 +30,7 @@ jobs: - {target: linux64, opt: gcc12} - {target: linux64, opt: gcc13} - {target: linux64, opt: gcc14} - - {target: linux64, opt: gcc15} + # - {target: linux64, opt: gcc15} env: TARGET: ${{matrix.cfg.target}} OPT: ${{matrix.cfg.opt}} From d467956fe07ca183fa0c36f1807938af8f48f12f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 09:46:25 +1100 Subject: [PATCH 59/78] Linux gcc --- scripts/linux/install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index 9ed347c07..bb45c68f9 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -50,7 +50,7 @@ if [ "$OPT" == "gcc4" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -q sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev - sudo apt-get install gcc-4.9 g++-4.9 + sudo apt-get install -y --allow-unauthenticated gcc-4.9 g++-4.9 #needed because github actions defaults to gcc 5 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 60 @@ -103,7 +103,7 @@ elif [ "$OPT" == "gcc8" ]; then sudo apt install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install gcc-8 g++-8 gcc-13 g++-13 -y + sudo apt install -y --allow-unauthenticated gcc-8 g++-8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 --slave /usr/bin/g++ g++ /usr/bin/g++-8 sudo update-alternatives --config gcc gcc --version @@ -114,7 +114,7 @@ elif [ "$OPT" == "gcc11" ]; then sudo apt install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install gcc-11 gcc-12 g++-12 gcc-13 g++-13 -y + sudo apt install -y --allow-unauthenticated gcc-11 g++-11 -y sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 --slave /usr/bin/g++ g++ /usr/bin/g++-11 sudo update-alternatives --config gcc gcc --version @@ -125,7 +125,7 @@ elif [ "$OPT" == "gcc12" ]; then sudo apt install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install gcc-12 g++-12 -y + sudo apt install -y --allow-unauthenticated gcc-12 g++-12 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 --slave /usr/bin/g++ g++ /usr/bin/g++-12 sudo update-alternatives --config gcc gcc --version @@ -136,7 +136,7 @@ elif [ "$OPT" == "gcc13" ]; then sudo apt install software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install gcc-13 g++-13 -y + sudo apt install -y --allow-unauthenticated gcc-13 g++-13 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 --slave /usr/bin/g++ g++ /usr/bin/g++-13 sudo update-alternatives --config gcc gcc --version @@ -148,7 +148,7 @@ elif [ "$OPT" == "gcc14" ]; then # Add the Ubuntu Toolchain PPA for newer GCC versions sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install -y gcc-14 g++-14 # Install GCC and G++ version 14 + sudo apt install -y --allow-unauthenticated gcc-14 g++-14 # Configure alternatives to set GCC 14 as default sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 \ --slave /usr/bin/g++ g++ /usr/bin/g++-14 @@ -170,7 +170,7 @@ elif [ "$OPT" == "gcc15" ]; then ../configure --prefix=/usr/local/gcc-15 --enable-languages=c,c++ --disable-multilib - make -j$(nproc) + make -j sudo make install echo "export PATH=/usr/local/gcc-15/bin:\$PATH" >> ~/.bashrc From ddce2bb6e74dbc42ca91e92522c4277382e85803 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 12:48:16 +1100 Subject: [PATCH 60/78] Linux rootfs fixes --- apothecary/formulas/glew/glew.sh | 4 ++-- apothecary/formulas/glfw.sh | 1 - apothecary/linuxaarch64_configure.sh | 2 +- apothecary/linuxarmv6l_configure.sh | 2 +- apothecary/linuxarmv7l_configure.sh | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index dac15e1ba..a60a00ad6 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -116,7 +116,7 @@ function build() { elif [ "$TYPE" == "msys2" ] ; then make clean make - elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] || [ "$TYPE" == "msys2" ]; then + elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] ; then echoVerbose "building $TYPE | $ARCH " echoVerbose "--------------------" mkdir -p "build_${TYPE}_${ARCH}" @@ -131,11 +131,11 @@ function build() { -DBUILD_SHARED_LIBS=OFF" cmake ../build/cmake \ ${DEFINES} \ + -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}.toolchain.cmake \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_LIBDIR="lib" \ - -DCMAKE_SYSTEM_NAME=$TYPE \ -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ -DCMAKE_INSTALL_PREFIX=Release \ diff --git a/apothecary/formulas/glfw.sh b/apothecary/formulas/glfw.sh index ce557a089..45d256ab6 100644 --- a/apothecary/formulas/glfw.sh +++ b/apothecary/formulas/glfw.sh @@ -144,7 +144,6 @@ function build() { -DGLFW_BUILD_TESTS=OFF \ -DGLFW_BUILD_EXAMPLES=OFF \ -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}.toolchain.cmake \ - -DPLATFORM=$PLATFORM \ -DCMAKE_PREFIX_PATH="${LIBS_ROOT}" \ -DDEPLOYMENT_TARGET=${MIN_SDK_VER} \ -DCMAKE_CXX_FLAGS="-fPIC ${FLAG_RELEASE}" \ diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index a4184ff9a..bc87a004f 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -1,7 +1,7 @@ # Set the root directory # Set Raspbian toolchain directory -export RPI_ROOT=$SYSROOT +export RPI_ROOT=$SYSROOT/rootfs RASP="$RPI_ROOT" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index d33620489..3d22fcba0 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -1,5 +1,5 @@ # Set the root directory -export RPI_ROOT=$SYSROOT +export RPI_ROOT=$SYSROOT/rootfs # Set Raspbian toolchain directory RASP="$RPI_ROOT" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index 7d912dccb..de8f97af5 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -1,5 +1,5 @@ # Set the root directory -export RPI_ROOT=$SYSROOT +export RPI_ROOT=$SYSROOT/rootfs # Set Raspbian toolchain directory RASP="$RPI_ROOT" From 33be3f6d89f9bab7cf7fd8f2d8458c5063724c63 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 13:04:11 +1100 Subject: [PATCH 61/78] Actions Checkout v2 -> 4.2.2 --- .github/workflows/build-emscripten.yml | 43 +++++++++++++++---- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-linux-arm.yml | 48 ++++++++++++++++++++-- .github/workflows/build-linux64.yml | 23 +++++++++-- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-msys2.yml | 2 +- .github/workflows/build-tvos.yml | 2 +- .github/workflows/build-vs2019-x64.yml | 2 +- .github/workflows/build-vs2022-arm64.yml | 2 +- .github/workflows/build-vs2022-arm64ec.yml | 2 +- .github/workflows/build-vs2022-x64.yml | 2 +- .github/workflows/build-xcframework.yml | 2 +- 12 files changed, 109 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index ca766e916..edde9ae11 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -14,7 +14,7 @@ concurrency: env: TARGET: "emscripten" - EMSDK_VERSION: "3.1.73" + EMSDK_VERSION: "3.1.74" USE_ARTIFACT: true jobs: @@ -25,7 +25,7 @@ jobs: ARCH: [32, 64] PTHREADS: [0, 1] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: Docker Step run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:${{ env.EMSDK_VERSION }} bash - name: Scripts Calc Formula @@ -42,6 +42,8 @@ jobs: echo "RELEASE=nightly" >> $GITHUB_ENV elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then echo "RELEASE=latest" >> $GITHUB_ENV + else + echo "RELEASE=latest" >> $GITHUB_ENV fi - name: Download previous artifacts uses: actions/github-script@v7 @@ -142,7 +144,8 @@ jobs: ARCH: ${{ matrix.ARCH }} PTHREADS_ENABLED: ${{ matrix.PTHREADS }} - - name: Package + + - name: Package Binaries for Artifact if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/')) working-directory: ${{ env.GITHUB_WORKSPACE }} run: | @@ -156,11 +159,9 @@ jobs: fi FILENAME="openFrameworksLibs_${{ env.RELEASE }}_emscripten${ARCH_SUFFIX}${PTHREADS_SUFFIX}.tar.bz2" echo "FILENAME=$FILENAME" >> $GITHUB_ENV - scripts/package.sh + scripts/artifact/artifact.sh env: - GA_CI_SECRET: ${{ secrets.CI_SECRET }} - ARCH: ${{ matrix.ARCH }} - PTHREADS_ENABLED: ${{ matrix.PTHREADS }} + BUNDLE: ${{ matrix.bundle }} - name: Upload Artifact if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/')) @@ -170,6 +171,34 @@ jobs: path: out/${{ env.FILENAME }} retention-days: 31 + - name: Remove .tar.bz2 files + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/')) + run: | + echo "Removing .tar.bz2 files from out/ directory..." + rm -f out/*.tar.bz2 + rm -f xout/*.tar.bz2 + echo "Cleanup complete." + + - name: Package + if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding' || contains(github.ref, 'refs/tags/')) + working-directory: ${{ env.GITHUB_WORKSPACE }} + run: | + ARCH_SUFFIX="" + if [[ "${{ matrix.ARCH }}" == "64" ]]; then + ARCH_SUFFIX="_memory64" + fi + PTHREADS_SUFFIX="" + if [[ "${{ matrix.PTHREADS }}" == "1" ]]; then + PTHREADS_SUFFIX="_pthreads" + fi + FILENAME="openFrameworksLibs_${{ env.RELEASE }}_emscripten${ARCH_SUFFIX}${PTHREADS_SUFFIX}.tar.bz2" + echo "FILENAME=$FILENAME" >> $GITHUB_ENV + scripts/package.sh + env: + GA_CI_SECRET: ${{ secrets.CI_SECRET }} + ARCH: ${{ matrix.ARCH }} + PTHREADS_ENABLED: ${{ matrix.PTHREADS }} + - name: Update Release emscripten if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') uses: softprops/action-gh-release@v2.1.0 diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index a6936b0e0..259c4d15f 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -41,7 +41,7 @@ jobs: else echo "RELEASE=latest" >> $GITHUB_ENV fi - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} run: ./scripts/calculate_formulas.sh - name: Scripts Install diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index de9ed2cf0..bc1e2fd98 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -18,7 +18,21 @@ jobs: TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" TOOLCHAIN_PREFIX: "aarch64-linux-gnu" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 + + - name: Determine Release + id: vars + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=latest" >> $GITHUB_ENV + else + echo "RELEASE=latest" >> $GITHUB_ENV + fi - name: Update and Upgrade System Packages run: | @@ -80,7 +94,21 @@ jobs: TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbianpi1zero" TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 + + - name: Determine Release + id: vars + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=latest" >> $GITHUB_ENV + else + echo "RELEASE=latest" >> $GITHUB_ENV + fi - name: Update and Upgrade System Packages run: | @@ -145,7 +173,21 @@ jobs: TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbianpi3ab45" TOOLCHAIN_PREFIX: "arm-linux-gnueabihf" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4.2.2 + + - name: Determine Release + id: vars + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=latest" >> $GITHUB_ENV + else + echo "RELEASE=latest" >> $GITHUB_ENV + fi - name: Update and Upgrade System Packages run: | diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index f8b7a08a2..526cad0e4 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -8,9 +8,9 @@ on: paths-ignore: - '**/README.md' -# concurrency: -# group: ${{ github.workflow }}-${{ github.ref }} -# cancel-in-progress: false +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false env: TARGET: "linux64" @@ -35,7 +35,22 @@ jobs: TARGET: ${{matrix.cfg.target}} OPT: ${{matrix.cfg.opt}} steps: - - uses: actions/checkout@v4.1.7 + - uses: actions/checkout@v4.2.2 + + - name: Determine Release + id: vars + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=latest" >> $GITHUB_ENV + else + echo "RELEASE=latest" >> $GITHUB_ENV + fi + - name: Scripts Calc Formula - ${{matrix.cfg.target}} - ${{matrix.cfg.opt}} run: ./scripts/calculate_formulas.sh - name: Scripts Install diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 2cf0f25e1..3dc929406 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -41,7 +41,7 @@ jobs: else echo "RELEASE=latest" >> $GITHUB_ENV fi - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} run: ./scripts/calculate_formulas.sh - name: Scripts Install diff --git a/.github/workflows/build-msys2.yml b/.github/workflows/build-msys2.yml index 5935af58d..b00895b8d 100644 --- a/.github/workflows/build-msys2.yml +++ b/.github/workflows/build-msys2.yml @@ -67,7 +67,7 @@ jobs: echo "RELEASE=latest" >> $GITHUB_ENV fi - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Build working-directory: ${{env.GITHUB_WORKSPACE}} run: scripts/build.sh diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index e11235011..b66bdfed1 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -41,7 +41,7 @@ jobs: else echo "RELEASE=latest" >> $GITHUB_ENV fi - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: Scripts Calc Formula - ${{ env.TARGET }} Bundle ${{ matrix.bundle }} run: ./scripts/calculate_formulas.sh - name: Scripts Install diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 8f48c03d7..6f5c6a14b 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -49,7 +49,7 @@ jobs: mingw-w64-x86_64-gdb mingw-w64-x86_64-make - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Determine Release diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 191a3e55d..3760f7830 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -50,7 +50,7 @@ jobs: mingw-w64-x86_64-gdb mingw-w64-x86_64-make - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Determine Release diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index f558d47de..c18efa901 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -56,7 +56,7 @@ jobs: mingw-w64-x86_64-gdb mingw-w64-x86_64-make - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Determine Release id: vars diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index e4e3fbfdf..8e4c309dc 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -49,7 +49,7 @@ jobs: mingw-w64-x86_64-gdb mingw-w64-x86_64-make - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v4.2.2 - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 - name: Determine Release diff --git a/.github/workflows/build-xcframework.yml b/.github/workflows/build-xcframework.yml index 0c01f7552..5d09ff3bb 100644 --- a/.github/workflows/build-xcframework.yml +++ b/.github/workflows/build-xcframework.yml @@ -75,7 +75,7 @@ jobs: else echo "RELEASE=latest" >> $GITHUB_ENV fi - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: Scripts Calc Formula run: ./scripts/calculate_formulas.sh - name: Scripts Install From c7ab28e5c6d0a540754d687d33b5e903bdc0e1a2 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 13:17:56 +1100 Subject: [PATCH 62/78] Remove fmod calculate --- scripts/calculate_formulas.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/calculate_formulas.sh b/scripts/calculate_formulas.sh index 9b05af191..5f42e86a9 100755 --- a/scripts/calculate_formulas.sh +++ b/scripts/calculate_formulas.sh @@ -17,7 +17,7 @@ FORMULAS=( "FreeImage" "libxml2" "freetype" - "fmod" + #"fmod" "glew" "glfw" "glm" @@ -96,7 +96,7 @@ if [ "$BUNDLE" == "1" ]; then "opencv" "portaudio" "libusb" - "fmod" + # "fmod" ) else FORMULAS=( @@ -168,7 +168,7 @@ elif [ "$TARGET" == "vs" ]; then # All formulas #"boost" "FreeImage" - "fmod" + #"fmod" "glew" "glfw" "glm" From 83a6d0724e0b1da5f337c0f2c2098a369908cb72 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 13:18:50 +1100 Subject: [PATCH 63/78] Linux toolchain pass GCC to apothecary --- .github/workflows/build-linux64.yml | 30 +++++++------------ apothecary/apothecary | 17 ++++++++++- apothecary/toolchains/linux64.toolchain.cmake | 4 +-- scripts/linux/install.sh | 22 +++++++------- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index 526cad0e4..bd8d10aae 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -25,15 +25,15 @@ jobs: strategy: matrix: cfg: - - {target: linux64, opt: gcc6} - - {target: linux64, opt: gcc11} - - {target: linux64, opt: gcc12} - - {target: linux64, opt: gcc13} - - {target: linux64, opt: gcc14} - # - {target: linux64, opt: gcc15} + - {target: linux64, gcc: gcc6} + - {target: linux64, gcc: gcc11} + - {target: linux64, gcc: gcc12} + - {target: linux64, gcc: gcc13} + - {target: linux64, gcc: gcc14} + # - {target: linux64, gcc: gcc15} env: TARGET: ${{matrix.cfg.target}} - OPT: ${{matrix.cfg.opt}} + GCC: ${{matrix.cfg.gcc}} steps: - uses: actions/checkout@v4.2.2 @@ -51,21 +51,11 @@ jobs: echo "RELEASE=latest" >> $GITHUB_ENV fi - - name: Scripts Calc Formula - ${{matrix.cfg.target}} - ${{matrix.cfg.opt}} + - name: Scripts Calc Formula - ${{matrix.cfg.target}} - ${{matrix.cfg.gcc}} run: ./scripts/calculate_formulas.sh - name: Scripts Install run: ./scripts/linux/install.sh - - name: Determine Release - id: vars - shell: bash - run: | - if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then - echo "RELEASE=nightly" >> $GITHUB_ENV - elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then - echo "RELEASE=bleeding" >> $GITHUB_ENV - else - echo "RELEASE=bleeding" >> $GITHUB_ENV - fi + - name: BuildLinux64 working-directory: ${{env.GITHUB_WORKSPACE}} run: scripts/build.sh @@ -84,5 +74,5 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ env.RELEASE }} draft: false - files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}_{{ matrix.cfg.opt }}.tar.bz2 + files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}_{{ matrix.cfg.gcc }}.tar.bz2 \ No newline at end of file diff --git a/apothecary/apothecary b/apothecary/apothecary index d6b67bc04..fba6fffbf 100755 --- a/apothecary/apothecary +++ b/apothecary/apothecary @@ -213,6 +213,11 @@ fi if [ -z "${LOADSAVE_RESULT+x}" ]; then declare -a LOADSAVE_RESULT=0 fi + +if [ -z "${GCC+x}" ]; then + GCC=gcc14 +fi + WIN11_INSTALLED_SDK_2022_HEX=0x0A00586D @@ -969,7 +974,17 @@ if [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] || [ "$TYPE" == "linuxaarc export ABI="armv6l" elif [ $TYPE == "msys2" ]; then export ABI="x86_64" - fi + fi + + if [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ]; then + if [[ $GCC =~ [a-zA-Z]+([0-9]+) ]]; then + export GCC_VERSION=${BASH_REMATCH[1]} + echo "Extracted GCC_VERSION: $GCC_VERSION" + else + echo "Error: Unable to extract GCC version from variable '$GCC'" + export GCC_VERSION=14 + fi + fi export PLATFORM=${ABI} fi diff --git a/apothecary/toolchains/linux64.toolchain.cmake b/apothecary/toolchains/linux64.toolchain.cmake index 57e1ea085..895682275 100644 --- a/apothecary/toolchains/linux64.toolchain.cmake +++ b/apothecary/toolchains/linux64.toolchain.cmake @@ -8,7 +8,7 @@ set(CMAKE_VERBOSE_MAKEFILE ON) # GCC Version (Set this variable when invoking CMake) if(NOT DEFINED GCC_VERSION) - message(FATAL_ERROR "Please specify GCC_VERSION (e.g., -DGCC_VERSION=11)") + message(FATAL_ERROR "Please specify GCC_VERSION (e.g., -DGCC_VERSION=14)") endif() # Path to GCC @@ -48,7 +48,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Compiler and linker flags set(CMAKE_C_FLAGS "-fPIC -O3 -Wall -Wextra -march=x86-64 -mtune=generic") -set(CMAKE_CXX_FLAGS "-fPIC -O3 -Wall -Wextra -std=c++17 -march=x86-64 -mtune=generic") +set(CMAKE_CXX_FLAGS "-fPIC -O3 -Wall -Wextra -std=c++${CPP_STANDARD} -march=x86-64 -mtune=generic") set(CMAKE_EXE_LINKER_FLAGS "-fPIE -pie") set(CMAKE_SHARED_LINKER_FLAGS "-shared -fPIC") diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index bb45c68f9..3b26aaaf6 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -43,9 +43,9 @@ echoDots(){ done } -echo "GCC Version: [$OPT]" +echo "GCC Version: [$GCC]" -if [ "$OPT" == "gcc4" ]; then +if [ "$GCC" == "gcc4" ]; then sudo add-apt-repository -y ppa:dns/gnu sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -q @@ -58,7 +58,7 @@ if [ "$OPT" == "gcc4" ]; then sudo update-alternatives --set cc /usr/bin/gcc sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 60 sudo update-alternatives --set c++ /usr/bin/g++ -elif [ "$OPT" == "gcc5" ]; then +elif [ "$GCC" == "gcc5" ]; then sudo add-apt-repository -y ppa:dns/gnu sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -q @@ -70,7 +70,7 @@ elif [ "$OPT" == "gcc5" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100 g++ -v -elif [ "$OPT" == "gcc6" ]; then +elif [ "$GCC" == "gcc6" ]; then sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 sudo apt-get update @@ -84,7 +84,7 @@ elif [ "$OPT" == "gcc6" ]; then sudo add-apt-repository -r "deb http://cz.archive.ubuntu.com/ubuntu bionic main universe" g++ -v -elif [ "$OPT" == "gcc7" ]; then +elif [ "$GCC" == "gcc7" ]; then #https://gcc.gnu.org/gcc-7/changes.html sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 sudo apt-get update @@ -97,7 +97,7 @@ elif [ "$OPT" == "gcc7" ]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 sudo add-apt-repository -r "deb http://cz.archive.ubuntu.com/ubuntu bionic main universe" g++ -v -elif [ "$OPT" == "gcc8" ]; then +elif [ "$GCC" == "gcc8" ]; then #https://gcc.gnu.org/gcc-8/changes.html sudo apt update sudo apt install software-properties-common @@ -108,7 +108,7 @@ elif [ "$OPT" == "gcc8" ]; then sudo update-alternatives --config gcc gcc --version g++ -v -elif [ "$OPT" == "gcc11" ]; then +elif [ "$GCC" == "gcc11" ]; then # https://gcc.gnu.org/gcc-11/changes.html sudo apt update sudo apt install software-properties-common @@ -119,7 +119,7 @@ elif [ "$OPT" == "gcc11" ]; then sudo update-alternatives --config gcc gcc --version g++ -v -elif [ "$OPT" == "gcc12" ]; then +elif [ "$GCC" == "gcc12" ]; then # https://gcc.gnu.org/gcc-12/changes.html sudo apt update sudo apt install software-properties-common @@ -130,7 +130,7 @@ elif [ "$OPT" == "gcc12" ]; then sudo update-alternatives --config gcc gcc --version g++ -v -elif [ "$OPT" == "gcc13" ]; then +elif [ "$GCC" == "gcc13" ]; then # https://gcc.gnu.org/gcc-13/changes.html sudo apt update sudo apt install software-properties-common @@ -141,7 +141,7 @@ elif [ "$OPT" == "gcc13" ]; then sudo update-alternatives --config gcc gcc --version g++ -v -elif [ "$OPT" == "gcc14" ]; then +elif [ "$GCC" == "gcc14" ]; then # https://gcc.gnu.org/gcc-14/changes.html sudo apt update sudo apt install -y software-properties-common @@ -155,7 +155,7 @@ elif [ "$OPT" == "gcc14" ]; then sudo update-alternatives --config gcc # GCC 14 as the default gcc --version g++ -v -elif [ "$OPT" == "gcc15" ]; then +elif [ "$GCC" == "gcc15" ]; then # https://gcc.gnu.org/gcc-15/changes.html sudo apt update From f99ab6a98d85851fbce29be58232dac7b999221c Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 13:25:07 +1100 Subject: [PATCH 64/78] Actions Update --- .github/workflows/build-linux-arm.yml | 6 +++--- .github/workflows/build-linux64.yml | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index bc1e2fd98..a21bc3e06 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -40,7 +40,7 @@ jobs: sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils - name: Cache raspbian folder - uses: actions/cache@v2 + uses: actions/cache@v4.2.0 with: path: /home/runner/work/apothecary/apothecary/raspbian key: raspbian-cache-2 @@ -116,7 +116,7 @@ jobs: sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils - name: Cache raspbian folder - uses: actions/cache@v2 + uses: actions/cache@v4.2.0 with: path: /home/runner/work/apothecary/apothecary/raspbianpi1zero key: raspbian-pi1zero-cache-2 @@ -195,7 +195,7 @@ jobs: sudo apt-get install -y build-essential gawk gcc g++ gfortran git texinfo bison libncurses-dev tar wget qemu-user-static rsync xz-utils - name: Cache raspbian folder - uses: actions/cache@v2 + uses: actions/cache@v4.2.0 with: path: /home/runner/work/apothecary/apothecary/raspbianpi3ab45 key: raspbian-pi3ab45-cache-2 diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index bd8d10aae..46c197de0 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -38,18 +38,18 @@ jobs: - uses: actions/checkout@v4.2.2 - name: Determine Release - id: vars - shell: bash - run: | - if [[ "${{ github.ref }}" == refs/tags/* ]]; then - echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV - elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then - echo "RELEASE=nightly" >> $GITHUB_ENV - elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then - echo "RELEASE=latest" >> $GITHUB_ENV - else - echo "RELEASE=latest" >> $GITHUB_ENV - fi + id: vars + shell: bash + run: | + if [[ "${{ github.ref }}" == refs/tags/* ]]; then + echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + echo "RELEASE=nightly" >> $GITHUB_ENV + elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then + echo "RELEASE=latest" >> $GITHUB_ENV + else + echo "RELEASE=latest" >> $GITHUB_ENV + fi - name: Scripts Calc Formula - ${{matrix.cfg.target}} - ${{matrix.cfg.gcc}} run: ./scripts/calculate_formulas.sh From 28414f52bee319010aabdc660da8cf498f7ee8e8 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 13:28:53 +1100 Subject: [PATCH 65/78] Linux add GCC_VERSION --- apothecary/formulas/glew/glew.sh | 1 + apothecary/formulas/glfw.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index a60a00ad6..f842cb792 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -135,6 +135,7 @@ function build() { -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_BUILD_TYPE=Release \ + -DGCC_VERSION=${GCC_VERSION} \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ diff --git a/apothecary/formulas/glfw.sh b/apothecary/formulas/glfw.sh index 45d256ab6..d3a98a623 100644 --- a/apothecary/formulas/glfw.sh +++ b/apothecary/formulas/glfw.sh @@ -147,6 +147,7 @@ function build() { -DCMAKE_PREFIX_PATH="${LIBS_ROOT}" \ -DDEPLOYMENT_TARGET=${MIN_SDK_VER} \ -DCMAKE_CXX_FLAGS="-fPIC ${FLAG_RELEASE}" \ + -DGCC_VERSION=${GCC_VERSION} \ -DCMAKE_C_FLAGS="-fPIC ${FLAG_RELEASE}" \ -DENABLE_VISIBILITY=OFF \ -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ From a85c45f5c5f2e3c3a5c15d5fb1f222a4154acfe7 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 13:41:53 +1100 Subject: [PATCH 66/78] Linux --- apothecary/formulas/glew/glew.sh | 2 +- apothecary/toolchains/linux64.toolchain.cmake | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index f842cb792..345e92cdf 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -131,11 +131,11 @@ function build() { -DBUILD_SHARED_LIBS=OFF" cmake ../build/cmake \ ${DEFINES} \ - -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}.toolchain.cmake \ -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -Iinclude ${FLAG_RELEASE}" \ -DCMAKE_BUILD_TYPE=Release \ -DGCC_VERSION=${GCC_VERSION} \ + -DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/${TYPE}.toolchain.cmake \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_INSTALL_PREFIX=Release \ -DCMAKE_SYSTEM_PROCESSOR=$ARCH \ diff --git a/apothecary/toolchains/linux64.toolchain.cmake b/apothecary/toolchains/linux64.toolchain.cmake index 895682275..edbbe9814 100644 --- a/apothecary/toolchains/linux64.toolchain.cmake +++ b/apothecary/toolchains/linux64.toolchain.cmake @@ -8,7 +8,8 @@ set(CMAKE_VERBOSE_MAKEFILE ON) # GCC Version (Set this variable when invoking CMake) if(NOT DEFINED GCC_VERSION) - message(FATAL_ERROR "Please specify GCC_VERSION (e.g., -DGCC_VERSION=14)") + set(GCC_VERSION 14) # Default to GCC 11 if not specified + message(WARNING "GCC_VERSION not specified. Defaulting to GCC_VERSION=${GCC_VERSION}") endif() # Path to GCC @@ -31,12 +32,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_COMPILER "${GCC_PATH}/gcc-${GCC_VERSION}") set(CMAKE_CXX_COMPILER "${GCC_PATH}/g++-${GCC_VERSION}") +message(STATUS "Using GCC Version: ${GCC_VERSION}") +message(STATUS "C Compiler: ${CMAKE_C_COMPILER}") +message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}") + # Check for the existence of the specified GCC version if(NOT EXISTS ${CMAKE_C_COMPILER}) - message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") + message(WARNING "C Compiler not found: ${CMAKE_C_COMPILER}") endif() if(NOT EXISTS ${CMAKE_CXX_COMPILER}) - message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") + message(WARNING "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") endif() # Paths to system libraries and includes From 60eaa9000c26dace99e59a57edf260561987364f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:10:49 +1100 Subject: [PATCH 67/78] Toolchain Linux Fixes --- .../linuxaarch64-clang.toolchain.cmake | 25 ++++--- .../linuxarmv6l-clang.toolchain.cmake | 21 ++++-- .../linuxarmv7l-clang.toolchain.cmake | 15 ++-- .../linuxarmv8-clang.toolchain.cmake | 69 +++++++++++++++++++ 4 files changed, 109 insertions(+), 21 deletions(-) create mode 100644 apothecary/toolchains/linuxarmv8-clang.toolchain.cmake diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 5c3d04d11..9a88375bb 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -4,6 +4,8 @@ set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 1) +# Raspberry Pi - 3 Model A+/B+ & 4 Model B 400/B & 5 & Compute 3/3-lite/3+/4 (64-Bit) + set(CMAKE_SYSTEM_PROCESSOR aarch64) set(CMAKE_LIBRARY_ARCHITECTURE aarch64-linux-gnu) set(GCC_VERSION 14.2.0) @@ -14,29 +16,36 @@ endif() if(NOT DEFINED CPP_STANDARD) set(CPP_STANDARD 17) # Default to C++17 endif() + set(CMAKE_C_STANDARD ${C_STANDARD}) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) +if(NOT DEFINED M_CPU) + set(M_CPU cortex-a53) # Default to cortex-a53 / cortex-A76 +endif() + set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) -set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ - -L${CMAKE_SYSROOT}/lib \ - -L/usr/lib/ \ - -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") +set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ + -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") -set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=cortex-a53") +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=${M_CPU} -march=armv8-a+fp+simd") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=cortex-a53") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=${M_CPU} -march=armv8-a+fp+simd") ## Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index ab134abea..3327bbb02 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -21,16 +21,24 @@ endif() if(NOT DEFINED CPP_STANDARD) set(CPP_STANDARD 17) # Default to C++17 endif() + set(CMAKE_C_STANDARD ${C_STANDARD}) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ - -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") +# Compiler Binary +set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) + +set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib + -L${TOOLCHAIN_ROOT}/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") # Update linker flags for ARMv7 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") @@ -39,8 +47,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard ${EXTRA_LINKS}") -# Compiler Binary -set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) + set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++) diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index 28521bd8f..9575a75c4 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -26,12 +26,15 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ - -L${CMAKE_SYSROOT}/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -L${CMAKE_SYSROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ - -L${CMAKE_SYSROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") - +set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib + -L${TOOLCHAIN_ROOT}/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") # Update linker flags for ARMv7 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") diff --git a/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake new file mode 100644 index 000000000..c9d49252d --- /dev/null +++ b/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake @@ -0,0 +1,69 @@ +cmake_minimum_required(VERSION 3.15) + +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 1) + +# Change to Raspberry Pi - 3 Model A+/B+ & 4 Model 400/B & 5 & Compute 3/3-lite/3+/4 (32-Bit) +set(CMAKE_SYSTEM_PROCESSOR armv8) +set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) +set(GCC_VERSION 14.2.0) + +set(tools ${TOOLCHAIN_ROOT}) # warning change toolchain path here. +set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. + +set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) +set(CMAKE_SYSROOT ${rootfs_dir}) + +if(NOT DEFINED C_STANDARD) + set(C_STANDARD 17) # Default to C17 +endif() +if(NOT DEFINED CPP_STANDARD) + set(CPP_STANDARD 17) # Default to C++17 +endif() +set(CMAKE_C_STANDARD ${C_STANDARD}) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib + -L${TOOLCHAIN_ROOT}/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ + -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") + +# Update linker flags for armv8-a +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") + +# Update compiler flags for armv8-a +set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 ${EXTRA_LINKS}") + +# Compiler Binary +set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) + +set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) +set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++) +set(CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) +set(CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) +set(CMAKE_NM ${BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) +set(CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) + +if(NOT EXISTS ${CMAKE_C_COMPILER}) + message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") +endif() + +if(NOT EXISTS ${CMAKE_CXX_COMPILER}) + message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") +endif() + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) From 402ed307a842d418fda59f869a1e01d911c411fa Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:12:22 +1100 Subject: [PATCH 68/78] Workflow Optimisations allow disable ENV --- .github/workflows/build-emscripten.yml | 12 ++++++++++++ .github/workflows/build-ios.yml | 11 +++++++++++ .github/workflows/build-linux-arm.yml | 18 ++++++++++++++++++ .github/workflows/build-linux64.yml | 13 ++++++++++++- .github/workflows/build-macos.yml | 12 ++++++++++++ .github/workflows/build-tvos.yml | 13 +++++++++++++ .github/workflows/build-vs2019-x64.yml | 14 +++++++++++++- .github/workflows/build-vs2022-arm64.yml | 13 ++++++++++++- .github/workflows/build-vs2022-arm64ec.yml | 13 ++++++++++++- .github/workflows/build-vs2022-x64.yml | 14 +++++++++++++- 10 files changed, 128 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index edde9ae11..ff62c5dcf 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -16,9 +16,21 @@ env: TARGET: "emscripten" EMSDK_VERSION: "3.1.74" USE_ARTIFACT: true + DISABLE_WORKFLOW: "false" jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + build-emscripten: + needs: check-enabled runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 259c4d15f..fe1e7e0a5 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -17,9 +17,20 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true + DISABLE_WORKFLOW: "false" jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi build-for-ios-platform: + needs: check-enabled runs-on: macos-14 strategy: matrix: diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index a21bc3e06..78875182d 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -6,9 +6,24 @@ on: pull_request: paths-ignore: - "**/README.md" + +env: + USE_ARTIFACT: false + DISABLE_WORKFLOW: "false" + jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi build-linux-aarch64: + needs: check-enabled runs-on: ubuntu-latest env: TARGET: linuxaarch64 @@ -17,6 +32,7 @@ jobs: SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian_rootfs" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" TOOLCHAIN_PREFIX: "aarch64-linux-gnu" + steps: - uses: actions/checkout@v4.2.2 @@ -85,6 +101,7 @@ jobs: files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv6l-pi-1zero: + needs: check-enabled runs-on: ubuntu-latest env: TARGET: linuxarmv6l @@ -164,6 +181,7 @@ jobs: files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv7-pi3ab45: + needs: check-enabled runs-on: ubuntu-latest env: TARGET: linuxarmv7l diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index 46c197de0..c32183f0f 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -16,11 +16,22 @@ env: TARGET: "linux64" NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} - USE_ARTIFACT: true + USE_ARTIFACT: true + DISABLE_WORKFLOW: "false" jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi build-linux64: + needs: check-enabled runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 3dc929406..f5cf8fc8e 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -17,9 +17,21 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true + DISABLE_WORKFLOW: "false" jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + build-macos-platforms: + needs: check-enabled runs-on: macos-14 strategy: matrix: diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index b66bdfed1..18accbbcd 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -17,9 +17,22 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true + DISABLE_WORKFLOW: "false" + +jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi jobs: build-macos-platforms: + needs: check-enabled runs-on: macos-14 strategy: matrix: diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 6f5c6a14b..df96d2077 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -19,9 +19,21 @@ env: VS_VER: 16 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - + DISABLE_WORKFLOW: "false" + jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + build-vs2019: + needs: check-enabled runs-on: windows-2019 strategy: matrix: diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 3760f7830..a3a39ba78 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -18,11 +18,22 @@ env: NO_FORCE: 1 VS_VER: 17 GA_CI_SECRET: ${{ secrets.CI_SECRET }} - USE_ARTIFACT: true + USE_ARTIFACT: true + DISABLE_WORKFLOW: "false" jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi build-vs2022: + needs: check-enabled runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index c18efa901..10695d271 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -19,10 +19,21 @@ env: VS_VER: 17 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - + DISABLE_WORKFLOW: "false" + jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi build-vs2022: + needs: check-enabled runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index 8e4c309dc..8c4f7ebad 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -19,9 +19,21 @@ env: VS_VER: 17 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - + DISABLE_WORKFLOW: "false" + jobs: + check-enabled: + runs-on: ubuntu-latest + steps: + - name: Check if Workflow is Enabled / Disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + build-vs2022: + needs: check-enabled runs-on: windows-2022 strategy: matrix: From 794adf50aaa9b677ee244857b1f3f25e1f3df8e6 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:13:47 +1100 Subject: [PATCH 69/78] Test disable tvOS --- .github/workflows/build-tvos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index 18accbbcd..e1ce2473a 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -17,7 +17,7 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: check-enabled: @@ -30,7 +30,6 @@ jobs: exit 0 fi -jobs: build-macos-platforms: needs: check-enabled runs-on: macos-14 From 1d7b3a3e1c2ec3b80f307b10f110abd3a455900b Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:22:36 +1100 Subject: [PATCH 70/78] Actions disable with if rather than seperate instance of ubuntu --- .github/workflows/build-emscripten.yml | 12 +----------- .github/workflows/build-ios.yml | 14 ++------------ .github/workflows/build-linux-arm.yml | 16 +++------------- .github/workflows/build-linux64.yml | 12 +----------- .github/workflows/build-macos.yml | 15 ++------------- .github/workflows/build-msys2.yml | 4 +--- .github/workflows/build-tvos.yml | 12 +----------- .github/workflows/build-vs2019-x64.yml | 12 +----------- .github/workflows/build-vs2022-arm64.yml | 12 +----------- .github/workflows/build-vs2022-arm64ec.yml | 12 +----------- .github/workflows/build-vs2022-x64.yml | 12 +----------- 11 files changed, 15 insertions(+), 118 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index ff62c5dcf..f1e439d58 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -19,18 +19,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-emscripten: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index fe1e7e0a5..2645e341e 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -19,18 +19,8 @@ env: USE_ARTIFACT: true DISABLE_WORKFLOW: "false" -jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-for-ios-platform: - needs: check-enabled +jobs: build-for-ios-platform: + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: macos-14 strategy: matrix: diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 78875182d..2b9d56e4f 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -12,18 +12,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-linux-aarch64: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest env: TARGET: linuxaarch64 @@ -101,7 +91,7 @@ jobs: files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv6l-pi-1zero: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest env: TARGET: linuxarmv6l @@ -181,7 +171,7 @@ jobs: files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv7-pi3ab45: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest env: TARGET: linuxarmv7l diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index c32183f0f..506de1ad3 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -20,18 +20,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-linux64: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index f5cf8fc8e..f04aaf7e6 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -19,19 +19,8 @@ env: USE_ARTIFACT: true DISABLE_WORKFLOW: "false" -jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - - build-macos-platforms: - needs: check-enabled +jobs: build-macos-platforms: + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: macos-14 strategy: matrix: diff --git a/.github/workflows/build-msys2.yml b/.github/workflows/build-msys2.yml index b00895b8d..1598b8f5a 100644 --- a/.github/workflows/build-msys2.yml +++ b/.github/workflows/build-msys2.yml @@ -18,9 +18,7 @@ env: GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: false -jobs: - - build-msys2: +jobs: build-msys2: strategy: matrix: diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index e1ce2473a..c0c956940 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -20,18 +20,8 @@ env: DISABLE_WORKFLOW: "true" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-macos-platforms: - needs: check-enabled + if: env.DISABLE_WORKFLOW != 'true' runs-on: macos-14 strategy: matrix: diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index df96d2077..38cc7ce86 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -22,18 +22,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-vs2019: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2019 strategy: matrix: diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index a3a39ba78..3428aeb91 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -22,18 +22,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-vs2022: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 10695d271..055ef888c 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -22,18 +22,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-vs2022: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2022 strategy: matrix: diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index 8c4f7ebad..33671ba64 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -22,18 +22,8 @@ env: DISABLE_WORKFLOW: "false" jobs: - check-enabled: - runs-on: ubuntu-latest - steps: - - name: Check if Workflow is Enabled / Disabled - run: | - if [ "${{ env.DISABLE_WORKFLOW }}" = "true" ]; then - echo "Workflow is disabled. Exiting." - exit 0 - fi - build-vs2022: - needs: check-enabled + $GCCif: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2022 strategy: matrix: From 6dba908b658d4f379b1d4e50feca4baa2df87cd9 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:32:47 +1100 Subject: [PATCH 71/78] Linux Toolchain fixes --- apothecary/linuxaarch64_configure.sh | 9 ++++++--- apothecary/linuxarmv6l_configure.sh | 9 +++++---- apothecary/linuxarmv7l_configure.sh | 9 +++++---- apothecary/toolchains/linuxaarch64-clang.toolchain.cmake | 6 +++--- apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake | 6 +++--- apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake | 6 +++--- apothecary/toolchains/linuxarmv8-clang.toolchain.cmake | 6 +++--- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index bc87a004f..45f8fefa4 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -32,7 +32,7 @@ export RANLIBFLAGS="--plugin ${GCCPATH}/liblto_plugin.so" # GStreamer version for dependencies export GST_VERSION="1.0" # Compiler flags for ARM64 -export CFLAGS="--sysroot=${SYSROOT} \ +export CFLAGS="--sysroot=${RPI_ROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ @@ -40,10 +40,13 @@ export CFLAGS="--sysroot=${SYSROOT} \ -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST" # Linker flags for ARM64 -export LDFLAGS="--sysroot=${SYSROOT} \ +export LDFLAGS="--sysroot=${RPI_ROOT} \ + -Wl,-rpath-link,${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -Wl,-rpath-link,${RPI_ROOT}/usr/lib64/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${RPI_ROOT}/usr/lib64/${CMAKE_LIBRARY_ARCHITECTURE} \ -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib64 \ - -L/usr/lib64 \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}" diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 3d22fcba0..4fa76f6fa 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -30,15 +30,16 @@ export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" export PKG_CONFIG_PATH="$SYSROOT/usr/lib/$GCC_PREFIX/pkgconfig:$SYSROOT/usr/share/pkgconfig:$SYSROOT/usr/lib/pkgconfig" # Compiler flags for cross-compilation -export CFLAGS="--sysroot=${SYSROOT} \ +export CFLAGS="--sysroot=${RPI_ROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -march=armv6 -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" + -march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -fPIC -ftree-vectorize -Wno-psabi -pipe -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" # Linker flags for cross-compilation -export LDFLAGS="--sysroot=${SYSROOT} -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ +export LDFLAGS="--sysroot=${RPI_ROOT} -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ -L${TOOLCHAIN_ROOT}/lib \ - -L/usr/lib \ + -Wl,-rpath-link,${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib -lm" diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index de8f97af5..b7d3bfdd0 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -28,10 +28,10 @@ export ARFLAGS="--plugin $GCCPATH/liblto_plugin.so" export RANLIBFLAGS="--plugin $GCCPATH/liblto_plugin.so" # Compiler flags for ARMv7 -export CFLAGS="--sysroot=${SYSROOT} \ +export CFLAGS="--sysroot=${RPI_ROOT} \ -I${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/include \ -I${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}/include \ - -march=armv7-a -mfpu=vfp -mfloat-abi=hard \ + -march=armv7-a -mcpu=cortex-a7 -mfpu=neon -mfloat-abi=hard \ -fPIC -ftree-vectorize -Wno-psabi -pipe \ -DSTANDALONE -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE \ -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS \ @@ -39,10 +39,11 @@ export CFLAGS="--sysroot=${SYSROOT} \ -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM" # Linker flags for ARMv7 -export LDFLAGS="--sysroot=${SYSROOT} \ +export LDFLAGS="--sysroot=${RPI_ROOT} \ -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${GCC_PREFIX}/lib \ -L${TOOLCHAIN_ROOT}/lib \ - -L/usr/lib \ + -Wl,-rpath-link,${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ + -L${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib" diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index 9a88375bb..d21ce97da 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -32,14 +32,14 @@ set(rootfs_dir ${SYSROOT}/rootfs) # warning change compiled rootfs path here. set(CMAKE_FIND_ROOT_PATH ${rootfs_dir}) set(CMAKE_SYSROOT ${rootfs_dir}) -set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION} \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib64 \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") diff --git a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake index 3327bbb02..a9167959c 100644 --- a/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv6l-clang.toolchain.cmake @@ -30,13 +30,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Compiler Binary set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) -set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib -L${TOOLCHAIN_ROOT}/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") diff --git a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake index 9575a75c4..77dcabe23 100644 --- a/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv7l-clang.toolchain.cmake @@ -26,13 +26,13 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib -L${TOOLCHAIN_ROOT}/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") diff --git a/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake b/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake index c9d49252d..377dc266c 100644 --- a/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxarmv8-clang.toolchain.cmake @@ -26,13 +26,13 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD ${CPP_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(EXTRA_LINKS "-Wl, -rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib -L${TOOLCHAIN_ROOT}/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/lib \ - -rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ + -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib \ -L${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}") From 910ef63c2cccab1ef0a0ed9635b3b64a4f9828ff Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:33:41 +1100 Subject: [PATCH 72/78] Test Quick Disable --- .github/workflows/build-emscripten.yml | 2 +- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-vs2019-x64.yml | 2 +- .github/workflows/build-vs2022-arm64.yml | 2 +- .github/workflows/build-vs2022-arm64ec.yml | 2 +- .github/workflows/build-vs2022-x64.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index f1e439d58..8e64e799e 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -16,7 +16,7 @@ env: TARGET: "emscripten" EMSDK_VERSION: "3.1.74" USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-emscripten: diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 2645e341e..7a6bdfc1e 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -17,7 +17,7 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-for-ios-platform: $GCCif: env.DISABLE_WORKFLOW != 'true' diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index f04aaf7e6..3d1d7762b 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -17,7 +17,7 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-macos-platforms: $GCCif: env.DISABLE_WORKFLOW != 'true' diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 38cc7ce86..e3564de6b 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -19,7 +19,7 @@ env: VS_VER: 16 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-vs2019: diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 3428aeb91..38d0ba74d 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -19,7 +19,7 @@ env: VS_VER: 17 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-vs2022: diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 055ef888c..ea9f19f9f 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -19,7 +19,7 @@ env: VS_VER: 17 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-vs2022: diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index 33671ba64..2a3dced4d 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -19,7 +19,7 @@ env: VS_VER: 17 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: true - DISABLE_WORKFLOW: "false" + DISABLE_WORKFLOW: "true" jobs: build-vs2022: From e40555841e45eb72244a136b72106d8b79a4ef03 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:40:26 +1100 Subject: [PATCH 73/78] Fix Actions --- .github/workflows/.DS_Store | Bin 6148 -> 0 bytes .github/workflows/build-emscripten.yml | 2 +- .github/workflows/build-ios.yml | 5 +++-- .github/workflows/build-linux-arm.yml | 6 +++--- .github/workflows/build-linux64.yml | 2 +- .github/workflows/build-macos.yml | 5 +++-- .github/workflows/build-msys2.yml | 3 ++- .github/workflows/build-vs2019-x64.yml | 2 +- .github/workflows/build-vs2022-arm64.yml | 2 +- .github/workflows/build-vs2022-arm64ec.yml | 2 +- .github/workflows/build-vs2022-x64.yml | 2 +- 11 files changed, 17 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/.DS_Store diff --git a/.github/workflows/.DS_Store b/.github/workflows/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Fri, 10 Jan 2025 14:51:12 +1100 Subject: [PATCH 74/78] Workflow --- .github/workflows/build-emscripten.yml | 7 +++++- .github/workflows/build-ios.yml | 7 +++++- .github/workflows/build-linux-arm.yml | 26 ++++++++++++++++++---- .github/workflows/build-linux64.yml | 10 ++++++--- .github/workflows/build-macos.yml | 7 +++++- .github/workflows/build-msys2.yml | 9 +++++++- .github/workflows/build-tvos.yml | 7 +++++- .github/workflows/build-vs2019-x64.yml | 7 +++++- .github/workflows/build-vs2022-arm64.yml | 7 +++++- .github/workflows/build-vs2022-arm64ec.yml | 7 +++++- .github/workflows/build-vs2022-x64.yml | 7 +++++- 11 files changed, 85 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index bc1e0e9bd..0226c7636 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -20,7 +20,6 @@ env: jobs: build-emscripten: - if: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest strategy: matrix: @@ -28,6 +27,12 @@ jobs: PTHREADS: [0, 1] steps: - uses: actions/checkout@v4.2.2 + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Docker Step run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:${{ env.EMSDK_VERSION }} bash - name: Scripts Calc Formula diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index f5919185e..3ab10e702 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -21,7 +21,6 @@ env: jobs: build-for-ios-platform: - if: env.DISABLE_WORKFLOW != 'true' runs-on: macos-14 strategy: matrix: @@ -30,6 +29,12 @@ jobs: BUNDLE: ${{ matrix.bundle }} DEVELOPER_DIR: "/Applications/Xcode.app/Contents/Developer" steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Determine Release id: vars shell: bash diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index ce5a320ce..7c752ef51 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -13,11 +13,10 @@ env: jobs: build-linux-aarch64: - if: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest env: TARGET: linuxaarch64 - ARCH: arm64 + ARCH: arm64 WORKDIR: "/home/runner/work/apothecary/apothecary" SYSROOT: "/home/runner/work/apothecary/apothecary/raspbian_rootfs" TOOLCHAIN_ROOT: "/home/runner/work/apothecary/apothecary/raspbian" @@ -26,6 +25,13 @@ jobs: steps: - uses: actions/checkout@v4.2.2 + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + - name: Determine Release id: vars shell: bash @@ -91,7 +97,6 @@ jobs: files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv6l-pi-1zero: - if: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest env: TARGET: linuxarmv6l @@ -103,6 +108,13 @@ jobs: steps: - uses: actions/checkout@v4.2.2 + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + - name: Determine Release id: vars shell: bash @@ -171,7 +183,6 @@ jobs: files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}${{ env.ARCH }}.tar.bz2 build-linux-armv7-pi3ab45: - if: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest env: TARGET: linuxarmv7l @@ -183,6 +194,13 @@ jobs: steps: - uses: actions/checkout@v4.2.2 + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi + - name: Determine Release id: vars shell: bash diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index d46627ca2..6b512f1c7 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -21,7 +21,6 @@ env: jobs: build-linux64: - if: env.DISABLE_WORKFLOW != 'true' runs-on: ubuntu-latest strategy: matrix: @@ -35,9 +34,14 @@ jobs: env: TARGET: ${{matrix.cfg.target}} GCC: ${{matrix.cfg.gcc}} - steps: + steps: - uses: actions/checkout@v4.2.2 - + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Determine Release id: vars shell: bash diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 0a4ddcaec..ac10302b2 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -21,7 +21,6 @@ env: jobs: build-macos-platforms: - if: env.DISABLE_WORKFLOW != 'true' runs-on: macos-14 strategy: matrix: @@ -30,6 +29,12 @@ jobs: BUNDLE: ${{ matrix.bundle }} DEVELOPER_DIR: "/Applications/Xcode.app/Contents/Developer" steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Determine Release id: vars shell: bash diff --git a/.github/workflows/build-msys2.yml b/.github/workflows/build-msys2.yml index 7f6aa18ab..7430f03de 100644 --- a/.github/workflows/build-msys2.yml +++ b/.github/workflows/build-msys2.yml @@ -17,10 +17,11 @@ env: NO_FORCE: 1 GA_CI_SECRET: ${{ secrets.CI_SECRET }} USE_ARTIFACT: false + DISABLE_WORKFLOW: "true" jobs: build-msys2: - + strategy: matrix: flavor: @@ -34,6 +35,12 @@ jobs: run: shell: msys2 {0} steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Setup msys2 uses: msys2/setup-msys2@v2 with: diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index c0c956940..05c9c5e2b 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -21,7 +21,6 @@ env: jobs: build-macos-platforms: - if: env.DISABLE_WORKFLOW != 'true' runs-on: macos-14 strategy: matrix: @@ -30,6 +29,12 @@ jobs: BUNDLE: ${{ matrix.bundle }} DEVELOPER_DIR: "/Applications/Xcode.app/Contents/Developer" steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Determine Release id: vars shell: bash diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 2ccb50eab..8c3a3950a 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -23,7 +23,6 @@ env: jobs: build-vs2019: - if: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2019 strategy: matrix: @@ -32,6 +31,12 @@ jobs: run: shell: msys2 {0} steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Setup msys2 uses: msys2/setup-msys2@v2 with: diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index 96b87e254..e6e7a63f8 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -23,7 +23,6 @@ env: jobs: build-vs2022: - if: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2022 strategy: matrix: @@ -32,6 +31,12 @@ jobs: run: shell: msys2 {0} steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Setup msys2 uses: msys2/setup-msys2@v2 with: diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 529e4c207..1d92f3df4 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -23,7 +23,6 @@ env: jobs: build-vs2022: - if: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2022 strategy: matrix: @@ -33,6 +32,12 @@ jobs: shell: msys2 {0} steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 #with: diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index ac2a4fb3d..7cdc185f4 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -23,7 +23,6 @@ env: jobs: build-vs2022: - if: env.DISABLE_WORKFLOW != 'true' runs-on: windows-2022 strategy: matrix: @@ -32,6 +31,12 @@ jobs: run: shell: msys2 {0} steps: + - name: Check if Workflow is disabled + run: | + if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then + echo "Workflow is disabled. Exiting." + exit 0 + fi - name: Setup msys2 uses: msys2/setup-msys2@v2 with: From f63d525cfe1cddd020dee9bf50f85be1812b5b5f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 14:54:26 +1100 Subject: [PATCH 75/78] Exit if disabled --- .github/workflows/build-emscripten.yml | 2 +- .github/workflows/build-ios.yml | 2 +- .github/workflows/build-linux-arm.yml | 6 +++--- .github/workflows/build-linux64.yml | 2 +- .github/workflows/build-macos.yml | 2 +- .github/workflows/build-msys2.yml | 2 +- .github/workflows/build-tvos.yml | 2 +- .github/workflows/build-vs2019-x64.yml | 2 +- .github/workflows/build-vs2022-arm64.yml | 2 +- .github/workflows/build-vs2022-arm64ec.yml | 2 +- .github/workflows/build-vs2022-x64.yml | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-emscripten.yml b/.github/workflows/build-emscripten.yml index 0226c7636..d6890dad8 100644 --- a/.github/workflows/build-emscripten.yml +++ b/.github/workflows/build-emscripten.yml @@ -31,7 +31,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Docker Step run: docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:${{ env.EMSDK_VERSION }} bash diff --git a/.github/workflows/build-ios.yml b/.github/workflows/build-ios.yml index 3ab10e702..81884c91d 100644 --- a/.github/workflows/build-ios.yml +++ b/.github/workflows/build-ios.yml @@ -33,7 +33,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release id: vars diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index 7c752ef51..0b19a8c7d 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -29,7 +29,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release @@ -112,7 +112,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release @@ -198,7 +198,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release diff --git a/.github/workflows/build-linux64.yml b/.github/workflows/build-linux64.yml index 6b512f1c7..9a15514e6 100644 --- a/.github/workflows/build-linux64.yml +++ b/.github/workflows/build-linux64.yml @@ -40,7 +40,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release id: vars diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index ac10302b2..364034911 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -33,7 +33,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release id: vars diff --git a/.github/workflows/build-msys2.yml b/.github/workflows/build-msys2.yml index 7430f03de..f36ec278d 100644 --- a/.github/workflows/build-msys2.yml +++ b/.github/workflows/build-msys2.yml @@ -39,7 +39,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Setup msys2 uses: msys2/setup-msys2@v2 diff --git a/.github/workflows/build-tvos.yml b/.github/workflows/build-tvos.yml index 05c9c5e2b..534802640 100644 --- a/.github/workflows/build-tvos.yml +++ b/.github/workflows/build-tvos.yml @@ -33,7 +33,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Determine Release id: vars diff --git a/.github/workflows/build-vs2019-x64.yml b/.github/workflows/build-vs2019-x64.yml index 8c3a3950a..2213a5e69 100644 --- a/.github/workflows/build-vs2019-x64.yml +++ b/.github/workflows/build-vs2019-x64.yml @@ -35,7 +35,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Setup msys2 uses: msys2/setup-msys2@v2 diff --git a/.github/workflows/build-vs2022-arm64.yml b/.github/workflows/build-vs2022-arm64.yml index e6e7a63f8..cf3670257 100644 --- a/.github/workflows/build-vs2022-arm64.yml +++ b/.github/workflows/build-vs2022-arm64.yml @@ -35,7 +35,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Setup msys2 uses: msys2/setup-msys2@v2 diff --git a/.github/workflows/build-vs2022-arm64ec.yml b/.github/workflows/build-vs2022-arm64ec.yml index 1d92f3df4..55c32bdf8 100644 --- a/.github/workflows/build-vs2022-arm64ec.yml +++ b/.github/workflows/build-vs2022-arm64ec.yml @@ -36,7 +36,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Setup MSBuild uses: microsoft/setup-msbuild@v2 diff --git a/.github/workflows/build-vs2022-x64.yml b/.github/workflows/build-vs2022-x64.yml index 7cdc185f4..f61c28e16 100644 --- a/.github/workflows/build-vs2022-x64.yml +++ b/.github/workflows/build-vs2022-x64.yml @@ -35,7 +35,7 @@ jobs: run: | if [ "${{ env.DISABLE_WORKFLOW }}" == "true" ]; then echo "Workflow is disabled. Exiting." - exit 0 + exit 1 fi - name: Setup msys2 uses: msys2/setup-msys2@v2 From 51fb3fdbad45cead006d63cf4079ac8d9fc4ace9 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 15:07:20 +1100 Subject: [PATCH 76/78] linux missing libc --- apothecary/toolchains/linux64.toolchain.cmake | 9 ++++++--- scripts/linux/install.sh | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/apothecary/toolchains/linux64.toolchain.cmake b/apothecary/toolchains/linux64.toolchain.cmake index edbbe9814..c628fe14b 100644 --- a/apothecary/toolchains/linux64.toolchain.cmake +++ b/apothecary/toolchains/linux64.toolchain.cmake @@ -51,10 +51,13 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/lib/ \ + -L${CMAKE_SYSROOT}/usr/lib/") + # Compiler and linker flags -set(CMAKE_C_FLAGS "-fPIC -O3 -Wall -Wextra -march=x86-64 -mtune=generic") -set(CMAKE_CXX_FLAGS "-fPIC -O3 -Wall -Wextra -std=c++${CPP_STANDARD} -march=x86-64 -mtune=generic") -set(CMAKE_EXE_LINKER_FLAGS "-fPIE -pie") +set(CMAKE_C_FLAGS "-fPIC -O3 -Wall -Wextra -march=x86-64 -mtune=generic ${EXTRA_LINKS}") +set(CMAKE_CXX_FLAGS "-fPIC -O3 -Wall -Wextra -std=c++${CPP_STANDARD} -march=x86-64 -mtune=generic ${EXTRA_LINKS}") +set(CMAKE_EXE_LINKER_FLAGS "-fPIE -pie ${EXTRA_LINKS}") set(CMAKE_SHARED_LINKER_FLAGS "-shared -fPIC") diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index 3b26aaaf6..8aa097da8 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -49,7 +49,7 @@ if [ "$GCC" == "gcc4" ]; then sudo add-apt-repository -y ppa:dns/gnu sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -q - sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo apt-get install -y --allow-unauthenticated gcc-4.9 g++-4.9 #needed because github actions defaults to gcc 5 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 @@ -64,7 +64,7 @@ elif [ "$GCC" == "gcc5" ]; then sudo apt-get update -q sudo apt-get install -y --allow-unauthenticated gcc-5 g++-5 sudo apt-get install -f - sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo apt-get remove -y --purge g++-4.8 sudo apt-get autoremove sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100 @@ -77,7 +77,7 @@ elif [ "$GCC" == "gcc6" ]; then sudo add-apt-repository -y "deb http://cz.archive.ubuntu.com/ubuntu bionic main universe" sudo apt-get update sudo apt-get install -y --allow-unauthenticated gcc-6 g++-6 - sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo apt-get autoremove sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100 @@ -91,7 +91,7 @@ elif [ "$GCC" == "gcc7" ]; then sudo add-apt-repository -y "deb http://cz.archive.ubuntu.com/ubuntu focal main universe" sudo apt-get update sudo apt-get install -y --allow-unauthenticated gcc-7 g++-7 - sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo apt-get autoremove sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 100 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100 @@ -105,6 +105,7 @@ elif [ "$GCC" == "gcc8" ]; then sudo apt update sudo apt install -y --allow-unauthenticated gcc-8 g++-8 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 --slave /usr/bin/g++ g++ /usr/bin/g++-8 + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo update-alternatives --config gcc gcc --version g++ -v @@ -116,6 +117,7 @@ elif [ "$GCC" == "gcc11" ]; then sudo apt update sudo apt install -y --allow-unauthenticated gcc-11 g++-11 -y sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 11 --slave /usr/bin/g++ g++ /usr/bin/g++-11 + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo update-alternatives --config gcc gcc --version g++ -v @@ -127,6 +129,7 @@ elif [ "$GCC" == "gcc12" ]; then sudo apt update sudo apt install -y --allow-unauthenticated gcc-12 g++-12 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 --slave /usr/bin/g++ g++ /usr/bin/g++-12 + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo update-alternatives --config gcc gcc --version g++ -v @@ -138,6 +141,7 @@ elif [ "$GCC" == "gcc13" ]; then sudo apt update sudo apt install -y --allow-unauthenticated gcc-13 g++-13 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13 --slave /usr/bin/g++ g++ /usr/bin/g++-13 + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev sudo update-alternatives --config gcc gcc --version g++ -v @@ -160,6 +164,7 @@ elif [ "$GCC" == "gcc15" ]; then sudo apt update sudo apt install -y build-essential flex bison libgmp-dev libmpc-dev libmpfr-dev texinfo wget + sudo apt-get install -y gperf coreutils libxrandr-dev libxinerama-dev libx11-dev libxcursor-dev libxi-dev libc6-dev wget https://ftp.gnu.org/gnu/gcc/gcc-15.0.0/gcc-15.0.0.tar.gz tar -xvzf gcc-15.0.0.tar.gz @@ -197,6 +202,10 @@ sudo apt-get -y install libasound-dev libjack-dev libpulse-dev oss4-dev #rtaudio sudo apt-get update && sudo apt-get install -y autoconf libtool automake dos2unix sudo apt-get update && sudo apt-get install -y cmake +sudo apt build-dep cmake + +find /lib /usr/lib -name 'libc' + # Download the installer script # CMAKE_VERSION=3.30.0 # wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh From cfa4dfb70ad4faf1abe657aa3614dd9f406293f6 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 15:15:17 +1100 Subject: [PATCH 77/78] Linux --- apothecary/linuxaarch64_configure.sh | 2 ++ apothecary/linuxarmv6l_configure.sh | 1 + apothecary/linuxarmv7l_configure.sh | 1 + scripts/linux/install.sh | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 45f8fefa4..6f9c4a9f9 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -9,6 +9,8 @@ RASP="$RPI_ROOT" export GCC_PREFIX="aarch64-linux-gnu" export GCC_VERSION="14.2.0" # Adjust as needed +CMAKE_LIBRARY_ARCHITECTURE=${GCC_PREFIX} + # Update PATH and library paths export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib diff --git a/apothecary/linuxarmv6l_configure.sh b/apothecary/linuxarmv6l_configure.sh index 4fa76f6fa..c436ba863 100755 --- a/apothecary/linuxarmv6l_configure.sh +++ b/apothecary/linuxarmv6l_configure.sh @@ -6,6 +6,7 @@ RASP="$RPI_ROOT" # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed +CMAKE_LIBRARY_ARCHITECTURE=${GCC_PREFIX} export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib diff --git a/apothecary/linuxarmv7l_configure.sh b/apothecary/linuxarmv7l_configure.sh index b7d3bfdd0..a8a986e11 100755 --- a/apothecary/linuxarmv7l_configure.sh +++ b/apothecary/linuxarmv7l_configure.sh @@ -7,6 +7,7 @@ RASP="$RPI_ROOT" # Set GCC cross-compilation variables export GCC_PREFIX="arm-linux-gnueabihf" export GCC_VERSION="14.2.0" # Adjust as needed +CMAKE_LIBRARY_ARCHITECTURE=${GCC_PREFIX} export LIBRARY_PATH=${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib:${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/lib:${TOOLCHAIN_ROOT}/lib export LD_LIBRARY_PATH=${TOOLCHAIN_ROOT}/lib diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index 8aa097da8..5bfc3c2ea 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -202,7 +202,7 @@ sudo apt-get -y install libasound-dev libjack-dev libpulse-dev oss4-dev #rtaudio sudo apt-get update && sudo apt-get install -y autoconf libtool automake dos2unix sudo apt-get update && sudo apt-get install -y cmake -sudo apt build-dep cmake +# sudo apt build-dep cmake find /lib /usr/lib -name 'libc' From 6f8159fdae30bbf4d781258fbd68e75fa5418fea Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 10 Jan 2025 15:36:24 +1100 Subject: [PATCH 78/78] Arm fixes --- apothecary/formulas/glew/glew.sh | 2 +- apothecary/linuxaarch64_configure.sh | 8 ++++- apothecary/toolchains/linux64.toolchain.cmake | 5 +-- .../linuxaarch64-clang.toolchain.cmake | 36 +++++++++++++------ scripts/linux/install.sh | 2 +- scripts/linuxarmv7l/install_and_build.sh | 6 ++-- 6 files changed, 40 insertions(+), 19 deletions(-) diff --git a/apothecary/formulas/glew/glew.sh b/apothecary/formulas/glew/glew.sh index 345e92cdf..e80726fa8 100644 --- a/apothecary/formulas/glew/glew.sh +++ b/apothecary/formulas/glew/glew.sh @@ -117,7 +117,7 @@ function build() { make clean make elif [ "$TYPE" == "linux" ] || [ "$TYPE" == "linux64" ] ; then - echoVerbose "building $TYPE | $ARCH " + echoVerbose "building $TYPE | $ARCH BUILD GCC: $GCC_VERSION" echoVerbose "--------------------" mkdir -p "build_${TYPE}_${ARCH}" cd "build_${TYPE}_${ARCH}" diff --git a/apothecary/linuxaarch64_configure.sh b/apothecary/linuxaarch64_configure.sh index 6f9c4a9f9..13c0927f7 100755 --- a/apothecary/linuxaarch64_configure.sh +++ b/apothecary/linuxaarch64_configure.sh @@ -53,6 +53,12 @@ export LDFLAGS="--sysroot=${RPI_ROOT} \ -L${TOOLCHAIN_ROOT}/${GCC_PREFIX}/libc/usr/lib64 \ -L${TOOLCHAIN_ROOT}/lib/gcc/${GCC_PREFIX}/${GCC_VERSION}" + + +[ -d "${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}" ] && ls -la "${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}" || echo "Directory not found: ${RPI_ROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}" +[ -d "${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64" ] && ls -la "${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64" || echo "Directory not found: ${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/lib64" +[ -d "${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}" ] && ls -la "${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}" || echo "Directory not found: ${TOOLCHAIN_ROOT}/lib/gcc/${CMAKE_LIBRARY_ARCHITECTURE}/${GCC_VERSION}" + # Host system for cross-compilation export HOST="${GCC_PREFIX}" @@ -61,7 +67,7 @@ echo "--------------------" echo "openFrameworks apothecary Cross Compiler: $GCC_PREFIX" echo "Using GCC Version: $GCC_VERSION" echo "Library Path: $LIBRARY_PATH" -echo "Toolchain Path: $RASP" +echo "SYSROOT Path: $RASP" echo "Toolchain ROOT: $TOOLCHAIN_ROOT" echo "GCC Path: $GCCPATH" echo "LDFLAGS : $LDFLAGS" diff --git a/apothecary/toolchains/linux64.toolchain.cmake b/apothecary/toolchains/linux64.toolchain.cmake index c628fe14b..ac0329a44 100644 --- a/apothecary/toolchains/linux64.toolchain.cmake +++ b/apothecary/toolchains/linux64.toolchain.cmake @@ -51,8 +51,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/lib/ \ - -L${CMAKE_SYSROOT}/usr/lib/") +set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/lib/x86_64-linux-gnu \ + -L${CMAKE_SYSROOT}/lib/x86_64-linux-gnu \ + -L${CMAKE_SYSROOT}/usr/lib/x86_64-linux-gnu") # Compiler and linker flags set(CMAKE_C_FLAGS "-fPIC -O3 -Wall -Wextra -march=x86-64 -mtune=generic ${EXTRA_LINKS}") diff --git a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake index d21ce97da..31e92d9ca 100644 --- a/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake +++ b/apothecary/toolchains/linuxaarch64-clang.toolchain.cmake @@ -41,6 +41,10 @@ set(EXTRA_LINKS "-Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHIT -L${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64 \ -Wl,-rpath-link,${TOOLCHAIN_ROOT}/${CMAKE_LIBRARY_ARCHITECTURE}/libc/usr/lib64") +message(STATUS "CMAKE_SYSROOT: ${CMAKE_SYSROOT}") +message(STATUS "CMAKE_LIBRARY_ARCHITECTURE: ${CMAKE_LIBRARY_ARCHITECTURE}") +message(STATUS "TOOLCHAIN_ROOT: ${TOOLCHAIN_ROOT}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC ${EXTRA_LINKS}") set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=${M_CPU} -march=armv8-a+fp+simd") @@ -48,18 +52,24 @@ set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=${M_CPU} -march set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC ${EXTRA_LINKS} -mcpu=${M_CPU} -march=armv8-a+fp+simd") ## Compiler Binary -set(BIN_PREFIX ${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}) - -set(CMAKE_C_COMPILER ${BIN_PREFIX}-gcc) -set(CMAKE_CXX_COMPILER ${BIN_PREFIX}-g++ ) -set(CMAKE_LINKER ${BIN_PREFIX}-ld CACHE STRING "Set the cross-compiler tool LD" FORCE) -set(CMAKE_AR ${BIN_PREFIX}-ar CACHE STRING "Set the cross-compiler tool AR" FORCE) -set(CMAKE_NM {BIN_PREFIX}-nm CACHE STRING "Set the cross-compiler tool NM" FORCE) -SET(CMAKE_OBJCOPY ${BIN_PREFIX}-objcopy CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) -set(CMAKE_OBJDUMP ${BIN_PREFIX}-objdump CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) -set(CMAKE_RANLIB ${BIN_PREFIX}-ranlib CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) -set(CMAKE_STRIP ${BIN_PREFIX}-strip CACHE STRING "Set the cross-compiler tool STRIP" FORCE) +set(BIN_PREFIX "${TOOLCHAIN_ROOT}/bin/${CMAKE_LIBRARY_ARCHITECTURE}") + +# Define compilers and tools with proper string interpolation +#set(CMAKE_C_COMPILER "${BIN_PREFIX}-gcc" CACHE STRING "Set the cross-compiler tool GCC" FORCE) +#set(CMAKE_CXX_COMPILER "${BIN_PREFIX}-g++" CACHE STRING "Set the cross-compiler tool G++" FORCE) + +find_program(CMAKE_C_COMPILER aarch64-linux-gnu-gcc PATHS "${TOOLCHAIN_ROOT}/bin/") +find_program(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++ PATHS "${TOOLCHAIN_ROOT}/bin/") +set(CMAKE_LINKER "${BIN_PREFIX}-ld" CACHE STRING "Set the cross-compiler tool LD" FORCE) +set(CMAKE_AR "${BIN_PREFIX}-ar" CACHE STRING "Set the cross-compiler tool AR" FORCE) +set(CMAKE_NM "${BIN_PREFIX}-nm" CACHE STRING "Set the cross-compiler tool NM" FORCE) +set(CMAKE_OBJCOPY "${BIN_PREFIX}-objcopy" CACHE STRING "Set the cross-compiler tool OBJCOPY" FORCE) +set(CMAKE_OBJDUMP "${BIN_PREFIX}-objdump" CACHE STRING "Set the cross-compiler tool OBJDUMP" FORCE) +set(CMAKE_RANLIB "${BIN_PREFIX}-ranlib" CACHE STRING "Set the cross-compiler tool RANLIB" FORCE) +set(CMAKE_STRIP "${BIN_PREFIX}-strip" CACHE STRING "Set the cross-compiler tool STRIP" FORCE) + +# Check if critical tools exist if(NOT EXISTS ${CMAKE_C_COMPILER}) message(FATAL_ERROR "C Compiler not found: ${CMAKE_C_COMPILER}") endif() @@ -68,6 +78,10 @@ if(NOT EXISTS ${CMAKE_CXX_COMPILER}) message(FATAL_ERROR "C++ Compiler not found: ${CMAKE_CXX_COMPILER}") endif() +if(NOT EXISTS ${CMAKE_LINKER}) + message(FATAL_ERROR "Linker not found: ${CMAKE_LINKER}") +endif() + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh index 5bfc3c2ea..66772549d 100755 --- a/scripts/linux/install.sh +++ b/scripts/linux/install.sh @@ -200,7 +200,7 @@ fi sudo apt-get -y install libasound-dev libjack-dev libpulse-dev oss4-dev #rtaudio sudo apt-get update && sudo apt-get install -y autoconf libtool automake dos2unix -sudo apt-get update && sudo apt-get install -y cmake +sudo apt-get update && sudo apt-get install -y cmake build-essential # sudo apt build-dep cmake diff --git a/scripts/linuxarmv7l/install_and_build.sh b/scripts/linuxarmv7l/install_and_build.sh index 4769c4a34..808ab5745 100644 --- a/scripts/linuxarmv7l/install_and_build.sh +++ b/scripts/linuxarmv7l/install_and_build.sh @@ -50,9 +50,9 @@ sudo chmod +x SSymlinker # ./SSymlinker -s ${LIBC_USR}/include/sound -d /usr/include ./SSymlinker -s ${LIBC_USR}/include/video -d /usr/include ./SSymlinker -s ${LIBC_USR}/include -d /usr/include -./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o -./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o -./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o +# ./SSymlinker -s ${CRT}/crtn.o -d /usr/lib/crtn.o +# ./SSymlinker -s ${CRT}/crt1.o -d /usr/lib/crt1.o +# ./SSymlinker -s ${CRT}/crti.o -d /usr/lib/crti.o echo 'export PATH=$PATH' >> .bashrc echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH' >> .bashrc