summaryrefslogtreecommitdiff
path: root/elements/gnu-toolchain/gcc.bst
diff options
context:
space:
mode:
Diffstat (limited to 'elements/gnu-toolchain/gcc.bst')
-rw-r--r--elements/gnu-toolchain/gcc.bst59
1 files changed, 40 insertions, 19 deletions
diff --git a/elements/gnu-toolchain/gcc.bst b/elements/gnu-toolchain/gcc.bst
index 5c43ca24..6bf6e639 100644
--- a/elements/gnu-toolchain/gcc.bst
+++ b/elements/gnu-toolchain/gcc.bst
@@ -1,5 +1,8 @@
kind: manual
+description:
+ Full featured native compiler which builds everything after gnu-toolchain.bst
+
sources:
- kind: git
url: upstream:gcc-tarball
@@ -15,6 +18,23 @@ depends:
- gnu-toolchain/zlib.bst
- gnu-toolchain/m4-tarball.bst
+variables:
+ gcc-arch-flags: ''
+
+ (?):
+ # ARM platforms vary a lot even within a single architecture revision,
+ # and require tweaks such as this to produce a useful compiler.
+ # This is a default configuration that has worked for some targets.
+ - arch in ["armv7b", "armv7l"]:
+ gcc-arch-flags: --with-arch=armv7-a
+ - arch in ["armv7blhf", "armv7lhf"]:
+ gcc-arch-flags: >
+ --with-arch=armv7-a
+ --with-cpu=cortex-a9
+ --with-tune=cortex-a9
+ --with-fpu=vfpv3-d16
+ --with-float=hard
+
environment:
PATH: /usr/bin:/bin:/usr/sbin:/sbin:/tools/bin:/tools/sbin
@@ -30,17 +50,7 @@ config:
# 2. Avoid having more than one copy of ZLib in use on the system
# 3. Multilib does not make sense in Baserock.
- |
- case "%{bst-target-arch}" in
- armv7lhf) ARCH_FLAGS="--with-arch=armv7-a \
- --with-cpu=cortex-a9 \
- --with-tune=cortex-a9 \
- --with-fpu=vfpv3-d16 \
- --with-float=hard" ;;
- armv7*) ARCH_FLAGS="--with-arch=armv7-a" ;;
- esac
-
- cd o && ../configure \
- $ARCH_FLAGS \
+ cd o && ../configure %{gcc-arch-flags} \
--prefix="%{prefix}" \
`# [1]` --libdir=%{prefix}/lib \
--disable-bootstrap \
@@ -49,14 +59,7 @@ config:
--enable-languages=c,c++,fortran
build-commands:
- - |
- case "%{bst-target-arch}" in
- armv5*) sed -i "s/--host=none/--host=armv5/" o/Makefile
- sed -i "s/--target=none/--target=armv5/" o/Makefile ;;
- armv7*) sed -i "s/--host=none/--host=armv7a/" o/Makefile
- sed -i "s/--target=none/--target=armv7a/" o/Makefile ;;
- esac
- cd o && make
+ - cd o && make
install-commands:
- cd o && make DESTDIR="%{install-root}" install
@@ -69,3 +72,21 @@ config:
strip-commands:
- |
%{stage3-strip-binaries}
+
+ (?):
+ # GCC is not passing the correct host/target flags to GMP's configure
+ # script, which causes it to not use the machine-dependent code for
+ # the platform and use the generic one instead. However, the generic
+ # code results on an undefined reference to `__gmpn_invert_limb' in
+ # ARMv7. Fix the invocation of GMP's configure script so that GMP can
+ # use the machine-dependent code.
+ - arch.startswith("armv5"):
+ build-commands:
+ (<):
+ - sed -i "s/--host=none/--host=armv5/" o/Makefile
+ - sed -i "s/--target=none/--target=armv5/" o/Makefile
+ - arch.startswith("armv7"):
+ build-commands:
+ (<):
+ - sed -i "s/--host=none/--host=armv7a/" o/Makefile
+ - sed -i "s/--target=none/--target=armv7a/" o/Makefile