Skip to content

Commit 7ead221

Browse files
authored
Major Bug Fixes and Improvements (PR #62)
- 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
2 parents 716cd80 + 80cc230 commit 7ead221

18 files changed

+723
-214
lines changed

Diff for: .github/workflows/builder_64.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ jobs:
5757
strategy:
5858
matrix:
5959
gcc_versions: [6.3.0, 8.3.0]
60+
rpios_types: [stretch, buster]
6061
env:
62+
RPIOS_TYPE: ${{ matrix.rpios_types }}
6163
GCC_VERSION: ${{ matrix.gcc_versions }}
6264
COMPILER_TYPE: CROSS
6365
BASE: true
@@ -84,7 +86,7 @@ jobs:
8486
source ~/.bashrc && echo $PATH
8587
if: success()
8688
- name: script
87-
run: bash build-scripts/CI/CIBB_64b -g $GCC_VERSION
89+
run: bash build-scripts/CI/CIBB_64b -g $GCC_VERSION -o $RPIOS_TYPE
8890
shell: bash
8991
if: success() && (github.event_name == 'pull_request' || github.event_name == 'release')
9092
- name: before_script
@@ -103,7 +105,9 @@ jobs:
103105
strategy:
104106
matrix:
105107
gcc_versions: [6.3.0, 8.3.0, 9.3.0, 10.2.0]
108+
rpios_types: [stretch, buster]
106109
env:
110+
RPIOS_TYPE: ${{ matrix.rpios_types }}
107111
GCC_VERSION: ${{ matrix.gcc_versions }}
108112
COMPILER_TYPE: CROSS
109113
steps:
@@ -129,7 +133,7 @@ jobs:
129133
source ~/.bashrc && echo $PATH
130134
if: success()
131135
- name: script
132-
run: bash build-scripts/CI/CICTB_64b -g $GCC_VERSION
136+
run: bash build-scripts/CI/CICTB_64b -g $GCC_VERSION -o $RPIOS_TYPE
133137
shell: bash
134138
if: success()
135139
- name: before_script
@@ -148,7 +152,9 @@ jobs:
148152
strategy:
149153
matrix:
150154
gcc_versions: [8.3.0, 9.3.0, 10.2.0]
155+
rpios_types: [stretch, buster]
151156
env:
157+
RPIOS_TYPE: ${{ matrix.rpios_types }}
152158
GCC_VERSION: ${{ matrix.gcc_versions }}
153159
COMPILER_TYPE: NATIVE
154160
steps:
@@ -174,7 +180,7 @@ jobs:
174180
source ~/.bashrc && echo $PATH
175181
if: success()
176182
- name: script
177-
run: bash build-scripts/CI/CINTB_64b -g $GCC_VERSION
183+
run: bash build-scripts/CI/CINTB_64b -g $GCC_VERSION -o $RPIOS_TYPE
178184
shell: bash
179185
if: success()
180186
- name: before_script

Diff for: .github/workflows/docs.yml

+20-6
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,32 @@ jobs:
194194
bash utils/SF_docs_deployer -t "native" -f "main" -o "stretch"
195195
shell: bash
196196
if: success()
197-
- name: move_deploy_cross_64
197+
- name: move_deploy_cross_64_buster
198+
run: |
199+
mkdir -p $HOME/main
200+
cp docs/cross-gcc64-buster.md $HOME/main/README.md
201+
bash utils/SF_docs_deployer -t "cross_64" -f "main" -o "buster"
202+
shell: bash
203+
if: success()
204+
- name: move_deploy_cross_64_stretch
205+
run: |
206+
mkdir -p $HOME/main
207+
cp docs/cross-gcc64-stretch.md $HOME/main/README.md
208+
bash utils/SF_docs_deployer -t "cross_64" -f "main" -o "stretch"
209+
shell: bash
210+
if: success()
211+
- name: move_deploy_native_64_buster
198212
run: |
199213
mkdir -p $HOME/main
200-
cp docs/cross-gcc64.md $HOME/main/README.md
201-
bash utils/SF_docs_deployer -t "cross_64" -f "main"
214+
cp docs/native-gcc64-buster.md $HOME/main/README.md
215+
bash utils/SF_docs_deployer -t "native_64" -f "main" -o "buster"
202216
shell: bash
203217
if: success()
204-
- name: move_deploy_native_64
218+
- name: move_deploy_native_64_stretch
205219
run: |
206220
mkdir -p $HOME/main
207-
cp docs/native-gcc64.md $HOME/main/README.md
208-
bash utils/SF_docs_deployer -t "native_64" -f "main"
221+
cp docs/native-gcc64-stretch.md $HOME/main/README.md
222+
bash utils/SF_docs_deployer -t "native_64" -f "main" -o "stretch"
209223
shell: bash
210224
if: success()
211225

Diff for: QT_build_instructions.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
2626

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

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

3131
</td></tr></table>
3232

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

816816
# Acknowledgments
817817

818-
Thank you,
819-
820818
- 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.
821-
- [QT framework](https://www.qt.io/), for providing the source files
819+
- Thank you [QT framework](https://www.qt.io/), for providing the source files
822820

823821
[downloads]:https://sourceforge.net/projects/raspberry-pi-cross-compilers/files
824822
[license]:https://github.com/abhiTronix/raspberry-pi-cross-compilers/blob/master/LICENSE

Diff for: README.md

+69-94
Large diffs are not rendered by default.

Diff for: build-scripts/CI/CIBB_32b

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -r
191191
cd "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build || exit
192192
../configure --target=$TARGET --prefix= --with-arch=$ARCH --with-fpu=$FPU --with-float=hard --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --disable-multilib
193193
make -s -j$(getconf _NPROCESSORS_ONLN)
194-
make -s install DESTDIR="$INSTALLDIR"
194+
make -s install-strip DESTDIR="$INSTALLDIR"
195195
if [ -n "$(ls -A "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/binutils-$BINUTILS_VERSION/build/*; fi
196196

197197
echo "Building Cross GCC $GCC_VERSION BASE Binaries..."
198198
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCC_VERSION/build/*; fi
199199
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
200200
../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
201201
make -s -j$(getconf _NPROCESSORS_ONLN) all-gcc
202-
make -s install-gcc DESTDIR="$INSTALLDIR"
202+
make -s install-strip-gcc DESTDIR="$INSTALLDIR"
203203
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
204204
cd "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build || exit
205205
../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
@@ -217,7 +217,7 @@ make -s install DESTDIR="$SYSROOTDIR"
217217
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
218218
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
219219
make -s -j$(getconf _NPROCESSORS_ONLN)
220-
make -s install DESTDIR="$INSTALLDIR"
220+
make -s install-strip DESTDIR="$INSTALLDIR"
221221

222222
mv "$BUILDDIR"/cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION "$HOME"
223223
cd "$HOME" || exit

Diff for: build-scripts/CI/CIBB_64b

+12-12
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,41 @@ helpfunction() {
3333
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
3434
echo ""
3535
echo ""
36-
echo "Usage: $0 -g [GCC version] -t [OS Type]"
36+
echo "Usage: $0 -g [GCC version] -o [Target Pi OS type]"
3737
echo -e "\t-g GCC base version?: (6.3.0|8.3.0)"
38-
echo -e "\t-t What's yours Raspberry Pi OS type?: (1|2) [default:1]"
38+
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (stretch|buster)"
3939
echo ""
4040
echo ""
4141
exit 1 # Exits script after printing help
4242
}
4343

4444
#input arguments handler
45-
while getopts "g:t:" opt; do
45+
while getopts "g:o:" opt; do
4646
case "$opt" in
4747
g) GCC_VERSION="$OPTARG" ;;
48-
t) OS_TYPE="$OPTARG" ;;
48+
o) RPIOS_TYPE="$OPTARG" ;;
4949
?) helpfunction ;; #prints help function for invalid parameter
5050
esac
5151
done
5252
#validates parameters and print usage helper function in case parameters are missing
5353
if [ -z "$GCC_VERSION" ]; then
5454
echo "Required parameter is missing!"
5555
helpfunction
56-
elif [ -z "$OS_TYPE" ]; then
57-
OS_TYPE=1
56+
elif [ -z "$RPIOS_TYPE" ]; then
57+
RPIOS_TYPE="stretch"
5858
else
5959
echo "Parameters configured!"
6060
fi
6161

6262
#collect dependencies versions from raspberry pi os
63-
if [ "$OS_TYPE" = "1" ]; then
63+
if [ "$RPIOS_TYPE" = "stretch" ]; then
6464
GLIBC_VERSION=2.24
6565
BINUTILS_VERSION=2.28
66-
elif [ "$OS_TYPE" = "2" ]; then
66+
elif [ "$RPIOS_TYPE" = "buster" ]; then
6767
GLIBC_VERSION=2.28
6868
BINUTILS_VERSION=2.31
6969
else
70-
echo "Invalid argument value: $OS_TYPE"
70+
echo "Invalid argument value: $RPIOS_TYPE"
7171
exit
7272
fi
7373

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

180180
echo "Building Cross GCC $GCC_VERSION BASE Binaries..."
181181
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCC_VERSION/build/*; fi
182182
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
183183
../configure --prefix= --target=$TARGET --enable-languages=$LANGUAGES --with-sysroot=/$TARGET/libc --with-build-sysroot="$SYSROOTDIR" --with-arch=$ARCH --disable-multilib
184184
make -s -j$(getconf _NPROCESSORS_ONLN) all-gcc
185-
make -s install-gcc DESTDIR="$INSTALLDIR"
185+
make -s install-strip-gcc DESTDIR="$INSTALLDIR"
186186
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
187187
cd "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build || exit
188188
../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
@@ -200,7 +200,7 @@ make -s install DESTDIR="$SYSROOTDIR"
200200
cd "$DOWNLOADDIR"/gcc-$GCC_VERSION/build || exit
201201
if [ -n "$(ls -A "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/glibc-$GLIBC_VERSION/build/*; fi
202202
make -s -j$(getconf _NPROCESSORS_ONLN)
203-
make -s install DESTDIR="$INSTALLDIR"
203+
make -s install-strip DESTDIR="$INSTALLDIR"
204204
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-$GCC_VERSION/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-$GCC_VERSION/build/*; fi
205205

206206
mv "$BUILDDIR"/cross-pi-gcc-"$GCC_VERSION"-$FOLDER_VERSION "$HOME"

Diff for: build-scripts/CI/CICTB_32b

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ if [ "$GCC_VERSION" != "$GCCBASE_VERSION" ]; then
200200
if [ -n "$(ls -A "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build)" ]; then rm -rf "$DOWNLOADDIR"/gcc-"$GCC_VERSION"/build/*; fi
201201
../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
202202
make -s -j$(nproc)
203-
make -s install DESTDIR="$INSTALLDIR"
203+
make -s install-strip DESTDIR="$INSTALLDIR"
204204
fi
205205

206206
cd "$DOWNLOADDIR"/gcc-"$GCC_VERSION" || exit

Diff for: build-scripts/CI/CICTB_64b

+11-11
Original file line numberDiff line numberDiff line change
@@ -33,39 +33,39 @@ helpfunction() {
3333
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
3434
echo ""
3535
echo ""
36-
echo "Usage: $0 -g [GCC version] -t [Target OS type]"
37-
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)"
38-
echo -e "\t-t What's yours Target OS type?: (1|2) [default:1]"
36+
echo "Usage: $0 -g [GCC version] -o [Target OS type]"
37+
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)"
38+
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (stretch|buster)"
3939
echo ""
4040
echo ""
4141
exit 1 # Exits script after printing help
4242
}
4343

4444
#input arguments handler
45-
while getopts "g:t:" opt; do
45+
while getopts "g:o:" opt; do
4646
case "$opt" in
4747
g) GCC_VERSION="$OPTARG" ;;
48-
t) OS_TYPE="$OPTARG" ;;
48+
o) RPIOS_TYPE="$OPTARG" ;;
4949
?) helpfunction ;; #prints help function for invalid parameter
5050
esac
5151
done
5252
#validates parameters and print usage helper function in case parameters are missing
5353
if [ -z "$GCC_VERSION" ]; then
5454
echo "Error: Required parameter is missing!"
5555
helpfunction
56-
elif [ -z "$OS_TYPE" ]; then
57-
OS_TYPE=1
56+
elif [ -z "$RPIOS_TYPE" ]; then
57+
RPIOS_TYPE="stretch"
5858
else
5959
echo "Parameters configured!"
6060
fi
6161

6262
#collect dependencies versions from raspberry pi os
63-
if [ "$OS_TYPE" = "1" ] || [ "$GCC_VERSION" \< "8.3.0" ]; then
63+
if [ "$RPIOS_TYPE" = "stretch" ] || [ "$GCC_VERSION" \< "8.3.0" ]; then
6464
GCCBASE_VERSION=6.3.0
65-
elif [ "$OS_TYPE" = "2" ]; then
65+
elif [ "$RPIOS_TYPE" = "buster" ]; then
6666
GCCBASE_VERSION=8.3.0
6767
else
68-
echo "Invalid argument value: $OS_TYPE"
68+
echo "Invalid argument value: $RPIOS_TYPE"
6969
exit
7070
fi
7171

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

Diff for: build-scripts/CI/CINTB_64b

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@ helpfunction() {
3333
figlet -t -k -f /usr/share/figlet/term.flf "Copyright (c) 2020 abhiTronix"
3434
echo ""
3535
echo ""
36-
echo "Usage: $0 -g [GCC version] -t [Target OS type]"
36+
echo "Usage: $0 -g [GCC version] -o [Target OS type]"
3737
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)"
38-
echo -e "\t-t What's yours Target OS type?: (1|2) [default:1]"
38+
echo -e "\t-o What's yours Target Raspberry Pi OS type?: (stretch|buster)"
3939
echo ""
4040
echo ""
4141
exit 1 # Exits script after printing help
4242
}
4343

4444
#input arguments handler
45-
while getopts "g:t:" opt; do
45+
while getopts "g:o:" opt; do
4646
case "$opt" in
4747
g) GCC_VERSION="$OPTARG" ;;
48-
t) OS_TYPE="$OPTARG" ;;
48+
o) RPIOS_TYPE="$OPTARG" ;;
4949
?) helpfunction ;; #prints help function for invalid parameter
5050
esac
5151
done
5252
#validates parameters and print usage helper function in case parameters are missing
5353
if [ -z "$GCC_VERSION" ]; then
5454
echo "Error: Required parameter is missing!"
5555
helpfunction
56-
elif [ -z "$OS_TYPE" ]; then
57-
OS_TYPE=1
56+
elif [ -z "$RPIOS_TYPE" ]; then
57+
RPIOS_TYPE="stretch"
5858
else
5959
echo "Parameters configured!"
6060
fi

0 commit comments

Comments
 (0)