5 years agoSwitch x86/x86-64 -mtune from "atom" to more generic "intel"
Pavel Chupin [Thu, 12 Dec 2013 16:48:10 +0000]
Switch x86/x86-64 -mtune from "atom" to more generic "intel"

-mtune=intel is tradeoff tuning between top IA archs whereas "atom" is
best on atom only.

Change-Id: I27668e4f48f26b00742d117a9a2a38e8903e22d5
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

5 years agoChange the triplet to aarch64-linux-android for aarch64-gcc.
Ben Cheng [Thu, 17 Oct 2013 23:58:47 +0000]
Change the triplet to aarch64-linux-android for aarch64-gcc.

Change-Id: I0d8803b45b5085379e01d616a1056201453bda9f

6 years agoReplace -march=atom with -march=x86-64 for better host compatibility
Pavel Chupin [Wed, 22 May 2013 12:04:25 +0000]
Replace -march=atom with -march=x86-64 for better host compatibility

Change-Id: Iefaa3ed65333c58484975326bfadd47ddaa92ce3
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

6 years agoAdd x86_64 target configure defaults
Pavel Chupin [Wed, 22 May 2013 07:31:26 +0000]
Add x86_64 target configure defaults

It includes:
-march=atom/-mtune=atom to focus on Atom instructions/optimizations;
-fpmath=sse to generate sse math instructions instead of i387
-m32/-m64/-mx32 support to be able to generate 32/64/x32 code with
single toolchain.

Change-Id: I1a650b4cf572322baa5648a97e1731922571a132
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

6 years agoDon't build GDB in canadian build->target
Andrew Hsieh [Fri, 3 May 2013 07:58:01 +0000]
Don't build GDB in canadian build->target

In canadian build->target is built first (eg. in order to build/run
executable on build system to generate table), then host->target.

Don't build GDB in build->target, because GDB doens't need it.  Besides,
--with-python= pointing to "host" header can fail "build"'s gcc.

Change-Id: Ic1a8a9d6fe5974a6747ca4342a336beea9987f47

6 years agoPython GDB intergration work for the build system.
Ray Donnelly [Thu, 2 May 2013 23:02:41 +0000]
Python GDB intergration work for the build system.

Adds a --with-python=</path/to/python-config.sh> option.

6 years agoFix for GCC 4.8 with graphite
Andrew Hsieh [Mon, 8 Apr 2013 07:42:01 +0000]
Fix for GCC 4.8 with graphite

GCC 4.8 needs cloog-0.18.0 and isl-0.11.1 for graphite

Change-Id: I45a6f34f9981a489d65cc23a0f20e439c11100b2

6 years agoAdd aarch64
Andrew Hsieh [Tue, 9 Apr 2013 07:57:54 +0000]
Add aarch64

Change-Id: I0575d428472c12b56e10367abb73a2b5fd794a08

6 years agoFix GCC 4.8 mingw build
Andrew Hsieh [Tue, 9 Apr 2013 03:31:15 +0000]
Fix GCC 4.8 mingw build

Export CXX_FOR_BUILD otherwise the default g++ can have different
bitness than libiberty.a which is always built in 32-bit for now.
Didn't happen prior to GCC 4.8 because GCC was in C only.  GCC from
4.8 now uses C++ as its implementation language

Change-Id: I318a2e469e1f1ce5cea71654ca5387d26cee5b73

6 years agoDefine READELF_FOR_TARGET in gcc build
Andrew Hsieh [Wed, 27 Mar 2013 04:41:43 +0000]
Define READELF_FOR_TARGET in gcc build

Otherwise realelf won't be found in darwin, and cause
some backend to misbehave.

READELF_FOR_TARGET appears in gcc-4.7, but is backported
to gcc-4.6 as well.

Change-Id: Ia45b3ce046cc68a40862be8f5a906606d2fd0665

6 years agoDefine correct default gcc target march/mtune/mfpmath flags for x86
Pavel Chupin [Wed, 30 Jan 2013 08:43:15 +0000]
Define correct default gcc target march/mtune/mfpmath flags for x86

This is required to enforce correct x86 -march/-mtune flags which are
currently hardcoded in gcc (see gcc/config/i386/gnu-user.h). The problem
is that gcc hardcode doesn't work, it is overridden by generic values.
It can be seen with -### option for any compilation.
This patch adds correct configure flags and after it is merged
-march/-mtune flags in gcc can be removed.

Default -mfpmath can't be seen in -### but can be configured as well to
eliminate hardcode.

Also cleanup old flags which didn't work anyway. target_cpu is i686 and
not x86.

Change-Id: I43ea7034e855629933da2d1bede90cd74a238861
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

6 years agoAvoid race condition by "make install -j1" in canadian build->target
Andrew Hsieh [Fri, 18 Jan 2013 18:53:36 +0000]
Avoid race condition by "make install -j1" in canadian build->target

The first stage of canadian build "build->target" fails very
frequently during libiberty.a installation in parallel ( > -j4)
The observed sympton is that all threads try to install the
same libiberty.a and latecomer fails in "mv -f" when libiberty.an
is already renamed. eg.

  /usr/bin/install -c -m 644 ./libiberty.a \
  ( cd my-build-path/host-x86_64-linux-gnu/install/lib ;
    chmod 644 ./libiberty.an ;
    x86_64-linux-gnu-ranlib ./libiberty.an )
  mv -f my-build-path/host-x86_64-linux-gnu/install/lib/libiberty.an \

build/tools/build-gcc.sh can scale back and continue in half -j
until it succeeds, but the 2nd stage "host->target" often build
slowly with lower -j

Reduce compilations time of GCC 4.7 --mingw from 669s to 543s, or

Change-Id: Ie683319adf445303f485258c65ef3189f605f300

6 years agoAdd new flags CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD
Andrew Hsieh [Thu, 17 Jan 2013 17:00:38 +0000]

In canadian cross build CFLAGS/LDFLAGS may contain flags good
for "host" but not valid for "build".  Define new flags.  eg.

  # flags common to both "host" and "build"
  CFLAGS_FOR_BUILD="-O2 -s -Wno-error"

  # additional flags for "host"

Change-Id: I723d4fa2b62a3945922a027555f30997a66cce48

6 years agoStatically link libgcc and libstdc++ into gold
Pavel Chupin [Fri, 28 Dec 2012 17:21:35 +0000]
Statically link libgcc and libstdc++ into gold

gold built with newer mingw requires libgcc_sjlj_1.dll and
libstdc++-6.dll on runtime. Adding flags to link them statically.

Change-Id: Ic0d8143434164c6519c9e4b185a54cec3b8e72d6
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

6 years agoFix build to compile ppl > 0.11.2
Andrew Hsieh [Thu, 20 Dec 2012 08:33:28 +0000]
Fix build to compile ppl > 0.11.2

Provides library path for the new ppl 'configure' which needs
to links libgmp libgmpxx.

Also remove outdated --with-libgmp-prefix

Change-Id: I3be601c523fe1512e878a0aad632b9da2721c1bd

6 years agoFix 64-bit build of GCC 4.6/4.7 with graphite support
Andrew Hsieh [Sat, 15 Dec 2012 08:40:37 +0000]
Fix 64-bit build of GCC 4.6/4.7 with graphite support

Remove hardcoded "-m32" from ppl errornously introduced in the
previous commit

Change-Id: Ie81122be828be78c64cd076269f904bb82b2d5f7

6 years agoAllow enabling graphite in GCC 4.6/4.7
Andrew Hsieh [Fri, 14 Dec 2012 12:45:28 +0000]
Allow enabling graphite in GCC 4.6/4.7

To enable, configure with additional flags:
  --enable-graphite=yes \
  --with-cloog-version=$CLOOG_VERSION \

Change-Id: I1400aecbf762c7ad5d72609ec87cc7a555061c8f

6 years agoDon't compile host libraries with --with-sysroot
Andrew Hsieh [Fri, 14 Dec 2012 12:38:07 +0000]
Don't compile host libraries with --with-sysroot

build-gcc.sh passes on --with-sysroot which is really meant for
target.  Remove it from "baseargs" to form "host_baseargs"
(borrowed the unused "gold_baseargs") and used it for building
host libraries, otherwise gmp may not have incorrect
dependency_libs= in .libs/libgmpxx.lai.

Change-Id: I2d1c1328039a48b72ce6b4191a71ed5482894459

6 years agoMerge "libbfd: prevent from incorrect assignment of $CFLAGS"
Andrew Hsieh [Thu, 13 Dec 2012 04:55:16 +0000]
Merge "libbfd: prevent from incorrect assignment of $CFLAGS"

6 years agobinutils: disable the installation of localized packages
Jim Huang [Sun, 9 Dec 2012 17:45:00 +0000]
binutils: disable the installation of localized packages

Since the prefix directory usually differs from where Android
toolchain is installed and used, it doesn't make sense to provide
the localized packages, which rely on the given prefix.

Change-Id: I5634e37bf5e4fda46d4d6bc43d037d6bc2fe6ba2

6 years agolibbfd: prevent from incorrect assignment of $CFLAGS
Jim Huang [Sun, 9 Dec 2012 15:47:29 +0000]
libbfd: prevent from incorrect assignment of $CFLAGS

For older versions of binutils, the automake script can not recognize the suffixing
environment variable $CFLAGS and complain as following:

       (cd libbfd-binutils-2.17 ; \
         .././../binutils/binutils-2.17/configure \
          --prefix=/usr/local --target= --host=x86_64-unknown-linux-gnu \
          --build=x86_64-unknown-linux-gnu --program-transform-name='s,y,y,' \
          --disable-shared \
          --enable-install-libbfd --with-included-gettext CFLAGS=" -m32") && \
        touch stmp-config-host-libbfd
configure: warning: CFLAGS= -m32: invalid host type
creating cache ./config.cache
configure: error: can only configure for one host and one target at a time

Change-Id: I075a37d4bfd9b5744ec9c5ffc73446cbbba220b8

6 years agoOptions brought in from core combo for IA
Andrew Hsieh [Tue, 23 Oct 2012 10:53:42 +0000]
Options brought in from core combo for IA

Used to be local NDK patch at $NDK/build/tools/toolchain-patches/

Change-Id: I50a6397414a6574c51857dc2c8826ef50f5f4a0c

6 years agoDisable python support for gdb-7.x
Andrew Hsieh [Wed, 8 Aug 2012 13:04:45 +0000]
Disable python support for gdb-7.x

Before python is also prebuilt, disable python support in gdb-7.x
for now, otherwise gdb-7.x/configure may pick up whatever python
in host and build gdb with hard-wired dependency to specific version
of python.

See related issue:

Change-Id: I15d1144767343fb717864470f7a57f66fd7ba127

7 years agoAllow --enable-gold co-exists with --enable-ld=default
Andrew Hsieh [Thu, 24 May 2012 13:15:00 +0000]
Allow --enable-gold co-exists with --enable-ld=default

Previously --enable-gold meant "enable gold" and "gold is default".
This CL allows ld remains default when gold is enabled.

Change-Id: I6313ca8b410d9937ddfbd4da05fafbfc0e7b7f06

7 years agoRevert setting GDB_TARGET for i[3456]86-*-linux-android and x86_64-*-linux-android
Andrew Hsieh [Thu, 10 May 2012 18:05:49 +0000]
Revert setting GDB_TARGET for i[3456]86-*-linux-android and x86_64-*-linux-android

This CL reverts https://android-review.googlesource.com/#/c/36421
in favor of CL https://android-review.googlesource.com/#/c/36453
which patches GDB/config.sub directly to understand linux-android.

Please see comments in the first CL for rationale.

Change-Id: If3ed4f584d12bf2e998deaeb8b87c07250ed7e03

7 years agoMerge "Set correct GDB_TARGET for i[3456]86-*-linux-android and x86_64-*-linux-android"
Jing Yu [Wed, 9 May 2012 22:34:35 +0000]
Merge "Set correct GDB_TARGET for i[3456]86-*-linux-android and x86_64-*-linux-android"

7 years agoSet correct GDB_TARGET for i[3456]86-*-linux-android and x86_64-*-linux-android
Andrew Hsieh [Wed, 9 May 2012 04:06:05 +0000]
Set correct GDB_TARGET for i[3456]86-*-linux-android and x86_64-*-linux-android

Unlike gdb-7.3.x where *-linux-android-* is supported,
"/bin/sh gdb/gdb-7.1.x/config.sub" fails with i686-pc-linux-android.
Changing GDB_TARGET to i[3456]86-linux-gnu or x86_64-linux-gnu for
GDB < 7.3.x to compile.

Change-Id: Ibd8e9ee81877203da09066ece234b74a6e61da49

7 years agoFixed to allow CFLAGS to accumulate for building host libbfd
Andrew Hsieh [Wed, 9 May 2012 13:55:55 +0000]
Fixed to allow CFLAGS to accumulate for building host libbfd

In this case CFLAGS was set to "-Wno-error" before building host
libbfd, and it's followed by -Werror to invoke CC.  There are a
few warnings treated as error but -Wno-error suppress them.

Resetting CFLAGS to -m32 breaks the build

Changed it to accumulate CFLAGS rather than resetting CFLAGS

Change-Id: I118a848c27f91407b75beabea10c35883ca16e5a

7 years agoSupport i[3456]86/x86_64-*-linux-android targets
H.J. Lu [Sat, 21 Apr 2012 00:40:41 +0000]
Support i[3456]86/x86_64-*-linux-android targets

Allow i[3456]86-*-linux-android and x86_64-*-linux-android targets.

Author: "H.J. Lu" <hongjiu.lu@intel.com>

7 years agoAlways build 32bit host library to /lib32.
Jing Yu [Fri, 20 Apr 2012 22:18:24 +0000]
Always build 32bit host library to /lib32.

Change-Id: I73ed7f7e2120d8be761ec5fdbe747db523e1c53c

7 years agoUpdate build scripts
Jing Yu [Thu, 16 Feb 2012 00:03:22 +0000]
Update build scripts

1) support build of gdb-7.3
2) disable libitm for Android toolchain
3) stop building target libsupc++.a for ARM

Change-Id: I01dab62925892e3d804e698b05c52e0be8c382d5

7 years agoSupport new dual-linker option.
Jing Yu [Wed, 21 Dec 2011 01:01:04 +0000]
Support new dual-linker option.

Let build automatically detect binutils versions and append proper
--enable-gold=xxx options to binutils configuration.
The story is that gcc-4.6 and binutils-2.21 use
--enable-gold=default, our old gcc and binutils use
With the patch, we pass toolchain configuration --enable-gold=xxx to
gcc, and let build script automatically detect binutils version
number and append proper --enable-gold=xxx to binutils configuration.

Change-Id: Iaf31e3285107b3afb7a2f0a66c58b02a9937e214

8 years agoFix host-libbfd installation problem caused by undefined $(INSTALL)
Jim Huang [Thu, 26 May 2011 17:24:34 +0000]
Fix host-libbfd installation problem caused by undefined $(INSTALL)

While executing target install-host-libbfd, the build system complains:

make -C libbfd-binutils-2.20.1/bfd install \
bfdincludedir=/tmp/android-toolchain-eabi/include && \ -m 644
libbfd-binutils-2.20.1/intl/libintl.a \ /tmp/android-toolchain-eabi/lib
&& \ -m 644 libbfd-binutils-2.20.1/libiberty/libiberty.a \

/bin/sh: line 2: -m: command not found

The problem was caused by undefined $(INSTALL).  The patch attempts to
configure `install' program by autotool in order to set $(INSTALL)
properly and replace $(INSTALL) -m 644 with multi-platform friendly

Change-Id: I7f08aa442d62f3d3d8cef2c482c76e6a93500de8
Signed-off-by: Jim Huang <jserv@0xlab.org>

8 years agoConfigure target of host libbfd correctly.
Doug Kwan [Fri, 13 May 2011 07:22:50 +0000]
Configure target of host libbfd correctly.

Change-Id: I30c4fa2e008f62c7d96677ba7219f0d5aec5d12d

8 years agoAdd --enable-graphite option to build script
Jim Huang [Wed, 6 Apr 2011 05:51:49 +0000]
Add --enable-graphite option to build script

GCC 4.5 and up supports graphite optimization, and cloog and ppl
are required.  This change attempts to support some combinations
of ppl and cloog/cloog-ppl libraries.  Since cloog and ppl are
written in C++, it implies we might suffer from C++ ABI breakage
problems when host environment changes, that is a well-known issue
in GNU/Linux distributions.  Thus, we have to link to static C++
runtime library (libstdc++) to avoid depending on the host version.

Default: no

Change-Id: I0a69712379a4e2dc30034a2226a15717a9c121b7

8 years ago- Also install libintl.a and libiberty.
Doug Kwan [Wed, 23 Mar 2011 18:53:17 +0000]
- Also install libintl.a and libiberty.
- Build libsupc++.a for ARM.

Change-Id: I9a83af7870a605c2d1ebc3849b31547aef15cd9c

8 years agoAllow building toolchain without target gdb alternatively.
Luse Cheng [Wed, 23 Mar 2011 06:53:23 +0000]
Allow building toolchain without target gdb alternatively.

Change-Id: I3fd1c4f628c221e6ae4f939aab73e69b3e546bd1

8 years agoFix Makefile.in, a previous check-in broke build using gmp/mpfr/mpc tarballs.
Doug Kwan [Fri, 18 Mar 2011 22:14:24 +0000]
Fix Makefile.in, a previous check-in broke build using gmp/mpfr/mpc tarballs.

Change-Id: I0b16ee52add11b8394ede920d9a0af45fee0db8d

8 years agoAllow build with prebuilt directory for gmp, mpfr and mpc.
Luse Cheng [Tue, 15 Mar 2011 03:59:00 +0000]
Allow build with prebuilt directory for gmp, mpfr and mpc.

Change-Id: I436736db24477e261575ee267d126f44cac35627

8 years agoBuild libbfd for host seperately and install in <toolchain root>/lib.
Doug Kwan [Mon, 14 Mar 2011 03:55:27 +0000]
Build libbfd for host seperately and install in <toolchain root>/lib.

Change-Id: I05125f833a9ffc4172594431eff5bce34e2e2d65

8 years agoInstall host libbfd in toolchain.
Doug Kwan [Sat, 12 Mar 2011 22:02:24 +0000]
Install host libbfd in toolchain.

Change-Id: I9c9a4703ebebc44c7df75594c85dc443394a2426

8 years agoAllow canadian-cross builds of the GCC toolchains.
David 'Digit' Turner [Tue, 30 Nov 2010 17:21:39 +0000]
Allow canadian-cross builds of the GCC toolchains.

This patch allows one to use the "mingw32" cross-compiler on Linux
in order to generate Windows compiler binaries that target ARM machine

This corresponds to the local NDK patch at:


Which has been rebased to the AOSP top-of-tree.

Change-Id: Id4843f66af190c9db02e8f7939045e92e6241ba8

8 years agoSupport building gold from a separate directory.
Jing Yu [Mon, 31 Jan 2011 06:41:02 +0000]
Support building gold from a separate directory.

Before, we built binutils and gold from binutils-2.19.
Now we configure Android toolchain (not for kernel use)

Gold is still the default linker. Command line option "-fuse-ld=bfd"
will tell gcc driver to choose gnu ld linker.

Change-Id: I856892fafee7e53332c6b64f5d2e64d744529902

8 years agobuild: Fix trivial documentation typo
Jim Huang [Fri, 20 Aug 2010 15:30:37 +0000]
build: Fix trivial documentation typo

Change-Id: Ib80c6d91450a5751867cb904b265e21a9dbbb710

8 years agoAllow Makefile to pick up environmental CFLAGS_FOR_TARGET, and
Jing Yu [Thu, 12 Aug 2010 22:52:15 +0000]
Allow Makefile to pick up environmental CFLAGS_FOR_TARGET, and
CXXFLAGS_FOR_TARGET. So that libstdc++_v3 libraries can be built
without modifying the Makefiles.

Change-Id: I569febd84a1bf60b15b19030064b4d9996c93bb0
  export CFLAGS_FOR_TARGET=-fexceptions
  export CXXFLAGS_FOR_TARGET=-frtti
  Add --enable-libstdc__-v3 to the configuration command, build a C++
  supportive toolchain.

8 years agoAdd 'distclean' rule to delete intermediate build files
Jim Huang [Wed, 11 Aug 2010 04:08:30 +0000]
Add 'distclean' rule to delete intermediate build files

This build rule might be useful to developers who wish to switch among
different Android targets.

Change-Id: I412d7e8f69710dd9d421f21fa7d93bed80642834

8 years agoModify clear_header script to recognize arm-linux-androideabi
Jing Yu [Tue, 10 Aug 2010 17:12:29 +0000]
Modify clear_header script to recognize arm-linux-androideabi

Change-Id: Id5a5cf94abffd7a8186fa23eb1b485a670c3fa92

8 years agoPrepare build for upcoming arm-linux-androideabi toolchain.
Jing Yu [Thu, 22 Jul 2010 21:27:24 +0000]
Prepare build for upcoming arm-linux-androideabi toolchain.

Change-Id: I9b1cd5f0d361d092c24557ae1a2e2e2b85b13aaf

8 years agoAdd --disable-nls to building gdb, otherwise gdb-7.0.x fails
Jing Yu [Tue, 8 Jun 2010 21:48:40 +0000]
Add --disable-nls to building gdb, otherwise gdb-7.0.x fails
building on OSX.

Change-Id: I54f923f7656ac2f2a7e4a8dc0a07c43bb4cfb05d

9 years agoUpdate build script to support gold.
Jing Yu [Sun, 25 Apr 2010 03:44:35 +0000]
Update build script to support gold.

Change-Id: Ie2084dfac8d1a267973650aa32e44f2a7c7bd4ab

9 years agoFix two configure bugs on checking gcc version and configuring mpc.
Jing Yu [Wed, 10 Feb 2010 00:19:33 +0000]
Fix two configure bugs on checking gcc version and configuring mpc.
Add flexibility of where to find tarballs.
Ported from CL38191-p2 and CL38139-p2.

9 years agoAdd --with-mpc-version to the build script.
Jing Yu [Mon, 18 Jan 2010 21:58:14 +0000]
Add --with-mpc-version to the build script.

GCC-4.5.0 and up requires mpc library.
File configure is generated from configure.ac by auto config.

9 years agoCheck in patches that fix minor toolchain build problems.
Jing Yu [Thu, 19 Nov 2009 01:59:49 +0000]
Check in patches that fix minor toolchain build problems.

9 years agocheck in build scripts for prebuilt toolchains in Eclair.
Jing Yu [Fri, 6 Nov 2009 02:24:23 +0000]
check in build scripts for prebuilt toolchains in Eclair.

9 years agoEmpty initial commit.
Jean-Baptiste Queru [Thu, 29 Oct 2009 17:41:51 +0000]
Empty initial commit.