Commit graph

389 commits

Author SHA1 Message Date
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
f7f3d69cf5 Add genrule tool_file to better handle deps
This will allow modules to specify a local script file that will be
expanded to the proper path in $tool, and will automatically be added to
the dependencies.

Change-Id: Icea4046b1fe2fd7c543aa33913d1a53201b15353
2016-04-21 13:20:01 -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
d6d6b6942d Merge "Provide a default DeviceArchVariant" 2016-03-30 06:26:54 +00:00
Dan Willemsen
a91d127443 Provide a default DeviceArchVariant
The empty string is no longer a valid arm64 arch variant.

Change-Id: I61468ba09f9fd629e9ebd3915e266490416f65d6
2016-03-29 22:06:42 -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
944beef615 Merge "Use correct install paths in generated Android.mk" 2016-03-24 22:02:12 +00:00
Dan Willemsen
eea8e6c7e1 Merge "Improve BUILDDIR handling with symlinks" 2016-03-24 20:38:08 +00: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
Dan Willemsen
6ac18ecb84 Improve BUILDDIR handling with symlinks
If BUILDDIR is a local symlink to another directory in the same parent
directory (out -> out.angler), then using out and .. as relative paths
to get back and forth work.

But if BUILDDIR is a symlink to another directory altogether (out ->
/mnt/sdd/out.master), then we shouldn't be relying on relative paths (so
that the source directory can still be moved).

Change-Id: I946c8116090410ab2b935eafba9b6e96f5f2f1dd
2016-03-22 19:53:36 -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
b50381684a Split Allow_missing_dependencies from Unbundled_build
There are stripped down branches used to build other things than just
unbundled apps (like the AOSP llvm branch used to build llvm prebuilts).

Change-Id: Id772eac8c4622458591b52f9f27723fdb83f9a85
2016-03-16 12:35:33 -07:00
Dan Willemsen
0f6042e317 Fix optional intermediates path for unbundled builds
On an unbundled build, if an include directory was missing, I generated
an intermediate path with PathForModuleOut. That included another copy
of $OUT_DIR, which I didn't notice. This fails if $OUT_DIR is an
absolute directory. Just manually set up the path for now.

Change-Id: I3821d562c929e69ed2fccb7e88affed384a7789e
2016-03-11 17:04:02 -08:00
Dan Willemsen
e23dfb7fdc Support missing include dirs for unbundled branches
Treat absolute paths specified from a module (include_dirs, etc) like
actual module dependencies. If it doesn't exist, produce a ninja error
instead of refusing to create the ninja file.

Change-Id: I662b9bb2af04b2006984a07d1ccb700b63dde582
2016-03-11 15:15:50 -08: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
Dan Willemsen
71ea9c13c9 Use optional_dirs for non-soong projects
On some branches, some of these projects may not exist. Use dirs for the
blueprint / soong projects, and optional_dirs for everything else.

Change-Id: I2b84948f1818941a21981c135bd6237852bfcc8b
2016-03-07 21:05:02 -08:00
Dan Willemsen
f3af6ce631 Merge "Replace Device_uses_{dl,je}malloc with Malloc_not_svelte" 2016-03-04 23:53:36 +00:00
Dan Willemsen
b955336d33 Swap -lm and -lpthread for host libc++ users
Match the order we use in make.

Change-Id: I7959f72841bd058b13d6c8fc6efb3c78b5de9d35
2016-03-03 19:24:03 -08:00
Dan Willemsen
99db8c30c1 Do not use -Wl,--gc-sections for linux host libraries
This matches make

Change-Id: I2ee2e47065439afa02b946ede3a7718f1a8dc71b
2016-03-03 18:09:19 -08:00
Dan Willemsen
f534a10643 Reorder extra clang host flags
In make these clang-specific flags are marked as EXTRA and added after
the common flags.

This was causing differences between compiled objects in make and soong
because -fstack-protector-strong was before -fstack-protector in soong
instead of after.

Change-Id: I59dd6dcfdaf5ec9184a09e79efe80b62cfe48dbb
2016-03-03 17:22:39 -08:00
Dan Willemsen
be03f346b3 Port GLOBAL[_CLANG]_CFLAGS_NO_OVERRIDE from make
Change-Id: I4f0f8ec7620e4477f60bf9cf1ae0c005470c89d4
2016-03-03 17:21:04 -08:00
Dan Willemsen
f778e12c57 Remove useless LOCAL_ACP_UNAVAILABLE
The make build system no longer needs LOCAL_ACP_UNAVAILABLE.

Change-Id: Ieef1415488853add9c5f5ab24219f9c6d3d13aa5
2016-03-01 23:10:25 -08:00
Dan Willemsen
52b1cd2544 Add a global define for non-external code.
Soong port of https://android-review.googlesource.com/204887

Change-Id: I15faf62cec1932dd859a082f66942b2606d0ff45
2016-03-02 03:08:37 +00:00
Dan Willemsen
4fef64b320 Merge changes Ife723733,I68acfb53,Id216c35d,Id0569831,Iadac88f8, ...
* changes:
  Add system/media/audio/include to commonGlobalIncludes
  Add -Werror=date-time to target builds
  DeviceUsesClang should default to true
  clang now supports -fdebug-prefix-map=.
  Turn on ninja errors for duplicate rules
  Update to use the latest clang-2629532
2016-03-02 03:06:41 +00:00
Dan Willemsen
f0c73e0f71 Generate .c for .y and .l
Soong port of https://android-review.googlesource.com/195737

Change-Id: I9ab6dc149c258f7642bc36c3fa32f90ff7ee51a4
2016-03-01 17:32:31 -08:00
Dan Willemsen
97cae01e92 Replace Device_uses_{dl,je}malloc with Malloc_not_svelte
This no longer switches between dlmalloc and jemalloc, it just changes
the jemalloc cflags for non-svelte devices.

Change-Id: Ic6975de89a53a42e4735dbdcde68367ebfc42f9b
2016-03-01 17:30:59 -08:00
Dan Willemsen
98f93c77e8 Add system/media/audio/include to commonGlobalIncludes
This list now matches the make build system.

Change-Id: Ife723733f269bdcc00a0c2e9096e3e2cb7e6f88e
2016-03-01 17:22:51 -08:00
Dan Willemsen
a6084a3662 Add -Werror=date-time to target builds
Soong port of https://android-review.googlesource.com/195464

Change-Id: I68acfb53be962ffd5c488337517dadb950a13b6f
2016-03-01 17:22:44 -08:00