Commit graph

49 commits

Author SHA1 Message Date
Ying Wang
24e03369cf Add -Wno-unused-command-line-argument to clang cflags to enable ccache.
Previously ccache is disabled when it fails calling clang's preprocessor with
unused arguments (such as '-Wa,--noexecstack') in the command line.

See http://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html.
(-Qunused-arguments suppresses more than
-Wno-unused-command-line-argument does.)

Change-Id: I6cde307632c8395c053eb28063d7844d93070562
2014-10-20 17:21:16 -07:00
Chih-Hung Hsieh
ce6300a5db Add -fPIC as default Clang mips ASFLAGS.
For mips target, gcc passes -KPIC to assembler by default,
but clang passes -KPIC only if -fPIC or -fpic is given.

BUG: 17895505
Change-Id: I7803adaf8ad7b40c6473872b67f4e0b4c502b38a
2014-10-08 15:41:29 -07:00
Stephen Hines
f00896663e Remove unnecessary CLANG_CONFIG_EXTRA_*_C_INCLUDES variables.
These aren't needed now that we only use the compiler/headers that exist in
the prebuilts/clang directory.

Change-Id: I9978efb10815e92577d45629db324e0a5094f880
2014-09-25 22:35:16 -07:00
Lai Wei-Chih
8affa161fe Use new variable LLVM_PREBUILTS_VERSION to simplify path construction.
This removes the hard-coded '3.5' in the various paths and makes switching to
a new toolchain easier from the command line (m LLVM_PREBUILTS_VERSION=3.6).

Change-Id: I46b10eb2fc177a03528de9c7b433f8647f632081
2014-09-24 14:59:00 -07:00
Stephen Hines
2f9fa52025 Merge "Fix build breakage due to incorrect bcc_compat RS_TRIPLE." 2014-09-03 16:02:09 +00:00
Stephen Hines
5c72544d48 Fix build breakage due to incorrect bcc_compat RS_TRIPLE.
Bug: 17333374
Change-Id: I13582ce0cde86f7b3728aa4f45a5197438d65a2d
(cherry picked from commit 52626d2a7b)
2014-09-02 21:46:25 -07:00
Ying Wang
cee38d55f8 Merge "[MIPSR6] R6 target options for clang" 2014-09-03 01:02:54 +00:00
Stephen Hines
ec8778e89f Merge "Fix RS_TRIPLE and RS_TRIPLE_CFLAGS." 2014-09-02 16:23:11 +00:00
Stephen Hines
039675adb8 Fix RS_TRIPLE and RS_TRIPLE_CFLAGS.
Bug: 17333374

Add RS_TRIPLE_CFLAGS to ensure that we build with the proper defines on
targets like x86. This also changes all build targets to use the
proper 32/64-bit triples when creating their runtime libraries.

Change-Id: I8f6175b1a14af6d03ee90f32069f3688ec227fb9
2014-08-29 15:20:05 -07:00
Chih-Hung Hsieh
fb482c6d5d Clang rejects -Wno-old-style-declaration flag.
BUG: 17258227
Change-Id: I2a35263298ffd8dd7cda25183e185274cbf62b7b
2014-08-26 16:37:00 -07:00
Chih-Hung Hsieh
4d12b5788d Clang does not recognize -Wno-literal-suffix.
BUG: 17258227
Change-Id: I2d98e68daa780fbe0e127605840ae7edcb4e9880
2014-08-26 15:30:04 -07:00
Chih-Hung Hsieh
0278174764 Add GCC only flags to clang .mk files.
BUG: 17258227
Change-Id: Iec9fdb21a9fa31e18a17704beb27bb493c9b7192
2014-08-25 16:49:53 -07:00
Duane Sand
13066a8d4c [MIPSR6] R6 target options for clang
Pass along new R6 target arch options and floating
point register model options to clang.
Also pass along older arch variants.

This patch depends on recent Mips extensions to 3.5 clang.
The new options are rejected by aosp's current 3.5 clang.
This only affects builds for mips32r6/mips64r6, not Android's
default builds for mips32r2.

Change-Id: Ic921dc14ced34a83143a82e322124b3ef035014a
2014-07-31 14:58:48 -07:00
Elliott Hughes
d23798bfdc Merge "[MIPSR6] Add mips64r6 and mips32r6 targets" 2014-07-30 11:26:00 +00:00
David 'Digit' Turner
44ee3419e7 Update host linux toolchain to gcc 4.8
This patch ensures the build system uses the prebuilt gcc-4.8 toolchain
when building host Linux binaries, instead of the gcc-4.6 one.

Change-Id: I7b449650714ba4314a780827e0243f2af40ec82c
2014-07-31 19:51:40 +02:00
Duane Sand
6bab974cdc [MIPSR6] Add mips64r6 and mips32r6 targets
Add mips64r6 target and corresponding mips32r6 target.
Defaults remain as mips64r2 and mips32r2.

Apply -FP64A codegen subsetting to mips32r6 only.
Access FR=0 odd-numbered 32-bit float regs only via
double-prec even-numbered regs, not by single-prec ops.

Change-Id: I1740a6c658304b6c41242be58d68753e6f171658
2014-07-24 11:19:21 -07:00
Duane Sand
6670e24aed [MIPS] Unite mipsel and mips64el 4.9 gcc toolchains
Use 4.9 mips64el toolchain for both 64- and 32-bit builds.
Tell ld when 32-bit links are required.
Override 4.9's changed defaults for mips floating point
register use, to get same assembler rules as 4.8 and earlier.

Also: drop unused  soft-fp build targets, cleanout redundant
compiler options, and remove extraneous Android.mk file.

Change-Id: I86f1075266349edb2b08a7709b9f5472d8cfda32
2014-07-23 14:16:00 -07:00
Duane Sand
41ca444637 [MIPS64] Enable mips64 clang
Change-Id: I737f40ff1d4c71c21bea5159d1b0acee89fe32a2
2014-07-23 14:10:39 -07:00
Elliott Hughes
0b3c42cbc8 Merge "[MIPS] Unite mipsel and mips64el 4.9 gcc toolchains" 2014-07-23 17:53:27 +00:00
Ying Wang
1b0fc43557 Revert "Revert "Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to clang.""
This reverts commit a4f84fdfed.
Added "export CCACHE_CPP2 := true" to work around ccache bug with clang.
See:
http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html

Change-Id: I2b1fa8fd59c3a113c4028a92a1d16018133c9792
2014-07-29 18:05:27 -07:00
Marcin Kosiba
6be7d2e5bb Merge "Revert "Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to clang."" 2014-07-23 19:31:58 +00:00
Dan Albert
a4f84fdfed Revert "Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to clang."
This broke the world.

This reverts commit 3b7a4d811d.

Change-Id: Iefb01b8642a92bcc718d2c745e8ce1346ba50143
2014-07-26 20:35:06 +00:00
Ying Wang
45040bdbb8 Merge "Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to clang." 2014-07-23 18:04:01 +00:00
Tim Murray
92d79cbb41 Switch host builds to use Clang by default.
If LOCAL_CLANG is not set to false for a host module, clang will be used instead of gcc.

This also enables the integrated assembler by default for Darwin host builds.

bug 16172793

Change-Id: If7484c5dbcccce7d925bec97bff0a3e4c30e9434
2014-07-24 09:25:58 -07:00
Marcin Kosiba
3b7a4d811d Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to clang.
This is essentially Ide800c24f0c2ebbb1cfb358bd8f99ec8a9d41253
applied to clang.

Change-Id: I883f9e9a31fff50a64568a06ef5248437344542b
2014-06-19 15:33:26 +01:00
Brian Carlstrom
338d1e7f33 Help catch common 32/64-bit errors.
(cherry picked from commit cf5ea762e015bc044d251814d9062ef1df4dd49f)

Change-Id: I43eb93d41967c63acb0723083c0178019f1364d0
2014-06-17 15:23:49 -07:00
Ying Wang
2713fcebba Switch to 32-bit-by-default host multilib build.
Also we don't need to force LLVM built from source, for we already force
LLVM to be built as 32-bit.

Bug: 13751317
Change-Id: Ifadf1988d28b60cb06316de50f5bdc1834f1acc0
2014-06-09 17:48:05 -07:00
Stephen Hines
5339640da6 Switch name from tblgen -> llvm-tblgen for consistency with upstream tools.
Change-Id: I7735fd88104ff95001dd5f88a1c387df9af993ad
2014-06-03 18:28:44 -07:00
Ying Wang
b0143e2fff Merge "Add some more flags to CLANG_CONFIG_UNKNOWN_CFLAGS" 2014-05-22 17:38:01 +00:00
Ying Wang
6374153fbf Force to build llvm from source in 64-bit host build.
Bug: 13751317
Change-Id: I4a4150bfe21607eb7a2342bbd8120b431427eee5
2014-05-16 09:37:23 -07:00
Ying Wang
a303c4f546 x86_common.mk has been replaced by HOST_x86_common.mk
Change-Id: I19eea82bb35d3f65a2d894c687131a1eafbe2cc9
2014-05-15 18:50:06 -07:00
Ying Wang
6feb6d5607 Support host multilib build
This change basically ported our target multilib to the host side.
It supports 2 host build modes: x86 and x86_64 multilib build.
For now you need to set "BUILD_HOST_64bit=true" to switch to x86_64
multilib build. Later we'll default to x86_64 build and have a flag
to force 32-bit only build, which may be needed by SDK build.

In host module definition, like in target ones, you can use the
following
LOCAL variables to set up multilib configuration:
LOCAL_MULTILIB: can be "both", "first", "32" or "64".
It also supports the same set of arch or 32-vs-64 specific LOCAL
variables.
By default, it builds only for the first arch.

To keep path compatibility, in x86_64 build files are still output to
out/host/linux-x86; Both 32-bit and 64-bit executables are in
out/host/linux-86/bin;
In x86_64 build 32-bit shared libraries are installed to
out/host/linux-x86/lib32
and 64-bit shared libraries are installed to out/host/linux-x86/lib;
32-bit object files are output to out/host/linux-x86/obj32 and 64-bit
object files
are output to out/host/linux-x86/obj.

Bug: 13751317
Change-Id: I6044f83b7db369a33e05209e8c588eb6dc83409f
2014-05-14 16:55:04 -07:00
Bernhard Rosenkraenzer
d6e11825c4 Add some more flags to CLANG_CONFIG_UNKNOWN_CFLAGS
Add some more gcc specific flags that are used somewhere in the tree
(e.g. external/chromium_org) to CLANG_CONFIG_UNKNOWN_CFLAGS

Change-Id: Icc572fdb6ea4ba818c4d18e430296589eb61bf55
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
2014-05-12 16:05:14 +02:00
Andrew Hsieh
48f239c94f Disable canonical prefixes of system headers
GCC know a few pre-defined paths (relative to its location) to
search for headers, libraries, program, etc.  By default GCC prefixes
its own path(argv[0]) and calls realpath() which result in absolute
path with all symlink, . and .. removed.

It's usually good to have canonicalised paths, but absolute paths
in *.d file can cause unnecessary relinking when stale entries
in ccache cache hit

Add -no-canonical-prefixes (gcc>=4.6) and
-fno-canonical-system-headers (gcc>4.6) to disable realpath() on
prefixed paths

Change-Id: I58d739e61fb013015fb05a9c98b2132b307f915a
2014-05-09 22:12:49 +08:00
Tim Murray
d720c5a2a6 Merge "Add -no-integrated-as for ARM64." 2014-05-02 18:21:34 +00:00
Tim Murray
6f144b8f65 Add -no-integrated-as for ARM64.
Change-Id: I7faba190554aa43f43b2eb164bdc7b3bfab68ef0
2014-04-30 15:55:52 -07:00
Tim Murray
75b58cc827 Remove tblgen and clang-tblgen from prebuilts.
Change-Id: I89fb74da5a516d0f768f72518a401216f8a5b1a8
2014-04-30 13:54:32 -07:00
Tim Murray
43d5e1bbc4 Build changes necessary for LLVM 3.5 switch.
Change-Id: Icb6065daada7cb1d7425206830a4ef9e23454c03

Conflicts:
	core/clang/arm.mk
2014-04-24 13:14:32 -07:00
Andrew Hsieh
dfde360b2c Switch to new host prebuilt x86_64-linux-glibc2.11-4.6
Change-Id: I763398d523bf4851a13722f72b12ec69d7a4bb4f
2014-04-23 14:47:00 -07:00
Tim Murray
d318ba66f9 Update build system for better Clang behavior on Mac.
Change-Id: I1813954681b670807d7e3faaf6d5f5a769cc5f2e
2014-04-22 09:26:22 -07:00
Tim Murray
125a3c9fb0 Always use prebuilt clang, even if we're explicitly building clang/LLVM.
This is needed for self-hosting Clang/LLVM.

bug 13588226

Change-Id: Ic98adc2b174b12ce046b7b65bbc28901a766a485
2014-04-01 16:08:51 -07:00
Tim Murray
02cefc93a8 Make Clang host builds hermetic on Linux.
This lays the groundwork for making builds hermetic on Darwin as well.
That will be fixed in a future patch.

bug 13435344

Change-Id: Iae82d0b9efad0598d682ff5fd4daa737aa607866
2014-03-24 19:38:47 -07:00
Ying Wang
ed56902c29 Remove arm64 clang build warning
Now we have enabled arm64 clang.
This change remvoed arm64 clang build warning and cleaned the
arm64 unknow c flags.

Change-Id: Ia583a78c6d364e603ff09df423aa34a6e03d0b9b
2014-03-18 15:58:13 -07:00
Tim Murray
b5f333bbef Work in progress to enable build system support for Clang.
Change-Id: I278b48bcd976afcbde8d86261da9b9b9efc9002c
2014-03-14 00:39:03 -07:00
Ying Wang
ba8b377d89 Split WITHOUT_CLANG to WITHOUT_HOST_CLANG and WITHOUT_TARGET_CLANG
Still keep WITHOUT_CLANG, which enables both.

Bug: 13402154
Change-Id: I32cb668223997719875751bf3d64f592d6086830
2014-03-10 18:59:12 -07:00
Stephen Hines
7bc754bca9 Switch to LLVM 3.4 prebuilts in AOSP.
Change-Id: I064e953fb1bf69e7e321616647aab88dcc39af76
2014-02-19 09:03:00 -08:00
Stephen Hines
6d5dd2367a Fix incorrect x86 build rules.
combo/TARGET_x86*.mk mistakenly added TARGET_GLOBAL_CFLAGS to their
linker command lines. This results in clang builds not working properly,
since they strip some unknown flags from TARGET_GLOBAL_CFLAGS.

Change-Id: I60a1ff5df70305323134435e4ae107ea7acfe8ea
2014-02-13 09:24:29 -08:00
Colin Cross
b0ef9111ac fix 2nd target clang prebuilt paths
Change-Id: I4c196221bd377e30bbff1aafa265952e29c85cb5
2014-02-11 12:48:12 -08:00
Ying Wang
1f9828387d Refactor llvm_config.mk and support the 2nd arch
1. Following the setup of gcc in build/core/combo/,
we added the [HOST|TARGET]_<arch>.mk clang config files,
and load only the configs needed by the current product.
2. Added support for the 2nd arch.

Change-Id: I2a383418a9688a050b39492f8e489d40eeeb5f2d
2014-02-07 09:11:22 -08:00