mirror of
https://github.com/linuxboot/heads.git
synced 2025-04-09 04:14:34 +00:00
Add patches to update coreboot crossgcc to v1.52
crossgcc is now using gcc 8.1.0 which will compile without issues if your host system has gcc 8.x This is required if we are to build on a new system (such as latest Fedora)
This commit is contained in:
parent
79c1434610
commit
03a09a1e1a
@ -0,0 +1,44 @@
|
||||
From 659f40bb348dd2ca02f9483ed2668465177b6a40 Mon Sep 17 00:00:00 2001
|
||||
From: Nico Huber <nico.h@gmx.de>
|
||||
Date: Wed, 23 May 2018 17:06:53 +0200
|
||||
Subject: [PATCH 50/59] buildgcc: Do not try to install GCC if build failed
|
||||
|
||||
We didn't bail out if configuring or building of GCC failed but run
|
||||
`make install` and later steps instead. This resulted in very confusing
|
||||
logs that concealed the actual error.
|
||||
|
||||
Change-Id: Ia064e0bfd96f0cbad391da3bb19e4dc304d988ff
|
||||
Signed-off-by: Nico Huber <nico.h@gmx.de>
|
||||
Reviewed-on: https://review.coreboot.org/26496
|
||||
Reviewed-by: Martin Roth <martinroth@google.com>
|
||||
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
|
||||
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
---
|
||||
util/crossgcc/buildgcc | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
|
||||
index edcea7ab42..53f9782cb5 100755
|
||||
--- a/util/crossgcc/buildgcc
|
||||
+++ b/util/crossgcc/buildgcc
|
||||
@@ -751,12 +751,12 @@ build_cross_GCC() {
|
||||
--with-gmp=$DESTDIR$TARGETDIR --with-mpfr=$DESTDIR$TARGETDIR \
|
||||
--with-mpc=$DESTDIR$TARGETDIR \
|
||||
--with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \
|
||||
- || touch .failed
|
||||
- $MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-gcc || touch .failed
|
||||
+ && \
|
||||
+ $MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-gcc && \
|
||||
$MAKE install-gcc DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
- if [ "$(echo $TARGETARCH | grep -c -- -mingw32)" -eq 0 ]; then
|
||||
- $MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-target-libgcc || touch .failed
|
||||
+ if [ ! -f .failed -a "$(echo $TARGETARCH | grep -c -- -mingw32)" -eq 0 ]; then
|
||||
+ $MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-target-libgcc && \
|
||||
$MAKE install-target-libgcc DESTDIR=$DESTDIR || touch .failed
|
||||
fi
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,130 @@
|
||||
From 46fb8b6f051b1844ef92098119e4ffa12395e26a Mon Sep 17 00:00:00 2001
|
||||
From: Iru Cai <mytbk920423@gmail.com>
|
||||
Date: Fri, 28 Jul 2017 23:36:25 +0800
|
||||
Subject: [PATCH 51/59] buildgcc: Update IASL to 20180531
|
||||
|
||||
Change-Id: I6c14f3aad59749896816bb8789788fc513e7176f
|
||||
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
|
||||
Signed-off-by: Martin Roth <martinroth@google.com>
|
||||
Reviewed-on: https://review.coreboot.org/21156
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
Reviewed-by: Nico Huber <nico.h@gmx.de>
|
||||
---
|
||||
util/crossgcc/buildgcc | 6 ++---
|
||||
.../patches/acpica-unix2-20161222_iasl.patch | 27 -------------------
|
||||
.../patches/acpica-unix2-20180531_iasl.patch | 27 +++++++++++++++++++
|
||||
.../sum/acpica-unix2-20161222.tar.gz.cksum | 1 -
|
||||
.../sum/acpica-unix2-20180531.tar.gz.cksum | 1 +
|
||||
5 files changed, 31 insertions(+), 31 deletions(-)
|
||||
delete mode 100644 util/crossgcc/patches/acpica-unix2-20161222_iasl.patch
|
||||
create mode 100644 util/crossgcc/patches/acpica-unix2-20180531_iasl.patch
|
||||
delete mode 100644 util/crossgcc/sum/acpica-unix2-20161222.tar.gz.cksum
|
||||
create mode 100644 util/crossgcc/sum/acpica-unix2-20180531.tar.gz.cksum
|
||||
|
||||
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
|
||||
index 53f9782cb5..bbe74eb2b8 100755
|
||||
--- a/util/crossgcc/buildgcc
|
||||
+++ b/util/crossgcc/buildgcc
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
-CROSSGCC_DATE="October 15th, 2017"
|
||||
-CROSSGCC_VERSION="1.50"
|
||||
+CROSSGCC_DATE="June 3rd, 2018"
|
||||
+CROSSGCC_VERSION="1.51"
|
||||
CROSSGCC_COMMIT=$( git describe )
|
||||
|
||||
# default settings
|
||||
@@ -42,7 +42,7 @@ GCC_VERSION=6.3.0
|
||||
GCC_AUTOCONF_VERSION=2.69
|
||||
BINUTILS_VERSION=2.29.1
|
||||
GDB_VERSION=8.0
|
||||
-IASL_VERSION=20161222
|
||||
+IASL_VERSION=20180531
|
||||
PYTHON_VERSION=3.5.1
|
||||
EXPAT_VERSION=2.2.1
|
||||
# CLANG version number
|
||||
diff --git a/util/crossgcc/patches/acpica-unix2-20161222_iasl.patch b/util/crossgcc/patches/acpica-unix2-20161222_iasl.patch
|
||||
deleted file mode 100644
|
||||
index 24bde98a32..0000000000
|
||||
--- a/util/crossgcc/patches/acpica-unix2-20161222_iasl.patch
|
||||
+++ /dev/null
|
||||
@@ -1,27 +0,0 @@
|
||||
-diff -Naur acpica-unix2-20161222/source/compiler/asloptions.c acpica-unix2-20161222/source/compiler/asloptions.c
|
||||
---- acpica-unix2-20161222/source/compiler/asloptions.c
|
||||
-+++ acpica-unix2-20161222/source/compiler/asloptions.c
|
||||
-@@ -100,6 +100,7 @@
|
||||
- if (argc < 2)
|
||||
- {
|
||||
- printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
-+ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
|
||||
- Usage ();
|
||||
- exit (1);
|
||||
- }
|
||||
-@@ -130,6 +131,7 @@
|
||||
- if (Gbl_DoSignon)
|
||||
- {
|
||||
- printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
-+ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
|
||||
- if (Gbl_IgnoreErrors)
|
||||
- {
|
||||
- printf ("Ignoring all errors, forcing AML file generation\n\n");
|
||||
-@@ -711,6 +713,7 @@
|
||||
- case '^':
|
||||
-
|
||||
- printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
-+ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
|
||||
- exit (0);
|
||||
-
|
||||
- case 'a':
|
||||
diff --git a/util/crossgcc/patches/acpica-unix2-20180531_iasl.patch b/util/crossgcc/patches/acpica-unix2-20180531_iasl.patch
|
||||
new file mode 100644
|
||||
index 0000000000..fea5cd3c47
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/patches/acpica-unix2-20180531_iasl.patch
|
||||
@@ -0,0 +1,27 @@
|
||||
+diff -Naur acpica-unix2-20180531_/source/compiler/asloptions.c acpica-unix2-20180531/source/compiler/asloptions.c > acpica-unix2-20180531_iasl.patch
|
||||
+--- acpica-unix2-20180531_/source/compiler/asloptions.c
|
||||
++++ acpica-unix2-20180531/source/compiler/asloptions.c
|
||||
+@@ -126,6 +126,7 @@
|
||||
+ if (Gbl_DoSignon)
|
||||
+ {
|
||||
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
++ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
|
||||
+ if (Gbl_IgnoreErrors)
|
||||
+ {
|
||||
+ printf ("Ignoring all errors, forcing AML file generation\n\n");
|
||||
+@@ -753,6 +754,7 @@
|
||||
+ case '^':
|
||||
+
|
||||
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
++ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
|
||||
+ exit (0);
|
||||
+
|
||||
+ case 'a':
|
||||
+@@ -766,6 +768,7 @@
|
||||
+
|
||||
+ printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME));
|
||||
+ printf (ACPI_COMMON_BUILD_TIME);
|
||||
++ printf ("%s\n", COREBOOT_TOOLCHAIN_VERSION);
|
||||
+ exit (0);
|
||||
+
|
||||
+ case 'e':
|
||||
diff --git a/util/crossgcc/sum/acpica-unix2-20161222.tar.gz.cksum b/util/crossgcc/sum/acpica-unix2-20161222.tar.gz.cksum
|
||||
deleted file mode 100644
|
||||
index d857678871..0000000000
|
||||
--- a/util/crossgcc/sum/acpica-unix2-20161222.tar.gz.cksum
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-73e57d4d558c9bc831165c71adbff577b526f256 tarballs/acpica-unix2-20161222.tar.gz
|
||||
diff --git a/util/crossgcc/sum/acpica-unix2-20180531.tar.gz.cksum b/util/crossgcc/sum/acpica-unix2-20180531.tar.gz.cksum
|
||||
new file mode 100644
|
||||
index 0000000000..700185839a
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/sum/acpica-unix2-20180531.tar.gz.cksum
|
||||
@@ -0,0 +1 @@
|
||||
+17717140438d506533b4a56e34350749d7b84d6c tarballs/acpica-unix2-20180531.tar.gz
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,132 @@
|
||||
From 575f1d7784041461d02c892b4846165dd742654c Mon Sep 17 00:00:00 2001
|
||||
From: Martin Roth <gaumless@gmail.com>
|
||||
Date: Tue, 5 Jun 2018 20:56:29 -0600
|
||||
Subject: [PATCH 52/59] crossgcc: Update to clang 6.0 & cmake 3.11.3
|
||||
|
||||
Change-Id: I1a0db60b527c2f7ffe77743c0d75b78a7c8bc4cc
|
||||
Signed-off-by: Martin Roth <gaumless@gmail.com>
|
||||
Reviewed-on: https://review.coreboot.org/26877
|
||||
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
---
|
||||
util/crossgcc/buildgcc | 6 +++---
|
||||
util/crossgcc/sum/cfe-4.0.0.src.tar.xz.cksum | 1 -
|
||||
util/crossgcc/sum/cfe-6.0.0.src.tar.xz.cksum | 1 +
|
||||
util/crossgcc/sum/clang-tools-extra-4.0.0.src.tar.xz.cksum | 1 -
|
||||
util/crossgcc/sum/clang-tools-extra-6.0.0.src.tar.xz.cksum | 1 +
|
||||
util/crossgcc/sum/cmake-3.11.3.tar.gz.cksum | 1 +
|
||||
util/crossgcc/sum/cmake-3.9.0-rc3.tar.gz.cksum | 1 -
|
||||
util/crossgcc/sum/compiler-rt-4.0.0.src.tar.xz.cksum | 1 -
|
||||
util/crossgcc/sum/compiler-rt-6.0.0.src.tar.xz.cksum | 1 +
|
||||
util/crossgcc/sum/llvm-4.0.0.src.tar.xz.cksum | 1 -
|
||||
util/crossgcc/sum/llvm-6.0.0.src.tar.xz.cksum | 1 +
|
||||
11 files changed, 8 insertions(+), 8 deletions(-)
|
||||
delete mode 100644 util/crossgcc/sum/cfe-4.0.0.src.tar.xz.cksum
|
||||
create mode 100644 util/crossgcc/sum/cfe-6.0.0.src.tar.xz.cksum
|
||||
delete mode 100644 util/crossgcc/sum/clang-tools-extra-4.0.0.src.tar.xz.cksum
|
||||
create mode 100644 util/crossgcc/sum/clang-tools-extra-6.0.0.src.tar.xz.cksum
|
||||
create mode 100644 util/crossgcc/sum/cmake-3.11.3.tar.gz.cksum
|
||||
delete mode 100644 util/crossgcc/sum/cmake-3.9.0-rc3.tar.gz.cksum
|
||||
delete mode 100644 util/crossgcc/sum/compiler-rt-4.0.0.src.tar.xz.cksum
|
||||
create mode 100644 util/crossgcc/sum/compiler-rt-6.0.0.src.tar.xz.cksum
|
||||
delete mode 100644 util/crossgcc/sum/llvm-4.0.0.src.tar.xz.cksum
|
||||
create mode 100644 util/crossgcc/sum/llvm-6.0.0.src.tar.xz.cksum
|
||||
|
||||
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
|
||||
index bbe74eb2b8..addc61f186 100755
|
||||
--- a/util/crossgcc/buildgcc
|
||||
+++ b/util/crossgcc/buildgcc
|
||||
@@ -46,9 +46,9 @@ IASL_VERSION=20180531
|
||||
PYTHON_VERSION=3.5.1
|
||||
EXPAT_VERSION=2.2.1
|
||||
# CLANG version number
|
||||
-CLANG_VERSION=4.0.0
|
||||
+CLANG_VERSION=6.0.0
|
||||
MAKE_VERSION=4.2.1
|
||||
-CMAKE_VERSION=3.9.0-rc3
|
||||
+CMAKE_VERSION=3.11.3
|
||||
|
||||
# GCC toolchain archive locations
|
||||
# These are sanitized by the jenkins toolchain test builder, so if
|
||||
@@ -69,7 +69,7 @@ CFE_ARCHIVE="https://releases.llvm.org/${CLANG_VERSION}/cfe-${CLANG_VERSION}.src
|
||||
CRT_ARCHIVE="https://releases.llvm.org/${CLANG_VERSION}/compiler-rt-${CLANG_VERSION}.src.tar.xz"
|
||||
CTE_ARCHIVE="https://releases.llvm.org/${CLANG_VERSION}/clang-tools-extra-${CLANG_VERSION}.src.tar.xz"
|
||||
MAKE_ARCHIVE="https://ftpmirror.gnu.org/make/make-${MAKE_VERSION}.tar.bz2"
|
||||
-CMAKE_ARCHIVE="https://cmake.org/files/v3.9/cmake-${CMAKE_VERSION}.tar.gz"
|
||||
+CMAKE_ARCHIVE="https://cmake.org/files/v3.11/cmake-${CMAKE_VERSION}.tar.gz"
|
||||
|
||||
ALL_ARCHIVES="$GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE \
|
||||
$GCC_ARCHIVE $BINUTILS_ARCHIVE $GDB_ARCHIVE $IASL_ARCHIVE \
|
||||
diff --git a/util/crossgcc/sum/cfe-4.0.0.src.tar.xz.cksum b/util/crossgcc/sum/cfe-4.0.0.src.tar.xz.cksum
|
||||
deleted file mode 100644
|
||||
index 00a5596878..0000000000
|
||||
--- a/util/crossgcc/sum/cfe-4.0.0.src.tar.xz.cksum
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-e2762800c93d9335781ea6a45af3f80845542ef5 tarballs/cfe-4.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/cfe-6.0.0.src.tar.xz.cksum b/util/crossgcc/sum/cfe-6.0.0.src.tar.xz.cksum
|
||||
new file mode 100644
|
||||
index 0000000000..523445035f
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/sum/cfe-6.0.0.src.tar.xz.cksum
|
||||
@@ -0,0 +1 @@
|
||||
+4cc7bef72fda70ac5e065ca0ae2d66957abe6f2a tarballs/cfe-6.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/clang-tools-extra-4.0.0.src.tar.xz.cksum b/util/crossgcc/sum/clang-tools-extra-4.0.0.src.tar.xz.cksum
|
||||
deleted file mode 100644
|
||||
index dbf642c461..0000000000
|
||||
--- a/util/crossgcc/sum/clang-tools-extra-4.0.0.src.tar.xz.cksum
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-bdb543c4bb87bd80fe65711114ca0a5c25329ae3 tarballs/clang-tools-extra-4.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/clang-tools-extra-6.0.0.src.tar.xz.cksum b/util/crossgcc/sum/clang-tools-extra-6.0.0.src.tar.xz.cksum
|
||||
new file mode 100644
|
||||
index 0000000000..9fcb8280d1
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/sum/clang-tools-extra-6.0.0.src.tar.xz.cksum
|
||||
@@ -0,0 +1 @@
|
||||
+c960a0d565e46e4c4f6976fac389f753076ca72e tarballs/clang-tools-extra-6.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/cmake-3.11.3.tar.gz.cksum b/util/crossgcc/sum/cmake-3.11.3.tar.gz.cksum
|
||||
new file mode 100644
|
||||
index 0000000000..14a4b22c8d
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/sum/cmake-3.11.3.tar.gz.cksum
|
||||
@@ -0,0 +1 @@
|
||||
+73261a5b7f71abf7277c1d2a418ca3c4cf170c89 tarballs/cmake-3.11.3.tar.gz
|
||||
diff --git a/util/crossgcc/sum/cmake-3.9.0-rc3.tar.gz.cksum b/util/crossgcc/sum/cmake-3.9.0-rc3.tar.gz.cksum
|
||||
deleted file mode 100644
|
||||
index 809ce3c7ca..0000000000
|
||||
--- a/util/crossgcc/sum/cmake-3.9.0-rc3.tar.gz.cksum
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-d568e74e2e4a1cdeae1820cc2cb36fd2d6afc8fe tarballs/cmake-3.9.0-rc3.tar.gz
|
||||
diff --git a/util/crossgcc/sum/compiler-rt-4.0.0.src.tar.xz.cksum b/util/crossgcc/sum/compiler-rt-4.0.0.src.tar.xz.cksum
|
||||
deleted file mode 100644
|
||||
index 95da5148ed..0000000000
|
||||
--- a/util/crossgcc/sum/compiler-rt-4.0.0.src.tar.xz.cksum
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-a879b610e427ef3bba482bdc031ae371cabab81e tarballs/compiler-rt-4.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/compiler-rt-6.0.0.src.tar.xz.cksum b/util/crossgcc/sum/compiler-rt-6.0.0.src.tar.xz.cksum
|
||||
new file mode 100644
|
||||
index 0000000000..88186dbf38
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/sum/compiler-rt-6.0.0.src.tar.xz.cksum
|
||||
@@ -0,0 +1 @@
|
||||
+5725f19be611034e77196461cdb4989f4258cfa4 tarballs/compiler-rt-6.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/llvm-4.0.0.src.tar.xz.cksum b/util/crossgcc/sum/llvm-4.0.0.src.tar.xz.cksum
|
||||
deleted file mode 100644
|
||||
index 410f95fb1a..0000000000
|
||||
--- a/util/crossgcc/sum/llvm-4.0.0.src.tar.xz.cksum
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-aee4524e2407f9fe5afc6f70c753180b907011d0 tarballs/llvm-4.0.0.src.tar.xz
|
||||
diff --git a/util/crossgcc/sum/llvm-6.0.0.src.tar.xz.cksum b/util/crossgcc/sum/llvm-6.0.0.src.tar.xz.cksum
|
||||
new file mode 100644
|
||||
index 0000000000..ac079eccf5
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/sum/llvm-6.0.0.src.tar.xz.cksum
|
||||
@@ -0,0 +1 @@
|
||||
+f61e0a35feb76644ba160a413ee209dd24c88f47 tarballs/llvm-6.0.0.src.tar.xz
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,55 @@
|
||||
From b0f1988f893bf5f581917816b11e810309955143 Mon Sep 17 00:00:00 2001
|
||||
From: Elyes HAOUAS <ehaouas@noos.fr>
|
||||
Date: Sat, 9 Jun 2018 11:59:00 +0200
|
||||
Subject: [PATCH 53/59] src: Get rid of unneeded whitespace
|
||||
|
||||
Change-Id: I630d49ab504d9f6e052806b516a600fa41b9a8da
|
||||
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
|
||||
Reviewed-on: https://review.coreboot.org/26991
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
|
||||
---
|
||||
util/crossgcc/buildgcc | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
|
||||
index addc61f186..cd8a091989 100755
|
||||
--- a/util/crossgcc/buildgcc
|
||||
+++ b/util/crossgcc/buildgcc
|
||||
@@ -1191,7 +1191,7 @@ export PATH=$DESTDIR$TARGETDIR/bin:$PATH
|
||||
|
||||
# Download, unpack, patch and build all packages
|
||||
|
||||
-printf "Downloading and verifing tarballs ... \n"
|
||||
+printf "Downloading and verifing tarballs ...\n"
|
||||
mkdir -p tarballs
|
||||
for P in $PACKAGES; do
|
||||
download "$P" || exit "$?"
|
||||
@@ -1199,21 +1199,21 @@ for P in $PACKAGES; do
|
||||
done
|
||||
printf "Downloaded tarballs ... ${green}ok${NC}\n"
|
||||
|
||||
-printf "Unpacking and patching ... \n"
|
||||
+printf "Unpacking and patching ...\n"
|
||||
for P in $PACKAGES; do
|
||||
unpack_and_patch $P || exit 1
|
||||
done
|
||||
printf "Unpacked and patched ... ${green}ok${NC}\n"
|
||||
|
||||
if [ -n "$BOOTSTRAPONLY" ]; then
|
||||
- printf "Building bootstrap compiler only ... \n"
|
||||
+ printf "Building bootstrap compiler only ...\n"
|
||||
for pkg in GMP MPFR MPC GCC; do
|
||||
build_for_host $pkg
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
-printf "Building packages ... \n"
|
||||
+printf "Building packages ...\n"
|
||||
for package in $PACKAGES; do
|
||||
build $package
|
||||
done
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,54 @@
|
||||
From 095db339f7463b09b52968fa3747aef329c7b83e Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Georgi <pgeorgi@chromium.org>
|
||||
Date: Tue, 26 Jun 2018 21:00:58 +0200
|
||||
Subject: [PATCH 54/59] util/crossgcc: Allow building a new gcc against new
|
||||
binutils with -D
|
||||
|
||||
With -D, the newly built toolchain isn't installed into $prefix/...
|
||||
but into $DESTDIR/$prefix/... while being built for $prefix alone.
|
||||
|
||||
This is useful for distributions, but it breaks down when the build
|
||||
host already has the toolchain installed in $prefix without proper
|
||||
build isolation (cf. gentoo):
|
||||
|
||||
In such cases libgcc etc are built using the new compiler (as gcc's
|
||||
build system is smart enough to state the path explicitly), but that
|
||||
compiler then uses its regular algorithm to determine the path to as,
|
||||
ld, ...
|
||||
That makes it use the tools from $prefix, which might differ in formats
|
||||
(assembly, certain object file flags, ...): nds32le-elf in particular
|
||||
has rather unstable formats still, and so new compilers can't work
|
||||
with old binutils.
|
||||
|
||||
The approach to deal with this is to take an unused path that's
|
||||
specified by gcc's build system ($out/gcc/$arch/$version) and symlink
|
||||
it to the new toolchain - these explicitly given directories take
|
||||
precedence over the default search path, and so the new binutils
|
||||
are used.
|
||||
|
||||
Change-Id: Ia9a262e73f56cd486a2ae07422b598c205a03aed
|
||||
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
|
||||
Reviewed-on: https://review.coreboot.org/27241
|
||||
Reviewed-by: Martin Roth <martinroth@google.com>
|
||||
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
---
|
||||
util/crossgcc/buildgcc | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
|
||||
index cd8a091989..ef0c4d5d8f 100755
|
||||
--- a/util/crossgcc/buildgcc
|
||||
+++ b/util/crossgcc/buildgcc
|
||||
@@ -752,6 +752,8 @@ build_cross_GCC() {
|
||||
--with-mpc=$DESTDIR$TARGETDIR \
|
||||
--with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \
|
||||
&& \
|
||||
+ mkdir -p gcc/$TARGETARCH && \
|
||||
+ ln -s $DESTDIR$TARGETDIR/$TARGETARCH/bin gcc/$TARGETARCH/$GCC_VERSION && \
|
||||
$MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-gcc && \
|
||||
$MAKE install-gcc DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,46 @@
|
||||
From 11f8c9d9be8eb492d00b8d7a29614fdc0553387e Mon Sep 17 00:00:00 2001
|
||||
From: Martin Roth <gaumless@gmail.com>
|
||||
Date: Wed, 6 Jun 2018 22:36:14 -0600
|
||||
Subject: [PATCH 55/59] crosgcc/patches: Add make patch for GLIBC glob
|
||||
interface v2
|
||||
|
||||
Copied from the GNU make repository
|
||||
author Paul Smith <psmith@gnu.org>
|
||||
commit 48c8a116
|
||||
configure.ac: Support GLIBC glob interface version 2
|
||||
|
||||
Change-Id: Id70a2b98dad6349ee56985d8dd6d4f0d87b470e6
|
||||
Signed-off-by: Martin Roth <gaumless@gmail.com>
|
||||
Reviewed-on: https://review.coreboot.org/26939
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
|
||||
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
|
||||
---
|
||||
.../make-4.2.1_gnu_glob_interface_v2.patch | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
create mode 100644 util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch
|
||||
|
||||
diff --git a/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch b/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch
|
||||
new file mode 100644
|
||||
index 0000000000..466d6fdd70
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch
|
||||
@@ -0,0 +1,15 @@
|
||||
+diff -Naur make-4.2.1/configure.ac make-4.2.1/configure.ac
|
||||
+--- make-4.2.1/configure.ac
|
||||
++++ make-4.2.1/configure.ac
|
||||
+@@ -399,10 +399,9 @@
|
||||
+ #include <glob.h>
|
||||
+ #include <fnmatch.h>
|
||||
+
|
||||
+-#define GLOB_INTERFACE_VERSION 1
|
||||
+ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||
+ # include <gnu-versions.h>
|
||||
+-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
|
||||
++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
|
||||
+ gnu glob
|
||||
+ # endif
|
||||
+ #endif],
|
||||
--
|
||||
2.17.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,156 @@
|
||||
From 234eabaa8da28dfa750826c200c08959bb917b28 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Roth <gaumless@gmail.com>
|
||||
Date: Sat, 21 Jul 2018 14:17:22 -0600
|
||||
Subject: [PATCH 57/59] util/crosgcc/patches: update make-4.2.1 patches
|
||||
|
||||
- Add the Do-not-assume-glibc-glob-internals patch to fix segfaults.
|
||||
- Update glob_interface_v2 patch to the patch directly from the
|
||||
make git repository instead of translating it. This gives better
|
||||
attributution to the original author.
|
||||
|
||||
Change-Id: Ibc936fc00925a4ca2170a6f5dca7c2b8d8d62f02
|
||||
Signed-off-by: Martin Roth <gaumless@gmail.com>
|
||||
Reviewed-on: https://review.coreboot.org/27591
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
|
||||
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
|
||||
---
|
||||
...b-Do-not-assume-glibc-glob-internals.patch | 67 +++++++++++++++++++
|
||||
...pport-GLIBC-glob-interface-version-2.patch | 28 ++++++++
|
||||
.../make-4.2.1_gnu_glob_interface_v2.patch | 15 -----
|
||||
3 files changed, 95 insertions(+), 15 deletions(-)
|
||||
create mode 100644 util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch
|
||||
create mode 100644 util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch
|
||||
delete mode 100644 util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch
|
||||
|
||||
diff --git a/util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch b/util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch
|
||||
new file mode 100644
|
||||
index 0000000000..3d45025fe1
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch
|
||||
@@ -0,0 +1,67 @@
|
||||
+From 193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4 Mon Sep 17 00:00:00 2001
|
||||
+From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
+Date: Sun, 24 Sep 2017 09:12:58 -0400
|
||||
+Subject: [PATCH 53/78] glob: Do not assume glibc glob internals.
|
||||
+
|
||||
+It has been proposed that glibc glob start using gl_lstat,
|
||||
+which the API allows it to do. GNU 'make' should not get in
|
||||
+the way of this. See:
|
||||
+https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
|
||||
+
|
||||
+* dir.c (local_lstat): New function, like local_stat.
|
||||
+(dir_setup_glob): Use it to initialize gl_lstat too, as the API
|
||||
+requires.
|
||||
+---
|
||||
+ dir.c | 29 +++++++++++++++++++++++++++--
|
||||
+ 1 file changed, 27 insertions(+), 2 deletions(-)
|
||||
+
|
||||
+diff --git a/dir.c b/dir.c
|
||||
+index adbb8a9..c343e4c 100644
|
||||
+--- a/dir.c
|
||||
++++ b/dir.c
|
||||
+@@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)
|
||||
+ }
|
||||
+ #endif
|
||||
+
|
||||
++/* Similarly for lstat. */
|
||||
++#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
|
||||
++# ifndef VMS
|
||||
++# ifndef HAVE_SYS_STAT_H
|
||||
++int lstat (const char *path, struct stat *sbuf);
|
||||
++# endif
|
||||
++# else
|
||||
++ /* We are done with the fake lstat. Go back to the real lstat */
|
||||
++# ifdef lstat
|
||||
++# undef lstat
|
||||
++# endif
|
||||
++# endif
|
||||
++# define local_lstat lstat
|
||||
++#elif defined(WINDOWS32)
|
||||
++/* Windows doesn't support lstat(). */
|
||||
++# define local_lstat local_stat
|
||||
++#else
|
||||
++static int
|
||||
++local_lstat (const char *path, struct stat *buf)
|
||||
++{
|
||||
++ int e;
|
||||
++ EINTRLOOP (e, lstat (path, buf));
|
||||
++ return e;
|
||||
++}
|
||||
++#endif
|
||||
++
|
||||
+ void
|
||||
+ dir_setup_glob (glob_t *gl)
|
||||
+ {
|
||||
+ gl->gl_opendir = open_dirstream;
|
||||
+ gl->gl_readdir = read_dirstream;
|
||||
+ gl->gl_closedir = free;
|
||||
++ gl->gl_lstat = local_lstat;
|
||||
+ gl->gl_stat = local_stat;
|
||||
+- /* We don't bother setting gl_lstat, since glob never calls it.
|
||||
+- The slot is only there for compatibility with 4.4 BSD. */
|
||||
+ }
|
||||
+
|
||||
+ void
|
||||
+--
|
||||
+2.18.0
|
||||
+
|
||||
diff --git a/util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch b/util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch
|
||||
new file mode 100644
|
||||
index 0000000000..53e61b8bf7
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch
|
||||
@@ -0,0 +1,28 @@
|
||||
+From 48c8a116a914a325a0497721f5d8b58d5bba34d4 Mon Sep 17 00:00:00 2001
|
||||
+From: Paul Smith <psmith@gnu.org>
|
||||
+Date: Sun, 19 Nov 2017 15:09:16 -0500
|
||||
+Subject: [PATCH 68/78] * configure.ac: Support GLIBC glob interface version 2
|
||||
+
|
||||
+---
|
||||
+ configure.ac | 3 +--
|
||||
+ 1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
+
|
||||
+diff --git a/configure.ac b/configure.ac
|
||||
+index 8c72568..4710832 100644
|
||||
+--- a/configure.ac
|
||||
++++ b/configure.ac
|
||||
+@@ -404,10 +404,9 @@ AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
|
||||
+ #include <glob.h>
|
||||
+ #include <fnmatch.h>
|
||||
+
|
||||
+-#define GLOB_INTERFACE_VERSION 1
|
||||
+ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||
+ # include <gnu-versions.h>
|
||||
+-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
|
||||
++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
|
||||
+ gnu glob
|
||||
+ # endif
|
||||
+ #endif],
|
||||
+--
|
||||
+2.18.0
|
||||
+
|
||||
diff --git a/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch b/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch
|
||||
deleted file mode 100644
|
||||
index 466d6fdd70..0000000000
|
||||
--- a/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-diff -Naur make-4.2.1/configure.ac make-4.2.1/configure.ac
|
||||
---- make-4.2.1/configure.ac
|
||||
-+++ make-4.2.1/configure.ac
|
||||
-@@ -399,10 +399,9 @@
|
||||
- #include <glob.h>
|
||||
- #include <fnmatch.h>
|
||||
-
|
||||
--#define GLOB_INTERFACE_VERSION 1
|
||||
- #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
|
||||
- # include <gnu-versions.h>
|
||||
--# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
|
||||
-+# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
|
||||
- gnu glob
|
||||
- # endif
|
||||
- #endif],
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,826 @@
|
||||
From 987d42da1de420cb28cb7f4f979cbb01511877d6 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Roth <gaumless@gmail.com>
|
||||
Date: Sun, 22 Jul 2018 11:45:29 -0600
|
||||
Subject: [PATCH 58/59] util/crosgcc: Fix most shellcheck errors in buildgcc
|
||||
|
||||
This fixes most of the simpler shellcheck errors in shellcheck 0.4.6.
|
||||
|
||||
There are still a few warnings left that weren't simple to fix or
|
||||
would have required more testing before I was confident in them.
|
||||
|
||||
Change-Id: I79ab3614cc1d69d3dfe1e0374e930313f2011cbf
|
||||
Signed-off-by: Martin Roth <gaumless@gmail.com>
|
||||
Reviewed-on: https://review.coreboot.org/27598
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
|
||||
---
|
||||
util/crossgcc/buildgcc | 298 ++++++++++++++++++++++++-----------------
|
||||
1 file changed, 172 insertions(+), 126 deletions(-)
|
||||
|
||||
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
|
||||
index a9d90572cd..5823707acf 100755
|
||||
--- a/util/crossgcc/buildgcc
|
||||
+++ b/util/crossgcc/buildgcc
|
||||
@@ -1,4 +1,16 @@
|
||||
#!/bin/sh
|
||||
+# shellcheck disable=SC2030,SC2031,SC2059
|
||||
+# The above line must be directly after the shebang line.
|
||||
+# Disables these warnings:
|
||||
+# 2030 - Modification of var is local (to subshell caused by pipeline).
|
||||
+# shell check 0.4.6 gets confused by the read -t 1 command and interprets
|
||||
+# the '1' as $1 getting modified.
|
||||
+# 2031 - var was modified in a subshell. That change might be lost.
|
||||
+# caused by shell check bug with SC2030? This causes any $1 from that
|
||||
+# point on to be flagged.
|
||||
+# 2059 - Don't use variables in the printf format string. Use printf "..%s.." "$foo".
|
||||
+# This is used for all of our color printing.
|
||||
+
|
||||
#
|
||||
# Copyright (C) 2008-2010 by coresystems GmbH
|
||||
# written by Patrick Georgi <patrick.georgi@coresystems.de> and
|
||||
@@ -16,7 +28,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
|
||||
-cd $(dirname $0)
|
||||
+cd "$(dirname "$0")" || exit 1
|
||||
|
||||
CROSSGCC_DATE="June 11th, 2018"
|
||||
CROSSGCC_VERSION="1.52"
|
||||
@@ -80,7 +92,9 @@ ALL_ARCHIVES="$GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE \
|
||||
GMP_DIR="gmp-${GMP_VERSION}"
|
||||
MPFR_DIR="mpfr-${MPFR_VERSION}"
|
||||
MPC_DIR="mpc-${MPC_VERSION}"
|
||||
+# shellcheck disable=SC2034
|
||||
GCC_DIR="gcc-${GCC_VERSION}"
|
||||
+# shellcheck disable=SC2034
|
||||
BINUTILS_DIR="binutils-${BINUTILS_VERSION}"
|
||||
GDB_DIR="gdb-${GDB_VERSION}"
|
||||
IASL_DIR="acpica-unix2-${IASL_VERSION}"
|
||||
@@ -101,51 +115,49 @@ RED='\033[1;31m'
|
||||
green='\033[0;32m'
|
||||
GREEN='\033[1;32m'
|
||||
blue='\033[0;34m'
|
||||
-BLUE='\033[1;34m'
|
||||
-cyan='\033[0;36m'
|
||||
CYAN='\033[1;36m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
-UNAME=$(uname | grep -iq cygwin && echo Cygwin || uname)
|
||||
+UNAME=$(if uname | grep -iq cygwin; then echo Cygwin; else uname; fi)
|
||||
HALT_FOR_TOOLS=0
|
||||
|
||||
hostcc()
|
||||
{
|
||||
# $1 "host" or "target"
|
||||
- if [ "$BOOTSTRAP" = 1 -a "$1" = target ]; then
|
||||
- echo $DESTDIR$TARGETDIR/bin/gcc
|
||||
+ if [ "$BOOTSTRAP" = 1 ] && [ "$1" = target ]; then
|
||||
+ echo "$DESTDIR$TARGETDIR/bin/gcc"
|
||||
else
|
||||
- echo $CC
|
||||
+ echo "$CC"
|
||||
fi
|
||||
}
|
||||
|
||||
hostcxx()
|
||||
{
|
||||
# $1 "host" or "target"
|
||||
- if [ "$BOOTSTRAP" = 1 -a "$1" = target ]; then
|
||||
- echo $DESTDIR$TARGETDIR/bin/g++
|
||||
+ if [ "$BOOTSTRAP" = 1 ] && [ "$1" = target ]; then
|
||||
+ echo "$DESTDIR$TARGETDIR/bin/g++"
|
||||
else
|
||||
- echo $CXX
|
||||
+ echo "$CXX"
|
||||
fi
|
||||
}
|
||||
|
||||
normalize_dirs()
|
||||
{
|
||||
- mkdir -p $DESTDIR$TARGETDIR/lib
|
||||
- test -d $DESTDIR$TARGETDIR/lib32 && mv $DESTDIR$TARGETDIR/lib32/* $DESTDIR$TARGETDIR/lib
|
||||
- test -d $DESTDIR$TARGETDIR/lib64 && mv $DESTDIR$TARGETDIR/lib64/* $DESTDIR$TARGETDIR/lib
|
||||
- rmdir -p $DESTDIR$TARGETDIR/lib32 $DESTDIR$TARGETDIR/lib64
|
||||
+ mkdir -p "$DESTDIR$TARGETDIR/lib"
|
||||
+ test -d "$DESTDIR$TARGETDIR/lib32" && mv "$DESTDIR$TARGETDIR"/lib32/* "$DESTDIR$TARGETDIR/lib"
|
||||
+ test -d "$DESTDIR$TARGETDIR/lib64" && mv "$DESTDIR$TARGETDIR"/lib64/* "$DESTDIR$TARGETDIR/lib"
|
||||
+ rmdir -p "$DESTDIR$TARGETDIR/lib32" "$DESTDIR$TARGETDIR/lib64"
|
||||
|
||||
- perl -pi -e "s,/lib32,/lib," $DESTDIR$TARGETDIR/lib/*.la
|
||||
- perl -pi -e "s,/lib64,/lib," $DESTDIR$TARGETDIR/lib/*.la
|
||||
+ perl -pi -e "s,/lib32,/lib," "$DESTDIR$TARGETDIR"/lib/*.la
|
||||
+ perl -pi -e "s,/lib64,/lib," "$DESTDIR$TARGETDIR"/lib/*.la
|
||||
}
|
||||
|
||||
countdown()
|
||||
{
|
||||
tout=${1:-10}
|
||||
|
||||
- printf "\nPress Ctrl-C to abort, Enter to continue... %2ds" $tout
|
||||
- while [ $tout -gt 0 ]; do
|
||||
+ printf "\nPress Ctrl-C to abort, Enter to continue... %2ds" "$tout"
|
||||
+ while [ "$tout" -gt 0 ]; do
|
||||
sleep 1
|
||||
tout=$((tout - 1))
|
||||
printf "\b\b\b%2ds" $tout
|
||||
@@ -162,11 +174,12 @@ timeout()
|
||||
# Clean up in case the user aborts.
|
||||
trap 'kill $counter > /dev/null 2>&1' EXIT
|
||||
|
||||
- (countdown $tout; kill -USR1 $$)&
|
||||
+ (countdown "$tout"; kill -USR1 $$)&
|
||||
counter=$!
|
||||
|
||||
# Some shells with sh compatibility mode (e.g. zsh, mksh) only
|
||||
# let us interrupt `read` if a non-standard -t parameter is given.
|
||||
+ # shellcheck disable=SC2034,SC2039,SC2162
|
||||
if echo | read -t 1 foo 2>/dev/null; then
|
||||
read -t $((tout + 1)) foo
|
||||
else
|
||||
@@ -180,6 +193,7 @@ timeout()
|
||||
please_install()
|
||||
{
|
||||
HALT_FOR_TOOLS=1
|
||||
+ # shellcheck disable=SC1091
|
||||
test -r /etc/os-release && . /etc/os-release
|
||||
# vanilla debian doesn't define `ID_LIKE`, just `ID`
|
||||
if [ -z "${ID_LIKE}" ] && [ -n "${ID}" ]; then
|
||||
@@ -210,59 +224,60 @@ searchtool()
|
||||
search="$2"
|
||||
fi
|
||||
for i in "$1" "g$1" "gnu$1"; do
|
||||
- if [ -x "$(command -v $i 2>/dev/null)" ]; then
|
||||
+ if [ -x "$(command -v "$i" 2>/dev/null)" ]; then
|
||||
if [ "$(cat /dev/null | $i --version 2>&1 | grep -c "$search")" \
|
||||
-gt 0 ]; then
|
||||
- echo $i
|
||||
+ echo "$i"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# A workaround for OSX 10.9 and some BSDs, whose nongnu
|
||||
# patch and tar also work.
|
||||
- if [ $UNAME = "Darwin" -o $UNAME = "FreeBSD" -o $UNAME = "NetBSD" -o $UNAME = "OpenBSD" ]; then
|
||||
- if [ "$1" = "patch" -o "$1" = "tar" ]; then
|
||||
- if [ -x "$(command -v $1 2>/dev/null)" ]; then
|
||||
- echo $1
|
||||
+ if [ "$UNAME" = "Darwin" ] || [ "$UNAME" = "FreeBSD" ] || [ "$UNAME" = "NetBSD" ] || [ "$UNAME" = "OpenBSD" ]; then
|
||||
+ if [ "$1" = "patch" ] || [ "$1" = "tar" ]; then
|
||||
+ if [ -x "$(command -v "$1" 2>/dev/null)" ]; then
|
||||
+ echo "$1"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
- if echo $1 | grep -q "sum" ; then
|
||||
- algor=$(echo $1 | sed -e 's,sum,,')
|
||||
- if [ -x "$(command -v $1 2>/dev/null)" ]; then
|
||||
+ if echo "$1" | grep -q "sum" ; then
|
||||
+ algor=$(echo "$1" | sed -e 's,sum,,')
|
||||
+ if [ -x "$(command -v "$1" 2>/dev/null)" ]; then
|
||||
#xxxsum [file]
|
||||
- echo $1
|
||||
+ echo "$1"
|
||||
return
|
||||
- elif [ -x "$(command -v $algor 2>/dev/null)" ]; then
|
||||
+ elif [ -x "$(command -v "$algor" 2>/dev/null)" ]; then
|
||||
#xxx [file]
|
||||
- echo $algor
|
||||
+ echo "$algor"
|
||||
return
|
||||
elif [ -x "$(command -v openssl 2>/dev/null)" ]; then
|
||||
#openssl xxx [file]
|
||||
- echo openssl $algor
|
||||
+ echo openssl "$algor"
|
||||
return
|
||||
elif [ -x "$(command -v cksum 2>/dev/null)" ]; then
|
||||
#cksum -a xxx [file]
|
||||
#cksum has special options in NetBSD. Actually, NetBSD will use the second case above.
|
||||
- echo "buildgcc" | cksum -a $algor > /dev/null 2>/dev/null && \
|
||||
- echo cksum -a $algor
|
||||
+ echo "buildgcc" | cksum -a "$algor" > /dev/null 2>/dev/null && \
|
||||
+ echo cksum -a "$algor"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
- [ -z "$3" ] && please_install $1 $4
|
||||
+ [ -z "$3" ] && please_install "$1" "$4"
|
||||
false
|
||||
}
|
||||
|
||||
# Run a compile check of the specified library option to see if it's installed
|
||||
check_for_library() {
|
||||
- local LIBRARY_FLAGS=$1
|
||||
- local LIBRARY_PACKAGES="$2"
|
||||
- local LIBTEST_FILE=.libtest
|
||||
+ LIBRARY_FLAGS="$1"
|
||||
+ LIBRARY_PACKAGES="$2"
|
||||
+ LIBTEST_FILE=.libtest
|
||||
|
||||
echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" > "${LIBTEST_FILE}.c"
|
||||
|
||||
+ # shellcheck disable=SC2086
|
||||
"$CC" $CFLAGS $LIBRARY_FLAGS "${LIBTEST_FILE}.c" -o "${LIBTEST_FILE}" >/dev/null 2>&1 || \
|
||||
please_install "$LIBRARY_PACKAGES"
|
||||
rm -rf "${LIBTEST_FILE}.c" "${LIBTEST_FILE}"
|
||||
@@ -307,22 +322,23 @@ ada_requested() {
|
||||
|
||||
download() {
|
||||
package=$1
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
|
||||
- FILE=$(basename $archive)
|
||||
+ FILE=$(basename "$archive")
|
||||
printf " * $FILE "
|
||||
|
||||
- if test -f tarballs/$FILE; then
|
||||
+ if test -f "tarballs/$FILE"; then
|
||||
printf "(cached)... "
|
||||
else
|
||||
printf "(downloading from $archive)"
|
||||
- rm -f tarballs/$FILE
|
||||
- cd tarballs
|
||||
- download_showing_percentage $archive
|
||||
+ rm -f "tarballs/$FILE"
|
||||
+ cd tarballs || exit 1
|
||||
+ download_showing_percentage "$archive"
|
||||
cd ..
|
||||
fi
|
||||
|
||||
- if [ ! -f tarballs/$FILE ]; then
|
||||
+ if [ ! -f "tarballs/$FILE" ]; then
|
||||
printf "${RED}Failed to download $FILE.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
@@ -332,6 +348,7 @@ download() {
|
||||
# hexadecimal hash).
|
||||
compute_hash() {
|
||||
package=$1
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
file="$(basename "$archive")"
|
||||
|
||||
@@ -345,6 +362,7 @@ compute_hash() {
|
||||
|
||||
error_hash_missing() {
|
||||
package="$1"
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
file="$(basename "$archive")"
|
||||
|
||||
@@ -361,6 +379,7 @@ error_hash_missing() {
|
||||
# Read the known hash file of the package given in $1, and print it raw.
|
||||
get_known_hash() {
|
||||
package=$1
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
file="$(basename "$archive")"
|
||||
hashfile="sum/$file.cksum"
|
||||
@@ -373,13 +392,14 @@ get_known_hash() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- cat "$hashfile" | sed -e 's@.*\([0-9a-f]\{40,\}\).*@\1@'
|
||||
+ sed -e 's@.*\([0-9a-f]\{40,\}\).*@\1@' < "$hashfile"
|
||||
}
|
||||
|
||||
error_hash_mismatch() {
|
||||
package=$1
|
||||
known_hash="$2"
|
||||
computed_hash="$3"
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
file="$(basename "$archive")"
|
||||
|
||||
@@ -400,6 +420,7 @@ error_hash_mismatch() {
|
||||
# hash; Bail out on mismatch or missing hash file.
|
||||
verify_hash() {
|
||||
package=$1
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
|
||||
known_hash="$(get_known_hash "$package")" || exit "$?"
|
||||
@@ -410,17 +431,19 @@ verify_hash() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- printf "${GREEN}hash verified ("$known_hash")${NC}\n"
|
||||
+ printf "${GREEN}hash verified (\"$known_hash\")${NC}\n"
|
||||
}
|
||||
|
||||
unpack_and_patch() {
|
||||
- package=$1
|
||||
+ package="$1"
|
||||
+ # shellcheck disable=SC2086
|
||||
archive="$(eval echo \$$package"_ARCHIVE")"
|
||||
+ # shellcheck disable=SC2086
|
||||
dir="$(eval echo \$$package"_DIR")"
|
||||
- test -d ${dir} && test -f ${dir}/.unpack_success || (
|
||||
- printf " * $(basename $archive)\n"
|
||||
+ test -d "${dir}" && test -f "${dir}/.unpack_success" || (
|
||||
+ printf " * $(basename "$archive")\n"
|
||||
FLAGS=zxf
|
||||
- suffix=$(echo $archive | sed 's,.*\.,,')
|
||||
+ suffix=$(echo "$archive" | sed 's,.*\.,,')
|
||||
if [ "$suffix" = "gz" ] && [ -n "$PIGZ" ]; then FLAGS="-I pigz -xf"
|
||||
elif [ "$suffix" = "gz" ]; then FLAGS=zxf
|
||||
elif [ "$suffix" = "bz2" ] && [ -n "$LBZIP2" ]; then FLAGS="-I lbzip2 -xf"
|
||||
@@ -428,22 +451,24 @@ unpack_and_patch() {
|
||||
elif [ "$suffix" = "xz" ]; then FLAGS="--xz -xf"
|
||||
elif [ "$suffix" = "lzma" ]; then FLAGS="--lzma -xf"
|
||||
fi
|
||||
- $TAR $FLAGS tarballs/$(basename $archive)
|
||||
+ # shellcheck disable=SC2086
|
||||
+ $TAR $FLAGS "tarballs/$(basename "$archive")"
|
||||
for patch in patches/${dir}_*.patch; do
|
||||
- test -r $patch || continue
|
||||
- printf " o $(basename $patch)\n"
|
||||
- (cd ${dir} && $PATCH -s -N -p1 <../${patch}) || {
|
||||
+ test -r "$patch" || continue
|
||||
+ printf " o $(basename "$patch")\n"
|
||||
+ (cd "${dir}" || exit 1; $PATCH -s -N -p1 <"../${patch}") || {
|
||||
printf "\n${RED}Failed $patch.${NC}\n"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
- touch ${dir}/.unpack_success
|
||||
+ touch "${dir}/.unpack_success"
|
||||
)
|
||||
}
|
||||
|
||||
fn_exists()
|
||||
{
|
||||
- type $1 >/dev/null 2>&1
|
||||
+ # shellcheck disable=SC2039
|
||||
+ type "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
is_package_enabled()
|
||||
@@ -468,7 +493,7 @@ generic_build()
|
||||
success=$4
|
||||
version=$5
|
||||
|
||||
- fn_exists build_$package || return
|
||||
+ fn_exists "build_$package" || return
|
||||
|
||||
mkdir -p "$builddir"
|
||||
|
||||
@@ -477,10 +502,10 @@ generic_build()
|
||||
else
|
||||
printf "Building $package v$version for $host_target ... "
|
||||
DIR="$PWD"
|
||||
- cd "$builddir"
|
||||
+ cd "$builddir" || exit 1
|
||||
rm -f .failed
|
||||
- build_${package} $host_target > build.log 2>&1
|
||||
- cd "$DIR"
|
||||
+ "build_${package}" "$host_target" > build.log 2>&1
|
||||
+ cd "$DIR" || exit 1
|
||||
if [ ! -f "$builddir/.failed" ]; then
|
||||
touch "$success";
|
||||
else
|
||||
@@ -494,6 +519,7 @@ generic_build()
|
||||
build_for_host()
|
||||
{
|
||||
package="$1"
|
||||
+ # shellcheck disable=SC2086
|
||||
version="$(eval echo \$$package"_VERSION")"
|
||||
generic_build "$package" host "build-$package" "${DESTDIR}${TARGETDIR}/.${package}.${version}.success" "$version"
|
||||
}
|
||||
@@ -501,19 +527,20 @@ build_for_host()
|
||||
build_for_target()
|
||||
{
|
||||
package="$1"
|
||||
+ # shellcheck disable=SC2086
|
||||
version="$(eval echo \$$package"_VERSION")"
|
||||
generic_build "$package" target "build-${TARGETARCH}-$package" "${DESTDIR}${TARGETDIR}/.${TARGETARCH}-${package}.${version}.success" "$version"
|
||||
}
|
||||
|
||||
build()
|
||||
{
|
||||
- if package_uses_targetarch $1; then
|
||||
- if [ $BOOTSTRAP -eq 1 -a ! -f "${DESTDIR}${TARGETDIR}/.GCC.${GCC_VERSION}.success" ]; then
|
||||
+ if package_uses_targetarch "$1"; then
|
||||
+ if [ $BOOTSTRAP -eq 1 ] && [ ! -f "${DESTDIR}${TARGETDIR}/.GCC.${GCC_VERSION}.success" ]; then
|
||||
build_for_host GCC
|
||||
fi
|
||||
- build_for_target $1
|
||||
+ build_for_target "$1"
|
||||
else
|
||||
- build_for_host $1
|
||||
+ build_for_host "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -532,7 +559,8 @@ cleanup()
|
||||
|
||||
printf "Cleaning up temporary files... "
|
||||
for package in $PACKAGES; do
|
||||
- rm -rf build-${TARGETARCH}-$package build-$package $(eval echo \$$package"_DIR")
|
||||
+ # shellcheck disable=SC2086
|
||||
+ rm -rf "build-${TARGETARCH}-$package" "build-$package" "$(eval echo \$$package"_DIR")"
|
||||
done
|
||||
rm -f getopt
|
||||
printf "${green}ok${NC}\n"
|
||||
@@ -601,14 +629,15 @@ EOF
|
||||
}
|
||||
|
||||
have_hostcflags_from_gmp() {
|
||||
- grep -q __GMP_CFLAGS $DESTDIR$TARGETDIR/include/gmp.h >/dev/null 2>&1
|
||||
+ grep -q __GMP_CFLAGS "$DESTDIR$TARGETDIR/include/gmp.h" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
set_hostcflags_from_gmp() {
|
||||
# Now set CFLAGS to match GMP CFLAGS but strip out -pedantic
|
||||
# as GCC 4.6.x fails if it's there.
|
||||
- export HOSTCFLAGS="$(grep __GMP_CFLAGS $DESTDIR$TARGETDIR/include/gmp.h |cut -d\" -f2 |\
|
||||
+ HOSTCFLAGS="$(grep __GMP_CFLAGS "$DESTDIR$TARGETDIR/include/gmp.h" |cut -d\" -f2 |\
|
||||
sed s,-pedantic,,)"
|
||||
+ export HOSTCFLAGS
|
||||
}
|
||||
|
||||
build_GMP() {
|
||||
@@ -619,10 +648,12 @@ build_GMP() {
|
||||
OPTIONS="$OPTIONS --with-pic"
|
||||
fi
|
||||
|
||||
+ # shellcheck disable=SC2086
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" \
|
||||
../${GMP_DIR}/configure --disable-shared --enable-fat \
|
||||
- --prefix=$TARGETDIR $OPTIONS \
|
||||
+ --prefix="$TARGETDIR" $OPTIONS \
|
||||
|| touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
@@ -632,12 +663,13 @@ build_GMP() {
|
||||
}
|
||||
|
||||
build_MPFR() {
|
||||
- test $UNAME = "Darwin" && CFLAGS="$CFLAGS -force_cpusubtype_ALL"
|
||||
+ test "$UNAME" = "Darwin" && CFLAGS="$CFLAGS -force_cpusubtype_ALL"
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" \
|
||||
- ../${MPFR_DIR}/configure --disable-shared --prefix=$TARGETDIR \
|
||||
- --infodir=$TARGETDIR/info \
|
||||
- --with-gmp=$DESTDIR$TARGETDIR CFLAGS="$HOSTCFLAGS" || \
|
||||
+ ../${MPFR_DIR}/configure --disable-shared --prefix="$TARGETDIR" \
|
||||
+ --infodir="$TARGETDIR/info" \
|
||||
+ --with-gmp="$DESTDIR$TARGETDIR" CFLAGS="$HOSTCFLAGS" || \
|
||||
touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
@@ -645,28 +677,29 @@ build_MPFR() {
|
||||
|
||||
# work around build problem of libgmp.la
|
||||
if [ "$DESTDIR" != "" ]; then
|
||||
- perl -pi -e "s,$DESTDIR,," $DESTDIR$TARGETDIR/lib/libgmp.la
|
||||
+ perl -pi -e "s,$DESTDIR,," "$DESTDIR$TARGETDIR/lib/libgmp.la"
|
||||
fi
|
||||
}
|
||||
|
||||
build_MPC() {
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" \
|
||||
- ../${MPC_DIR}/configure --disable-shared --prefix=$TARGETDIR \
|
||||
- --infodir=$TARGETDIR/info --with-mpfr=$DESTDIR$TARGETDIR \
|
||||
- --with-gmp=$DESTDIR$TARGETDIR CFLAGS="$HOSTCFLAGS" || \
|
||||
+ ../${MPC_DIR}/configure --disable-shared --prefix="$TARGETDIR" \
|
||||
+ --infodir="$TARGETDIR/info" --with-mpfr="$DESTDIR$TARGETDIR" \
|
||||
+ --with-gmp="$DESTDIR$TARGETDIR" CFLAGS="$HOSTCFLAGS" || \
|
||||
touch .failed
|
||||
|
||||
# work around build problem of libmpfr.la
|
||||
if [ "$DESTDIR" != "" ]; then
|
||||
- perl -pi -e "s,$TARGETDIR/lib/libgmp.la,$DESTDIR\$&," $DESTDIR$TARGETDIR/lib/libmpfr.la
|
||||
+ perl -pi -e "s,$TARGETDIR/lib/libgmp.la,$DESTDIR\$&," "$DESTDIR$TARGETDIR/lib/libmpfr.la"
|
||||
fi
|
||||
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
# work around build problem of libmpfr.la
|
||||
if [ "$DESTDIR" != "" ]; then
|
||||
- perl -pi -e "s,$DESTDIR,," $DESTDIR$TARGETDIR/lib/libmpfr.la
|
||||
+ perl -pi -e "s,$DESTDIR,," "$DESTDIR$TARGETDIR/lib/libmpfr.la"
|
||||
fi
|
||||
|
||||
normalize_dirs
|
||||
@@ -677,7 +710,7 @@ build_BINUTILS() {
|
||||
ADDITIONALTARGET=",i386-elf"
|
||||
fi
|
||||
CC="$(hostcc target)" CXX="$(hostcxx target)" \
|
||||
- ../binutils-${BINUTILS_VERSION}/configure --prefix=$TARGETDIR \
|
||||
+ ../binutils-${BINUTILS_VERSION}/configure --prefix="$TARGETDIR" \
|
||||
--target=${TARGETARCH} --enable-targets=${TARGETARCH}${ADDITIONALTARGET} \
|
||||
--disable-werror --disable-nls --enable-lto --enable-gold \
|
||||
--enable-interwork --enable-multilib \
|
||||
@@ -685,11 +718,13 @@ build_BINUTILS() {
|
||||
CFLAGS="$HOSTCFLAGS" \
|
||||
CXXFLAGS="$HOSTCFLAGS" \
|
||||
|| touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
}
|
||||
|
||||
bootstrap_GCC() {
|
||||
+ # shellcheck disable=SC2086
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" \
|
||||
CFLAGS="$HOSTCFLAGS" \
|
||||
CFLAGS_FOR_BUILD="$HOSTCFLAGS" \
|
||||
@@ -698,17 +733,18 @@ bootstrap_GCC() {
|
||||
CXXFLAGS_FOR_BUILD="$HOSTCFLAGS" \
|
||||
CXXFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC" \
|
||||
../gcc-${GCC_VERSION}/configure \
|
||||
- --prefix=$TARGETDIR --libexecdir=$TARGETDIR/lib \
|
||||
+ --prefix="$TARGETDIR" --libexecdir="$TARGETDIR/lib" \
|
||||
--enable-bootstrap \
|
||||
--disable-werror --disable-nls \
|
||||
--disable-shared --disable-multilib \
|
||||
--disable-libssp --disable-libquadmath --disable-libcc1 \
|
||||
--disable-libsanitizer \
|
||||
${GCC_OPTIONS} --enable-languages="${LANGUAGES}" \
|
||||
- --with-gmp=$DESTDIR$TARGETDIR --with-mpfr=$DESTDIR$TARGETDIR \
|
||||
- --with-mpc=$DESTDIR$TARGETDIR \
|
||||
+ --with-gmp="$DESTDIR$TARGETDIR" --with-mpfr="$DESTDIR$TARGETDIR" \
|
||||
+ --with-mpc="$DESTDIR$TARGETDIR" \
|
||||
--with-pkgversion="coreboot bootstrap v$CROSSGCC_VERSION $CROSSGCC_DATE" \
|
||||
&& \
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS BOOT_CFLAGS="$HOSTCFLAGS" BUILD_CONFIG="" bootstrap && \
|
||||
$MAKE install-gcc \
|
||||
install-target-libgcc \
|
||||
@@ -731,6 +767,7 @@ build_cross_GCC() {
|
||||
# libiberty is not compiled with CFLAGS_FOR_BUILD.
|
||||
# Also set the CXX version of the flags because GCC is now compiled
|
||||
# using C++.
|
||||
+ # shellcheck disable=SC2086
|
||||
CC="$(hostcc target)" CXX="$(hostcxx target)" \
|
||||
CFLAGS_FOR_TARGET="-O2 -Dinhibit_libc" \
|
||||
CFLAGS="$HOSTCFLAGS $CLANGFLAGS" \
|
||||
@@ -738,7 +775,7 @@ build_cross_GCC() {
|
||||
CXXFLAGS="$HOSTCFLAGS $CLANGCXXFLAGS" \
|
||||
CXXFLAGS_FOR_BUILD="$HOSTCFLAGS $CLANGCXXFLAGS" \
|
||||
../gcc-${GCC_VERSION}/configure \
|
||||
- --prefix=$TARGETDIR --libexecdir=$TARGETDIR/lib \
|
||||
+ --prefix="$TARGETDIR" --libexecdir="$TARGETDIR/lib" \
|
||||
--target=${TARGETARCH} --disable-werror --disable-shared \
|
||||
--enable-lto --enable-plugins --enable-gold --enable-ld=default \
|
||||
--disable-libssp --disable-bootstrap --disable-nls \
|
||||
@@ -748,16 +785,17 @@ build_cross_GCC() {
|
||||
--disable-libatomic --disable-libcc1 --disable-decimal-float \
|
||||
${GCC_OPTIONS} --enable-languages="${LANGUAGES}" \
|
||||
--with-system-zlib \
|
||||
- --with-gmp=$DESTDIR$TARGETDIR --with-mpfr=$DESTDIR$TARGETDIR \
|
||||
- --with-mpc=$DESTDIR$TARGETDIR \
|
||||
+ --with-gmp="$DESTDIR$TARGETDIR" --with-mpfr="$DESTDIR$TARGETDIR" \
|
||||
+ --with-mpc="$DESTDIR$TARGETDIR" \
|
||||
--with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \
|
||||
&& \
|
||||
mkdir -p gcc/$TARGETARCH && \
|
||||
- ln -s $DESTDIR$TARGETDIR/$TARGETARCH/bin gcc/$TARGETARCH/$GCC_VERSION && \
|
||||
+ ln -s "$DESTDIR$TARGETDIR/$TARGETARCH/bin" "gcc/$TARGETARCH/$GCC_VERSION" && \
|
||||
$MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-gcc && \
|
||||
- $MAKE install-gcc DESTDIR=$DESTDIR || touch .failed
|
||||
+ $MAKE install-gcc DESTDIR="$DESTDIR" || touch .failed
|
||||
|
||||
- if [ ! -f .failed -a "$(echo $TARGETARCH | grep -c -- -mingw32)" -eq 0 ]; then
|
||||
+ if [ ! -f .failed ] && [ "$(echo $TARGETARCH | grep -c -- -mingw32)" -eq 0 ]; then
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS CFLAGS_FOR_BUILD="$HOSTCFLAGS" all-target-libgcc && \
|
||||
$MAKE install-target-libgcc DESTDIR=$DESTDIR || touch .failed
|
||||
fi
|
||||
@@ -765,15 +803,15 @@ build_cross_GCC() {
|
||||
|
||||
build_GCC() {
|
||||
if [ "$1" = host ]; then
|
||||
- bootstrap_GCC $1
|
||||
+ bootstrap_GCC "$1"
|
||||
else
|
||||
- build_cross_GCC $1
|
||||
+ build_cross_GCC "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
build_EXPAT() {
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" CFLAGS="$HOSTCFLAGS"
|
||||
- ../${EXPAT_DIR}/configure --disable-shared --prefix=$TARGETDIR \
|
||||
+ ../${EXPAT_DIR}/configure --disable-shared --prefix="$TARGETDIR" \
|
||||
|| touch .failed
|
||||
$MAKE || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
@@ -783,8 +821,9 @@ build_EXPAT() {
|
||||
|
||||
build_PYTHON() {
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" CFLAGS="$HOSTCFLAGS"
|
||||
- ../${PYTHON_DIR}/configure --prefix=$TARGETDIR \
|
||||
+ ../${PYTHON_DIR}/configure --prefix="$TARGETDIR" \
|
||||
|| touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
@@ -793,62 +832,66 @@ build_PYTHON() {
|
||||
|
||||
build_GDB() {
|
||||
export PYTHONHOME=$DESTDIR$TARGETDIR
|
||||
- if [ $(uname) != "FreeBSD" -a $(uname) != "NetBSD" ]; then
|
||||
+ if [ "$UNAME" != "FreeBSD" ] && [ "$UNAME" != "NetBSD" ]; then
|
||||
LIBDL="-ldl"
|
||||
fi
|
||||
LDFLAGS="-Wl,-rpath,\$\$ORIGIN/../lib/ -L$DESTDIR$TARGETDIR/lib \
|
||||
-lpthread $LIBDL -lutil" \
|
||||
CC="$(hostcc target)" CXX="$(hostcxx target)" \
|
||||
CFLAGS="$HOSTCFLAGS -I$DESTDIR$TARGETDIR/include" \
|
||||
- ../${GDB_DIR}/configure --prefix=$TARGETDIR \
|
||||
+ ../${GDB_DIR}/configure --prefix="$TARGETDIR" \
|
||||
--target=${TARGETARCH} --disable-werror --disable-nls
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
}
|
||||
|
||||
build_IASL() {
|
||||
RDIR=$PWD
|
||||
- cd ../$IASL_DIR/generate/unix
|
||||
+ cd ../$IASL_DIR/generate/unix || exit 1
|
||||
CFLAGS="$HOSTCFLAGS"
|
||||
HOST="_LINUX"
|
||||
- test $UNAME = "Darwin" && HOST="_APPLE"
|
||||
- test $UNAME = "FreeBSD" && HOST="_FreeBSD"
|
||||
- test $UNAME = "Cygwin" && HOST="_CYGWIN"
|
||||
+ test "$UNAME" = "Darwin" && HOST="_APPLE"
|
||||
+ test "$UNAME" = "FreeBSD" && HOST="_FreeBSD"
|
||||
+ test "$UNAME" = "Cygwin" && HOST="_CYGWIN"
|
||||
HOST="$HOST" CFLAGS="$CFLAGS" \
|
||||
OPT_CFLAGS="-O -D_FORTIFY_SOURCE=2 -D COREBOOT_TOOLCHAIN_VERSION='\"coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE\"' " \
|
||||
- $MAKE CC="$(hostcc host)" iasl || touch $RDIR/.failed
|
||||
- rm -f $DESTDIR$TARGETDIR/bin/iasl || touch $RDIR/.failed
|
||||
- cp bin/iasl $DESTDIR$TARGETDIR/bin || touch $RDIR/.failed
|
||||
+ $MAKE CC="$(hostcc host)" iasl || touch "$RDIR/.failed"
|
||||
+ rm -f "$DESTDIR$TARGETDIR/bin/iasl" || touch "$RDIR/.failed"
|
||||
+ cp bin/iasl "$DESTDIR$TARGETDIR/bin" || touch "$RDIR/.failed"
|
||||
}
|
||||
|
||||
build_LLVM() {
|
||||
- cd ..
|
||||
- ln -sf $PWD/$CFE_DIR $LLVM_DIR/tools/clang
|
||||
- ln -sf $PWD/$CTE_DIR $LLVM_DIR/tools/clang/tools/extra
|
||||
- ln -sf $PWD/$CRT_DIR $LLVM_DIR/projects/compiler-rt
|
||||
- cd -
|
||||
|
||||
- $CMAKE -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$DESTDIR$TARGETDIR \
|
||||
+ cd .. || exit 1
|
||||
+ ln -sf "$PWD/$CFE_DIR" "$LLVM_DIR/tools/clang"
|
||||
+ ln -sf "$PWD/$CTE_DIR" "$LLVM_DIR/tools/clang/tools/extra"
|
||||
+ ln -sf "$PWD/$CRT_DIR" "$LLVM_DIR/projects/compiler-rt"
|
||||
+ cd - || exit 1
|
||||
+
|
||||
+ $CMAKE -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$DESTDIR$TARGETDIR" \
|
||||
-DCLANG_VENDOR="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE - " \
|
||||
-DCMAKE_BUILD_TYPE=Release ../$LLVM_DIR || touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install || touch .failed
|
||||
|
||||
- cp -a ../$CFE_DIR/tools/scan-build/* $DESTDIR$TARGETDIR/bin
|
||||
- cp -a ../$CFE_DIR/tools/scan-view/* $DESTDIR$TARGETDIR/bin
|
||||
+ cp -a ../$CFE_DIR/tools/scan-build/* "$DESTDIR$TARGETDIR/bin"
|
||||
+ cp -a ../$CFE_DIR/tools/scan-view/* "$DESTDIR$TARGETDIR/bin"
|
||||
|
||||
# create symlinks to work around broken --print-librt-file-name
|
||||
# when used with -target.
|
||||
- cd $DESTDIR$TARGETDIR/lib/clang/${CLANG_VERSION}/lib
|
||||
+ cd "$DESTDIR$TARGETDIR/lib/clang/${CLANG_VERSION}/lib" || exit 1
|
||||
for i in */libclang_rt.builtins*.a; do
|
||||
- ln -s $i .
|
||||
+ ln -s "$i" .
|
||||
done
|
||||
}
|
||||
|
||||
build_MAKE() {
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" CFLAGS="$HOSTCFLAGS" \
|
||||
- ../${MAKE_DIR}/configure --prefix=$TARGETDIR --disable-nls \
|
||||
+ ../${MAKE_DIR}/configure --prefix="$TARGETDIR" --disable-nls \
|
||||
|| touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
@@ -857,8 +900,9 @@ build_MAKE() {
|
||||
|
||||
build_CMAKE() {
|
||||
CC="$(hostcc host)" CXX="$(hostcxx host)" CFLAGS="$HOSTCFLAGS" \
|
||||
- ../${CMAKE_DIR}/configure --prefix=$TARGETDIR \
|
||||
+ ../${CMAKE_DIR}/configure --prefix="$TARGETDIR" \
|
||||
|| touch .failed
|
||||
+ # shellcheck disable=SC2086
|
||||
$MAKE $JOBS || touch .failed
|
||||
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||
|
||||
@@ -900,6 +944,7 @@ else
|
||||
# Detected non-GNU getopt
|
||||
args=$(getopt Vhcd:bBp:l:P:j:D:tSys:un $*)
|
||||
getopt_ret=$?
|
||||
+ # shellcheck disable=SC2086
|
||||
set -- $args
|
||||
fi
|
||||
|
||||
@@ -1026,8 +1071,8 @@ if searchtool wget "GNU" nofail > /dev/null; then
|
||||
download_showing_percentage() {
|
||||
url=$1
|
||||
printf "... ${red} 0%%"
|
||||
- wget $url 2>&1 | while read line; do
|
||||
- echo $line | grep -o "[0-9]\+%" | awk '{printf("\b\b\b\b%4s", $1)}'
|
||||
+ wget "$url" 2>&1 | while read -r line; do
|
||||
+ echo "$line" | grep -o "[0-9]\+%" | awk '{printf("\b\b\b\b%4s", $1)}'
|
||||
done
|
||||
printf "${NC}... "
|
||||
}
|
||||
@@ -1035,7 +1080,7 @@ elif searchtool curl "^curl " > /dev/null; then
|
||||
download_showing_percentage() {
|
||||
url=$1
|
||||
echo
|
||||
- curl -#OL $url
|
||||
+ curl -#OL "$url"
|
||||
}
|
||||
fi
|
||||
|
||||
@@ -1089,7 +1134,7 @@ if is_package_enabled "GCC"; then
|
||||
# sane preset: let the configure script figure out things by itself
|
||||
# more importantly, avoid any values that might already linger in the variable
|
||||
OPTIONS="ABI="
|
||||
-if [ $UNAME = "Darwin" ]; then
|
||||
+if [ "$UNAME" = "Darwin" ]; then
|
||||
#GCC_OPTIONS="$GCC_OPTIONS --enable-threads=posix"
|
||||
|
||||
# generally the OS X compiler can create x64 binaries.
|
||||
@@ -1097,7 +1142,7 @@ if [ $UNAME = "Darwin" ]; then
|
||||
# binaries in 10.6 (even if the kernel is 32bit)
|
||||
# For some weird reason, 10.5 autodetects an ABI=64 though
|
||||
# so we're setting the ABI explicitly here.
|
||||
- if [ $(sysctl -n hw.optional.x86_64 2>/dev/null) -eq 1 ] 2>/dev/null; then
|
||||
+ if [ "$(sysctl -n hw.optional.x86_64 2>/dev/null)" -eq 1 ] 2>/dev/null; then
|
||||
OPTIONS="ABI=64"
|
||||
else
|
||||
OPTIONS="ABI=32"
|
||||
@@ -1109,13 +1154,13 @@ if [ $UNAME = "Darwin" ]; then
|
||||
if $CC -v 2>&1 | grep -q LLVM; then
|
||||
CC=llvm-gcc
|
||||
fi
|
||||
-elif [ $UNAME = "Linux" -o $UNAME = "Cygwin" ]; then
|
||||
+elif [ "$UNAME" = "Linux" ] || [ "$UNAME" = "Cygwin" ]; then
|
||||
# gmp is overeager with detecting 64bit CPUs even if they run
|
||||
# a 32bit kernel and userland.
|
||||
if [ "$(uname -m 2>/dev/null)" = "i686" ]; then
|
||||
OPTIONS="ABI=32"
|
||||
fi
|
||||
-elif [ $UNAME = "NetBSD" ]; then
|
||||
+elif [ "$UNAME" = "NetBSD" ]; then
|
||||
# same for NetBSD but this one reports an i386
|
||||
if [ "$(uname -m 2>/dev/null)" = "i386" ]; then
|
||||
OPTIONS="ABI=32"
|
||||
@@ -1149,9 +1194,10 @@ if [ -z "${LANGUAGES}" ]; then
|
||||
fi
|
||||
if ada_requested; then
|
||||
if have_gnat; then
|
||||
- if [ "$BOOTSTRAP" != 1 -a \
|
||||
- \( "$(hostcc_major)" -lt 4 -o \
|
||||
- \( "$(hostcc_major)" -eq 4 -a "$(hostcc_minor)" -lt 9 \) \) ]
|
||||
+ if [ "$BOOTSTRAP" != 1 ] && \
|
||||
+ \( [ "$(hostcc_major)" -lt 4 ] || \
|
||||
+ \( [ "$(hostcc_major)" -eq 4 ] && \
|
||||
+ [ "$(hostcc_minor)" -lt 9 ] \) \) ]
|
||||
then
|
||||
printf "\n${red}WARNING${NC}\n"
|
||||
printf "Building the Ada compiler (GNAT $(buildcc_version)) with a host compiler older\n"
|
||||
@@ -1167,7 +1213,7 @@ if ada_requested; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
- if [ "$(hostcc_major)" -lt 4 -a "$BOOTSTRAP" != 1 ]; then
|
||||
+ if [ "$(hostcc_major)" -lt 4 ] && [ "$BOOTSTRAP" != 1 ]; then
|
||||
printf "\n${red}WARNING${NC}\n"
|
||||
printf "Building GCC $(buildcc_version) with a very old host compiler ($(hostcc_version)).\n"
|
||||
printf "Bootstrapping (-b) is recommended.\n"
|
||||
@@ -1187,8 +1233,8 @@ fi
|
||||
|
||||
# Prepare target directory for building GCC
|
||||
# (dependencies must be in the PATH)
|
||||
-mkdir -p $DESTDIR$TARGETDIR/bin
|
||||
-mkdir -p $DESTDIR$TARGETDIR/share
|
||||
+mkdir -p "$DESTDIR$TARGETDIR/bin"
|
||||
+mkdir -p "$DESTDIR$TARGETDIR/share"
|
||||
export PATH=$DESTDIR$TARGETDIR/bin:$PATH
|
||||
|
||||
# Download, unpack, patch and build all packages
|
||||
--
|
||||
2.17.1
|
||||
|
@ -0,0 +1,29 @@
|
||||
From 8ba9e8cf63f92902cdb71eb5c4d3b3ea579380f4 Mon Sep 17 00:00:00 2001
|
||||
From: Tom Hiller <thrilleratplay@gmail.com>
|
||||
Date: Sat, 21 Jul 2018 00:14:00 -0400
|
||||
Subject: [PATCH 59/59] util: Add description.md to each util
|
||||
|
||||
Descriptions are taken from the files themselves or READMEs. Description
|
||||
followed by a space with the language in marked up as code.
|
||||
|
||||
Change-Id: I5f91e85d1034736289aedf27de00df00db3ff19c
|
||||
Signed-off-by: Tom Hiller <thrilleratplay@gmail.com>
|
||||
Reviewed-on: https://review.coreboot.org/27563
|
||||
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
|
||||
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
|
||||
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
|
||||
---
|
||||
util/crossgcc/description.md | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
create mode 100644 util/crossgcc/description.md
|
||||
|
||||
diff --git a/util/crossgcc/description.md b/util/crossgcc/description.md
|
||||
new file mode 100644
|
||||
index 0000000000..fa37c2b6ab
|
||||
--- /dev/null
|
||||
+++ b/util/crossgcc/description.md
|
||||
@@ -0,0 +1 @@
|
||||
+A cross toolchain builder for -elf toolchains (ie. no libc support)
|
||||
--
|
||||
2.17.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user