diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-10-27 13:49:38 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2017-11-05 12:14:48 +0000 |
commit | 4203865325c33d752f814850f43d2ecb16c8fa16 (patch) | |
tree | 8bf81042a356db74fad2905b46ea369a316e4309 /elements/gnu-toolchain/gcc.bst | |
parent | b917c363cc13b13ed553051844095469e1d6fc82 (diff) | |
download | definitions-4203865325c33d752f814850f43d2ecb16c8fa16.tar.gz |
Replace use of architecture conditionals with generic project conditions
The initial implementation of architecture conditionals has been
removed, as the same behaviours can be implemented using the more
generic mechanism for conditionals that is being introduced for
BuildStream 1.0.
We now have two architecture options: build_arch and arch. They are
documented in project.conf. The first one controls the build sandbox
while the second controls the host and target of the binaries we
produce.
Diffstat (limited to 'elements/gnu-toolchain/gcc.bst')
-rw-r--r-- | elements/gnu-toolchain/gcc.bst | 59 |
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 |