Skip to content

Commit

Permalink
Major Bug Fixes and Improvements (PR #62)
Browse files Browse the repository at this point in the history
- Patched  build-script sysroot:
	- Extended build-script sysroot patch to `RTBuilder_32b` and `RTBuilder_64b`.
	- Replaced incorrect `RPI_TYPE` with `FOLDER_VERSION`.
	- Replaced `OS_TYPE` with `RPIOS_TYPE` in `RTBuilder_64b.
- Added Buster/Stretch OS support for 64-bit envs:
	- Added Buster and Stretch native support for `RTBuilder_64b` build script.
	- Updated CI Bash scripts with new `-o` flag to support OS selection.
	- Updated YAMLs to include buster & stretch Pi OS support.
	- Updated and added new docs.
- Strip compiler executables and minor fixes: (Patch by @visglz) 
	- Strip on compiler install: This drastically reduces extracted size from 1.7GB to 477MB
- Added Verbose Flag for debugged output: (Patch by @visglz)
  - Set "set -eo pipefail" at top of script. Set "set -v" only for verbose
      mode
  - Fix wget download of Linux kernel: The output of `wget` was failing because of multiple lines. Only consider
          topmost line with most recent file)
- Removed superfluous line: (Patch by @visglz)
	- "set -eo pipefail" is already set at top of script.
- Updated strip patch for all bash-scripts for smaller binary size.
- Updated assets.
- Updated docs.
- Fixed Minor Typos and additions in Docs
  • Loading branch information
abhiTronix authored Feb 5, 2021
2 parents 716cd80 + 80cc230 commit 7ead221
Show file tree
Hide file tree
Showing 18 changed files with 723 additions and 214 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/builder_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ jobs:
strategy:
matrix:
gcc_versions: [6.3.0, 8.3.0]
rpios_types: [stretch, buster]
env:
RPIOS_TYPE: ${{ matrix.rpios_types }}
GCC_VERSION: ${{ matrix.gcc_versions }}
COMPILER_TYPE: CROSS
BASE: true
Expand All @@ -84,7 +86,7 @@ jobs:
source ~/.bashrc && echo $PATH
if: success()
- name: script
run: bash build-scripts/CI/CIBB_64b -g $GCC_VERSION
run: bash build-scripts/CI/CIBB_64b -g $GCC_VERSION -o $RPIOS_TYPE
shell: bash
if: success() && (github.event_name == 'pull_request' || github.event_name == 'release')
- name: before_script
Expand All @@ -103,7 +105,9 @@ jobs:
strategy:
matrix:
gcc_versions: [6.3.0, 8.3.0, 9.3.0, 10.2.0]
rpios_types: [stretch, buster]
env:
RPIOS_TYPE: ${{ matrix.rpios_types }}
GCC_VERSION: ${{ matrix.gcc_versions }}
COMPILER_TYPE: CROSS
steps:
Expand All @@ -129,7 +133,7 @@ jobs:
source ~/.bashrc && echo $PATH
if: success()
- name: script
run: bash build-scripts/CI/CICTB_64b -g $GCC_VERSION
run: bash build-scripts/CI/CICTB_64b -g $GCC_VERSION -o $RPIOS_TYPE
shell: bash
if: success()
- name: before_script
Expand All @@ -148,7 +152,9 @@ jobs:
strategy:
matrix:
gcc_versions: [8.3.0, 9.3.0, 10.2.0]
rpios_types: [stretch, buster]
env:
RPIOS_TYPE: ${{ matrix.rpios_types }}
GCC_VERSION: ${{ matrix.gcc_versions }}
COMPILER_TYPE: NATIVE
steps:
Expand All @@ -174,7 +180,7 @@ jobs:
source ~/.bashrc && echo $PATH
if: success()
- name: script
run: bash build-scripts/CI/CINTB_64b -g $GCC_VERSION
run: bash build-scripts/CI/CINTB_64b -g $GCC_VERSION -o $RPIOS_TYPE
shell: bash
if: success()
- name: before_script
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,32 @@ jobs:
bash utils/SF_docs_deployer -t "native" -f "main" -o "stretch"
shell: bash
if: success()
- name: move_deploy_cross_64
- name: move_deploy_cross_64_buster
run: |
mkdir -p $HOME/main
cp docs/cross-gcc64-buster.md $HOME/main/README.md
bash utils/SF_docs_deployer -t "cross_64" -f "main" -o "buster"
shell: bash
if: success()
- name: move_deploy_cross_64_stretch
run: |
mkdir -p $HOME/main
cp docs/cross-gcc64-stretch.md $HOME/main/README.md
bash utils/SF_docs_deployer -t "cross_64" -f "main" -o "stretch"
shell: bash
if: success()
- name: move_deploy_native_64_buster
run: |
mkdir -p $HOME/main
cp docs/cross-gcc64.md $HOME/main/README.md
bash utils/SF_docs_deployer -t "cross_64" -f "main"
cp docs/native-gcc64-buster.md $HOME/main/README.md
bash utils/SF_docs_deployer -t "native_64" -f "main" -o "buster"
shell: bash
if: success()
- name: move_deploy_native_64
- name: move_deploy_native_64_stretch
run: |
mkdir -p $HOME/main
cp docs/native-gcc64.md $HOME/main/README.md
bash utils/SF_docs_deployer -t "native_64" -f "main"
cp docs/native-gcc64-stretch.md $HOME/main/README.md
bash utils/SF_docs_deployer -t "native_64" -f "main" -o "stretch"
shell: bash
if: success()

Expand Down
6 changes: 2 additions & 4 deletions QT_build_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.

<table align="center"><tr><td align="center">

<img alt="QT" src="https://raw.githubusercontent.com/abhiTronix/Imbakup/master/Images/gcc/qt-comp.png">
<img alt="QT" src="https://raw.githubusercontent.com/abhiTronix/Imbakup/master/Images/gcc/qt.png">

</td></tr></table>

Expand Down Expand Up @@ -815,10 +815,8 @@ This Project source-code and its precompiled binaries are licensed under the [**

# Acknowledgments

Thank you,

- This document is insipired by [Qt-Instructions for Raspberry Pi 4](https://github.com/UvinduW/Cross-Compiling-Qt-for-Raspberry-Pi-4). Huge thanks to @UvinduW.
- [QT framework](https://www.qt.io/), for providing the source files
- Thank you [QT framework](https://www.qt.io/), for providing the source files

[downloads]:https://sourceforge.net/projects/raspberry-pi-cross-compilers/files
[license]:https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/LICENSE
Expand Down
163 changes: 69 additions & 94 deletions README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build-scripts/CI/CIBB_32b
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -r
cd "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build || exit
../configure --target=$TARGET --prefix= --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --disable-multilib
make -s -j$(getconf _NPROCESSORS_ONLN)
make -s install DESTDIR="$INSTALLDIR"
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build/*; fi

echo "Building Cross GCC $GCC_VERSION BASE Binaries..."
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCC_VERSION/build/*; fi
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --disable-multilib
make -s -j$(getconf _NPROCESSORS_ONLN) all-gcc
make -s install-gcc DESTDIR="$INSTALLDIR"
make -s install-strip-gcc DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
cd "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build || exit
../configure --prefix=/usr --build="$MACHTYPE" --host=$TARGET --target=$TARGET --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-headers="$SYSROOTDIR"/usr/include --with-lib="$SYSROOTDIR"/usr/lib --disable-multilib libc_cv_forced_unwind=yes
Expand All @@ -217,7 +217,7 @@ make -s install DESTDIR="$SYSROOTDIR"
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
make -s -j$(getconf _NPROCESSORS_ONLN)
make -s install DESTDIR="$INSTALLDIR"
make -s install-strip DESTDIR="$INSTALLDIR"

mv "$BUILDDIR"/cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION "$HOME"
cd "$HOME" || exit
Expand Down
24 changes: 12 additions & 12 deletions build-scripts/CI/CIBB_64b
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,41 @@ helpfunction() {
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
echo ""
echo ""
echo "Usage: $0 -g [GCC version] -t [OS Type]"
echo "Usage: $0 -g [GCC version] -o [Target Pi OS type]"
echo -e "\t-g GCC base version?: (6.3.0|8.3.0)"
echo -e "\t-t What's yours Raspberry Pi OS type?: (1|2) [default:1]"
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (stretch|buster)"
echo ""
echo ""
exit 1 # Exits script after printing help
}

#input arguments handler
while getopts "g:t:" opt; do
while getopts "g:o:" opt; do
case "$opt" in
g) GCC_VERSION="$OPTARG" ;;
t) OS_TYPE="$OPTARG" ;;
o) RPIOS_TYPE="$OPTARG" ;;
?) helpfunction ;; #prints help function for invalid parameter
esac
done
#validates parameters and print usage helper function in case parameters are missing
if [ -z "$GCC_VERSION" ]; then
echo "Required parameter is missing!"
helpfunction
elif [ -z "$OS_TYPE" ]; then
OS_TYPE=1
elif [ -z "$RPIOS_TYPE" ]; then
RPIOS_TYPE="stretch"
else
echo "Parameters configured!"
fi

#collect dependencies versions from raspberry pi os
if [ "$OS_TYPE" = "1" ]; then
if [ "$RPIOS_TYPE" = "stretch" ]; then
GLIBC_VERSION=2.24
BINUTILS_VERSION=2.28
elif [ "$OS_TYPE" = "2" ]; then
elif [ "$RPIOS_TYPE" = "buster" ]; then
GLIBC_VERSION=2.28
BINUTILS_VERSION=2.31
else
echo "Invalid argument value: $OS_TYPE"
echo "Invalid argument value: $RPIOS_TYPE"
exit
fi

Expand Down Expand Up @@ -174,15 +174,15 @@ if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -r
cd "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build || exit
../configure --target=$TARGET --prefix= --with-arch=$ARCH --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --disable-multilib
make -s -j$(getconf _NPROCESSORS_ONLN)
make -s install DESTDIR="$INSTALLDIR"
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build/*; fi

echo "Building Cross GCC $GCC_VERSION BASE Binaries..."
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCC_VERSION/build/*; fi
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-arch=$ARCH --disable-multilib
make -s -j$(getconf _NPROCESSORS_ONLN) all-gcc
make -s install-gcc DESTDIR="$INSTALLDIR"
make -s install-strip-gcc DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
cd "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build || exit
../configure --prefix=/usr --build="$MACHTYPE" --host=$TARGET --target=$TARGET --with-arch=$ARCH --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-headers="$SYSROOTDIR"/usr/include --with-lib="$SYSROOTDIR"/usr/lib --disable-multilib libc_cv_forced_unwind=yes
Expand All @@ -200,7 +200,7 @@ make -s install DESTDIR="$SYSROOTDIR"
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
make -s -j$(getconf _NPROCESSORS_ONLN)
make -s install DESTDIR="$INSTALLDIR"
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCC_VERSION/build/*; fi

mv "$BUILDDIR"/cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION "$HOME"
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/CI/CICTB_32b
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ if [ "$GCC_VERSION" != "$GCCBASE_VERSION" ]; then
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --disable-multilib
make -s -j$(nproc)
make -s install DESTDIR="$INSTALLDIR"
make -s install-strip DESTDIR="$INSTALLDIR"
fi

cd "$DOWNLOADDIR"/gcc-"$GCC_VERSION" || exit
Expand Down
22 changes: 11 additions & 11 deletions build-scripts/CI/CICTB_64b
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,39 @@ helpfunction() {
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
echo ""
echo ""
echo "Usage: $0 -g [GCC version] -t [Target OS type]"
echo -e "\t-g GCC version you want to compile?: (7.1.0|7.2.0|7.3.0|7.4.0|7.5.0|8.1.0|8.2.0|8.3.0|9.1.0|9.2.0|9.3.0)"
echo -e "\t-t What's yours Target OS type?: (1|2) [default:1]"
echo "Usage: $0 -g [GCC version] -o [Target OS type]"
echo -e "\t-g GCC version you want to compile?: (7.1.0|7.2.0|7.3.0|7.4.0|7.5.0|8.1.0|8.2.0|8.3.0|9.1.0|9.2.0|9.3.0|10.1.0|10.2.0)"
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (stretch|buster)"
echo ""
echo ""
exit 1 # Exits script after printing help
}

#input arguments handler
while getopts "g:t:" opt; do
while getopts "g:o:" opt; do
case "$opt" in
g) GCC_VERSION="$OPTARG" ;;
t) OS_TYPE="$OPTARG" ;;
o) RPIOS_TYPE="$OPTARG" ;;
?) helpfunction ;; #prints help function for invalid parameter
esac
done
#validates parameters and print usage helper function in case parameters are missing
if [ -z "$GCC_VERSION" ]; then
echo "Error: Required parameter is missing!"
helpfunction
elif [ -z "$OS_TYPE" ]; then
OS_TYPE=1
elif [ -z "$RPIOS_TYPE" ]; then
RPIOS_TYPE="stretch"
else
echo "Parameters configured!"
fi

#collect dependencies versions from raspberry pi os
if [ "$OS_TYPE" = "1" ] || [ "$GCC_VERSION" \< "8.3.0" ]; then
if [ "$RPIOS_TYPE" = "stretch" ] || [ "$GCC_VERSION" \< "8.3.0" ]; then
GCCBASE_VERSION=6.3.0
elif [ "$OS_TYPE" = "2" ]; then
elif [ "$RPIOS_TYPE" = "buster" ]; then
GCCBASE_VERSION=8.3.0
else
echo "Invalid argument value: $OS_TYPE"
echo "Invalid argument value: $RPIOS_TYPE"
exit
fi

Expand Down Expand Up @@ -152,7 +152,7 @@ if [ "$GCC_VERSION" != "$GCCBASE_VERSION" ]; then
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-arch=$ARCH --disable-multilib
make -s -j$(nproc)
make -s install DESTDIR="$INSTALLDIR"
make -s install-strip DESTDIR="$INSTALLDIR"
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
fi

Expand Down
12 changes: 6 additions & 6 deletions build-scripts/CI/CINTB_64b
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@ helpfunction() {
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
echo ""
echo ""
echo "Usage: $0 -g [GCC version] -t [Target OS type]"
echo "Usage: $0 -g [GCC version] -o [Target OS type]"
echo -e "\t-g GCC version you want to compile?: (7.1.0|7.2.0|7.3.0|7.4.0|7.5.0|8.1.0|8.2.0|8.3.0|9.1.0|9.2.0|9.3.0|10.1.0|10.2.0)"
echo -e "\t-t What's yours Target OS type?: (1|2) [default:1]"
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (stretch|buster)"
echo ""
echo ""
exit 1 # Exits script after printing help
}

#input arguments handler
while getopts "g:t:" opt; do
while getopts "g:o:" opt; do
case "$opt" in
g) GCC_VERSION="$OPTARG" ;;
t) OS_TYPE="$OPTARG" ;;
o) RPIOS_TYPE="$OPTARG" ;;
?) helpfunction ;; #prints help function for invalid parameter
esac
done
#validates parameters and print usage helper function in case parameters are missing
if [ -z "$GCC_VERSION" ]; then
echo "Error: Required parameter is missing!"
helpfunction
elif [ -z "$OS_TYPE" ]; then
OS_TYPE=1
elif [ -z "$RPIOS_TYPE" ]; then
RPIOS_TYPE="stretch"
else
echo "Parameters configured!"
fi
Expand Down
Loading

0 comments on commit 7ead221

Please sign in to comment.