librem5: workaround atf bug on some compilers

This commit is contained in:
Danct12 2022-07-21 14:47:06 +07:00
parent ee695a0930
commit cb497f08d8
2 changed files with 19 additions and 0 deletions

View File

@ -296,6 +296,7 @@ src/u-boot-librem5:
@mkdir src/u-boot-librem5
@wget https://source.puri.sm/Librem5/u-boot-builder/-/archive/3b1c7d957f46c87c6cdd71cd8dab7c84aca26570/u-boot-builder-3b1c7d957f46c87c6cdd71cd8dab7c84aca26570.tar.gz
@tar -xf u-boot-builder-3b1c7d957f46c87c6cdd71cd8dab7c84aca26570.tar.gz --strip-components 1 -C src/u-boot-librem5
@cd src/u-boot-librem5 && patch -p1 < ../librem5-atf-bug.patch
src/u-boot-pocketpc:
@echo "WGET u-boot-pocketpc"

18
src/librem5-atf-bug.patch Normal file
View File

@ -0,0 +1,18 @@
diff --git a/build_uboot.sh b/build_uboot.sh
index d9fb650..9a4b428 100755
--- a/build_uboot.sh
+++ b/build_uboot.sh
@@ -101,8 +101,13 @@ function build_atf()
git clone "${ATF_REPO}"
fi
cd "${ATF_DIR}"
+ git reset --hard
+ git clean -f -d
git checkout "${ATF_BRANCH}"
+ # Remove -Werror to workaround a compiler bug
+ sed -i 's/-Werror//g' Makefile
+
make PLAT="${ATF_PLAT}" CROSS_COMPILE="${CROSS_COMPILER}" bl31
cd "${CWD}"