Commit graph

180 commits

Author SHA1 Message Date
Evgenii Stepanov
2522660da7 Merge "Support SANITIZE_TARGET=safe-stack in soong." 2016-05-12 21:59:25 +00:00
Evgenii Stepanov
0a8a0d09d1 Support SANITIZE_TARGET=safe-stack in soong.
Change-Id: I570a7033ece82c5e76815dc1b81622b481930de4
2016-05-12 13:54:53 -07:00
Dan Willemsen
025b4807cb Include objs from whole static libs before local objs
This matches the make behavior.

Change-Id: I8265fb481424734062b0fca944cdbbe283b7236d
2016-05-12 13:20:52 -07:00
Treehugger Robot
ac6697420a Merge "Move local ldflags after the toolchain ldflags" 2016-05-11 01:27:50 +00:00
Dan Willemsen
00ced7675c Move local ldflags after the toolchain ldflags
This way a local module can override a global flag (like libm
overriding -Wl,--hash-style=)

Change-Id: If32774381fc46b5767f2c13bf45c3a84acb2697e
2016-05-10 17:31:21 -07:00
Dan Willemsen
8a35405d33 Add a 32-bit x86_64 arch variant
In make, the current 32-bit configuration for generic x86_64 targets
inherits some variables (SSE4 support) from the 64-bit configuration,
and overrides the make variables used for other configurations (SSSE3).

We don't have that problem in Soong, but this is the configuration
matching what Make is using.

Change-Id: Ia934ff40f9388f9c202a0fe0608e7b45b77a2714
2016-05-10 15:29:33 -07:00
Dan Willemsen
f4449451b5 Merge "Fix X86 flags" 2016-05-10 00:09:00 +00:00
Dan Willemsen
2524b414e2 Merge "Fix mips flags" 2016-05-10 00:08:54 +00:00
Dan Willemsen
569b0fa2ae Fix X86 flags
Add extra clang cflags, and correct the clang triple for X86 device
builds.

Change-Id: I95abbd0f0f943ebdede905733785ee3659610058
2016-05-09 15:32:07 -07:00
Dan Willemsen
c785ff35af Fix mips flags
Change-Id: Ica7851e19d9a709d03a752dbd4f88f07fc8ce1ee
2016-05-09 15:31:34 -07:00
Dan Willemsen
ed89a7aa0c Clean up and fix Krait cflags
For krait, we were using the cortex-a15 cflags for GCC, but a completely
separate set for Clang. To make it more readable, and prevent the LPAE
flag from being missed for Clang, explicitly define krait cflags for GCC
as well.

Change-Id: I6dc00a22e2b298ee3755190bf09f28e427c8c70d
2016-05-09 15:30:53 -07:00
Dan Willemsen
162d08f35e Add missing arm64 -Werror=implicit-function-declaration
This exists for all of the 64-bit architectures in the make build system

Change-Id: I023ef1afdaaa790aac4243a5c040f533b8814684
2016-05-07 00:27:26 +00:00
Dan Willemsen
4ce4703182 Add -mpopcnt for X86_64 targets if they support popcnt
Change-Id: I09668a220f207d3d7510f058610846e4427d815e
2016-05-06 17:23:20 -07:00
Dan Willemsen
2c044aed20 Remove duplicate -B entry for host linux clang ldflags
In cc/cc.go, we already add -B{GccRoot}/{GccTriple}/bin to all clang
cflags, asflags, and ldflags. So we don't need to add a linux specific
version here.

Change-Id: I42d71662c78a8170463dfec932a633e4d4ff52c8
2016-05-06 17:23:15 -07:00
Colin Cross
6ee75b61cd Support prepended arch-specific properties
Arch-specific static libraries should be prepended so that the common
static libraries can depend on them.

Bug: 26968262
Change-Id: I40a21d18ece8f6d20824437e7180628b29ffdd04
2016-05-05 16:49:43 -07:00
Dan Willemsen
3b1fffa33b Fix Android.mk LOCAL_EXPORT_C_INCLUDE_DIRS generation
We were keeping the original array, and adding duplicates with -I
removed. Instead, only add entries that start with -I, but continue
stripping that off. This removes the -isystem arguments from the NDK
libraries.

Change-Id: I8fd71bbd6b7a051aad7e80a92a05dbdc05a6b87a
2016-05-05 15:11:48 -07:00
Colin Cross
30d5f514dd Support sanitizer builds inside make
Make expects libraries built with address sanitizer to be installed into
/data, and can't handle multiple variants of modules.

Change-Id: Ice575ff6f0788a88f296e7b3ee521a2b9771f55f
2016-05-03 18:02:42 -07:00
Colin Cross
b8ecdfe039 Fix stripping on Darwin
The strip tool is different on Darwin, use a separate darwinStrip rule
instead of calling strip.sh for host builds on Darwin.

Change-Id: I6d421cba0dcea04367d5bc638a03f64c81e2ead0
2016-05-03 15:52:51 -07:00
Colin Cross
e14388b9de Remove trailing / from install path
Prevents make installing files with a double /:
Install: out/target/product/generic_arm64/system/lib//libc.so

Change-Id: Iee237f344e8140c4938aa9d1e6940e4fdbfa7cd8
2016-05-03 14:53:18 -07:00
Colin Cross
665dce9320 Support stripping shared libraries and binaries
Strip all shared libraries and binaries by default.  Use a shell script
to wrap the long sequences of commands needed by some strip variants.

Change-Id: I465bf7cc48330913e60e24762fd55fa2a7731c26
2016-05-03 14:03:38 -07:00
Colin Cross
1474741435 Move shell and python scripts to scripts/ directory
Change-Id: Icdff44a54d14ddfc2266d99cf0578a8105716918
2016-04-29 13:59:56 -07:00
Stephen Hines
369f01315a Switch to clang-2812033.
Change-Id: Ie44a0536a50aa6b443be0c015fca1ea9fa02590c
2016-04-26 21:47:42 -07:00
Colin Cross
737cb6566f Use exported gtest include directories
Manually inserting gtest include directories causes build failures in
manifests that don't have external/gtest.  external/gtest already
exports its include directories so remove the manual include directory.

Change-Id: I6baac4bd3bea7dba3aa134d18b66f02a6dc9a54a
2016-04-25 15:13:23 -07:00
Colin Cross
16b2349190 Add support for sanitizer property
Add a new feature to cc modules that adds the cflags and libraries
necessary to implement AddressSanitizer, ThreadSanitizer, and
UndefinedBehaviorSanitizer.

Change-Id: Ibe5ffadc7ece56080a2521f2c7c00da9ef712584
2016-04-21 16:42:08 -07:00
Colin Cross
4a97cb4328 Support "none" for stl when using ndk
Change-Id: I13ecf0a6be591814546a9a1c8b8356988348feb0
2016-04-21 16:39:28 -07:00
Colin Cross
a8e07cc653 Promote stl to a fixed feature
cc needs to know what stl was selected, promote stl from a generic
feature implementation to a fixed type pointer.

Change-Id: I950ef947f7cd254fe3074f4ff240bb2b90b9116c
2016-04-21 16:39:28 -07:00
Colin Cross
919281aa91 Refactor out exported cflags
Exported cflags are needed by a variety of cc module types.  Refactor
them into an object that can be composed into any cc module type.

Change-Id: I7427ba71085917ca3ec522abadfa2bf33ab43440
2016-04-21 16:35:03 -07:00
Dan Willemsen
b40aab6955 Fix generated sources and headers
Add two cc properties: `generated_sources` and `generated_headers`,
instead of just adding genrule modules to `deps`. Label these with the
dep tagging mechanism, add the generated_headers paths to the include
paths, and add dependencies to generated headers for each compile.

Add dependencies so that regular sources can include generated yacc
headers, not just other generated lex/yacc files. Static/shared specific
sources still don't have dependencies to or from regular sources though.

Switch from an implicit dependency on generated files to an orderonly
dependency, since the depfile will take care of the necessary implicit
dependencies for incremental builds.

Change-Id: I436675acb1f57329d98b81c56dcb4384201a68ea
2016-04-20 15:54:19 -07:00
Colin Cross
21b481b757 Update sanitize property format
Change-Id: Ibca493a70a19cd3dfb58b5404b1c9ed42e068748
2016-04-15 16:27:17 -07:00
Colin Cross
c99deeb961 Use blueprint DependencyTags
Blueprint now requres DependencyTags to be passed to AddDependency
calls.  Use the tags to avoid setting member variables on modules, which
will be lost after the mutators have been called.

Change-Id: I8c1d9ed1db85a300e14394b911a516d361ba9f75
2016-04-12 15:24:02 -07:00
Colin Cross
8141347295 Rename deps property to objs in cc_objects
The deps property is handled by blueprint, which doesn't give the
flexibilty of handling it within soong.  Switch to using objs instead.

Change-Id: Ib8273546578b31b186a3cf1566e80a5eb11943b7
2016-04-11 14:52:04 -07:00
Elliott Hughes
852442957b libm's headers have moved to live with their libc cousins.
(To reduce the need for this kind of thing in the various build systems.)

Change-Id: I75d11497bbf42695f804bcc9ea9ba3b3a12ac764
2016-04-04 12:58:03 -07:00
Dan Willemsen
d30e610ef2 Move runpaths out of global ldflags
The make macros add these to the linker lines even if the default
compiler flags are being skipped.

This also allows us to add another runpath for test binaries, which are
currently being installed in:

  <out>/host/linux-x86/nativetest[64]/<test>/<binary>

So they need to use ../../lib[64] as a rpath.

Change-Id: Ia7e954cdf63bc627a8f71d01c953530355c248ab
2016-03-31 00:00:02 -07:00
Dan Willemsen
e71749280e Fix ToolchainLdflags calls
Instead of having the baseCompiler adjust the Ldflags, teach
objectLinker about ToolchainLdflags. And don't assume that
ToolchainLdflags will work for Clang too, add a ToolchainClangLdflags
call.

Change-Id: I5f546e46f32edf3fcf75a44bee2c5ee103bc5de3
2016-03-30 21:16:34 -07:00
Dan Willemsen
01fdd3d8c1 Various host flag updates to match Make
Some of these are updates from the old build system, others are just
differences/bugs being corrected.

Change-Id: Ied7f47ade495dcb26ba3611e636869cba283860f
2016-03-30 12:35:07 -07:00
Dan Willemsen
99b5a09022 Merge "Only add -fdebug-prefix-map on Linux hosts" 2016-03-30 04:07:54 +00:00
Colin Cross
e925ffce03 Merge "Remove extension from LOCAL_MODULE_STEM" 2016-03-30 01:15:44 +00:00
Dan Willemsen
0c38c5ea17 Only add -fdebug-prefix-map on Linux hosts
Change-Id: I4fb865fbe40020f2d69d598491e755f793b62b7c
2016-03-29 18:03:54 -07:00
Dan Willemsen
110a89d2c5 Fix arm[64] cflags
Limit arm cpu variants to armv7-a-neon only, and handle a generic
armv7-a-neon cpu variant. Add arm64 cortex-a53 cpu variant. Sanity check
the arch variant against supported versions.

Change-Id: I8ecdea4cd36d9c82e1f29b158efc131f8b1cbc4d
2016-03-30 00:40:14 +00:00
Colin Cross
bf305dea81 Remove extension from LOCAL_MODULE_STEM
LOCAL_MODULE_STEM adds the expected extension to the installation path,
remove the extension from the filename.

Change-Id: I54dbcfa73d8d07fc3630caf2d582160003e28f79
2016-03-29 17:32:06 -07:00
Dan Willemsen
8e1e3fba87 Mark the cortex-{a7,a53,a53.57} chips as supporting LPAE
Port of Id3994c6d334c8bb673fc3849550f591136a8dd6a

Change-Id: Ic9d96ff81f9119e012f45e8e3b3a76961a922a21
2016-03-29 15:47:08 -07:00
Colin Cross
7b106e4e9f Don't install static libraries
Disable installing static libraries for now by resetting the installer
when creating a static library variant.

Change-Id: I9360b5c57d95fc0712539accb9450b5fa402fade
2016-03-25 17:31:43 -07:00
Colin Cross
a23446680f Use correct install paths in generated Android.mk
Extract Soong's install path and put it in the generated Android.mk file
so that tests get installed in the correct place.

Change-Id: Id4726855c5677855406de20773a5da533bdd4cea
2016-03-24 13:14:12 -07:00
Colin Cross
ca860ac720 Refactor cc
Refactor all of cc in order to use composition instead of inheritance.
All cc module types exported by cc are now *cc.Module objects, with
compilation, linking, and installing steps delegated to different
objects in order to form the full module type.  Additional features that
modify dependencies and flags can be inserted in a features object list,
and custom module types can be created by adding a Customizer object
that can modify properties.

Change-Id: Ie1283d14920f7856f6947b0530606b2f4d58fab0
2016-03-21 17:31:04 -07:00
Colin Cross
7253e0b8a4 Update clang version to 2690385
Matches changes in I1226f24b50319e321ea538362b2f26fcd227ca39

Change-Id: Iecb2c7388d91fe9975dbe035b5ce6fec8d32a435
2016-03-21 15:13:10 -07:00
Dan Willemsen
dc5d28ad17 Allow overriding of Clang prebuilts
These are the environment variables used by make to override the
llvm/clang prebuilts. As far as I know, these should only be used when
building or testing a new clang drop.

I would have this handled by make and put in soong.variables, but I
expect this to be one of the first options removed from make and
exported from Soong to Kati.

Change-Id: I7a3a70ee44fc4b1e56a5e200e2a7ced77d4c5692
2016-03-16 13:18:07 -07:00
Dan Willemsen
6553f5ef57 Propagate missing dependencies when using whole_static_libs
Currently, whole_static_libs with missing dependencies are silently
ignored. Instead, when getting the object files from the other module,
add its missing dependencies to the current module.

Change-Id: I12472dede2dfafdded56268bfd37f60063b637c4
2016-03-11 21:52:34 +00:00
Dan Willemsen
eb371e51d9 Switch to clang-2658975
Port of https://android-review.googlesource.com/206366

Change-Id: Ife2e0ab84de839ea73744cb65f995a11e3145304
2016-03-11 12:44:29 -08:00
Dan Willemsen
6fb8b8d398 OSX: Use the oldest SDK, but always set our target to 10.8
Build binaries usable on older machines even if older SDKs are not
installed. Older SDKs can no longer be installed on newer Xcode
versions.

Port of https://android-review.googlesource.com/207242

Change-Id: If66f2eef7593bce9fb858fc7b71369f55dd362e4
2016-03-09 10:41:21 -08:00
Dan Willemsen
282a4b0dda Fix C++ on Darwin
Port of https://android-review.googlesource.com/207241

Change-Id: Idad81a528a2104579de0225b0724bb81293eea44
2016-03-09 10:30:22 -08:00