Commit graph

1116 commits

Author SHA1 Message Date
Treehugger Robot
112fd2b9b1 Merge changes I3454370a,I18dd900d
* changes:
  Move global cppflags to the beginning of cppflags
  genrule: let Android.bp file specify exported header dirs
2016-11-25 05:49:38 +00:00
Colin Cross
10f96b1d77 Merge "genrule: support deps files" 2016-11-23 23:38:28 +00:00
Treehugger Robot
d328ad708e Merge "genrule: expand $$ to $$" 2016-11-23 03:37:59 +00:00
Stephen Hines
9dfd48b9bc Merge "Add proper use of LLVM_RELEASE_VERSION for locating libraries." 2016-11-23 02:23:46 +00:00
Colin Cross
b668826a85 Move global cppflags to the beginning of cppflags
Global cppflags should come first so they can be overriden by module
cppflags.

Test: m -j checkbuild
Change-Id: I3454370a6b35f37982b1e0de2e0ec52b54974a8a
2016-11-22 15:41:09 -08:00
Colin Cross
33bfb0a36a genrule: support deps files
If a genrule sets deps_file: true, use a file in the gen directory
as a GCC-style deps file.

Test: m -j libLLVMObject
Change-Id: Id410165847e4eaea1853a392512e38787c431523
2016-11-22 15:41:09 -08:00
Colin Cross
5ed99c6472 genrule: let Android.bp file specify exported header dirs
Instead of exporting the generated sources dir as headers, let
the Android.bp file specify subdirectories as exported.

Test: m -j checkbuild
Change-Id: I18dd900d63ce7485c8fbfcc39dc77abad6f733d7
2016-11-22 15:41:09 -08:00
Colin Cross
2ee10a0659 genrule: expand $$ to $$
An escaped $ sign in an expanded string needs to be re-escaped so it
can pass through to ninja.

Test: m -j libLLVMObject
Change-Id: I2f7890417fd6f534e6e21cace3d86ae9ef708ce5
2016-11-22 15:41:08 -08:00
Colin Cross
124fd9afbd Add more whitelisted host libraries
Add AppKit, Foundation and Security to darwin for libchrome.

Add -lm and -lversion to windows for llvm.

Test: m -j libLLVMObject
Change-Id: Ie5c922d3fbb41fba1de5f1ce9e530683bf411c5a
2016-11-22 15:41:04 -08:00
Stephen Hines
e55a4cc594 Add proper use of LLVM_RELEASE_VERSION for locating libraries.
Bug: http://b/31532493

As I have been updating to LLVM ~4.0, there are numerous locations where
3.8 is hard-coded, and unable to be overridden. This change adds a new
function for getting the ClangShortVersion(), which can look at
environment variables that override this value (particularly useful for
two-stage compilation, where version numbers change between builds).

Change-Id: Iaec19908cf47b3b2317844d6e1329f7bcd81f022
2016-11-18 17:12:38 -08:00
Dan Willemsen
2e47b34435 Add Toolchain.Bionic()
Move some cc ctx.Host() / ctx.Device() checks over to using
ctx.toolchain().Bionic(). There will be more changes, these are just the
obvious ones dealing with host_ldlibs / crt / system libraries.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: Ibba60483b4ab0e01f6996eb7d883120e4acc1830
2016-11-17 01:50:43 -08:00
Dan Willemsen
967c6a9b87 Allow Host cc_object and cc_toolchain_library
In preparation for LinuxBionic.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: I8e4631ccc3ad5161d76871a43f31d5a4ecbd39c0
2016-11-17 01:50:14 -08:00
Dan Willemsen
00fcbde401 Add LinuxBionic OsType
Actual support will come in later changes.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: I31392fb78a51f43567d16aef89e32cd5137cdbc1
2016-11-17 01:49:50 -08:00
Dan Willemsen
0a37a2a2b8 Encode default enabled state in OsType
Currently our only default-disabled Os is Windows since it's HostCross,
but we'll be adding non-default Host and Device types in the future.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: I2bc3a3cc76f2c95ea040bc34ba6706fcc178c68d
2016-11-17 01:49:39 -08:00
Dan Albert
ebedf678de Support sdk_version: "current" for the NDK.
We need to fall back to the old CRT objects since we aren't generating
those yet.

Test: Created a test module using "current", checked that it linked
      the libs from current.
Bug: None

Change-Id: I5fe170d7b26154da8877672ac2acb7da0262fe38
2016-11-10 14:01:08 -08:00
Dan Albert
90f7a4dcab Allow first_version: "current" in ndk_library.
Test: Added a test module that uses this
      find $SOONG_OUT -name libfoo.so # only shows up in current
Bug: None

Change-Id: Ic88d7c598cd5b6ded8fb851a7eaf859806336af7
2016-11-10 14:01:08 -08:00
Dan Albert
fd86e9ee21 Generate "current" API level.
Support for using this coming in an upcoming patch.

Test: nose2
      readelf to check the following:
      * bsd_signal unversioned before current
      * bsd_signal versioned in current
      * catclose missing before current
      * catclose present and versioned in current
Bug: None
Change-Id: I861862161426d3ec5b530e3156d3a8ae96fed468
2016-11-10 13:49:26 -08:00
Dan Albert
073379e549 Revert "Revert "Use the platform SDK version from the config.""
This reverts commit 74b8b55bb2.

Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
          build/soong/scripts/build-ndk-prebuilts.sh
Bug: None

Change-Id: Ia320609ec6fb382b13ff9007a6496b73198ff871
2016-11-10 11:11:07 -08:00
Dan Albert
22c0b4131d Fix the Platform_sdk_version default.
N has merged into aosp now.

Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
          build/soong/scripts/build-ndk-prebuilts.sh
Bug: None

Change-Id: I2685c700e2cb138708a3e8a5f51281c30fb582db
2016-11-10 11:11:07 -08:00
Dan Albert
8f0f1757f5 Merge "Revert "Use the platform SDK version from the config."" 2016-11-10 17:47:39 +00:00
Treehugger Robot
7eaa5c8824 Merge "Add export_include_dirs to the local include path" 2016-11-10 05:42:42 +00:00
Colin Cross
7f1c10b9b1 Merge "Pass PREBUILT_SDK_VERSION to soong ndk build" 2016-11-10 00:47:33 +00:00
Colin Cross
9fe6ea834f Pass PREBUILT_SDK_VERSION to soong ndk build
Extract PREBUILT_SDK_VERSION from the make build system and pass
it to soong when doing ndk builds.

Test: untested
Change-Id: I573900dfb83aa8665c2bc349b7823e64497754d3
2016-11-09 13:01:41 -08:00
Dan Albert
74b8b55bb2 Revert "Use the platform SDK version from the config."
This reverts commit 9bef523809.

Reason for revert: Broke things

Change-Id: Ic3deac4fb6992572ac0cc95fa04d003e0c29f113
2016-11-09 19:39:42 +00:00
Treehugger Robot
fc75232555 Merge "Use the platform SDK version from the config." 2016-11-09 00:17:46 +00:00
Dan Albert
9bef523809 Use the platform SDK version from the config.
N is in AOSP now.

Test: make ndk && ls out/soong/ndk/platforms/android-24
Bug: None
Change-Id: I846ee12d10e962931bf22c94c37cdf7207dd4ff7
2016-11-08 12:53:39 -08:00
Dan Albert
d56d359f8c Add development/ndk/Android.bp.
Test: make native
Bug: None
Change-Id: I9eed4a63fa797a17c9ef20c73ec4e03b52791c2d
2016-11-08 11:43:45 -08:00
Dan Willemsen
273af7f3aa Add export_include_dirs to the local include path
Bug: 32641232
Test: ./soong builds compared before/after
Change-Id: If417a9f2278f42ffa524fccfd34f2b01a8cc9fb5
2016-11-07 22:31:32 +00:00
Colin Cross
a5662d5e4e Merge "Support genrules with multiple tools" 2016-11-07 20:28:25 +00:00
Colin Cross
6f080dff81 Support genrules with multiple tools
To allow genrules with more than one tool, rename the tool property to
tools and make it an array, replace $tool with $(location <label>),
and use $() for other variables for consistency.

Also remove the host bin directory from the genrule path, and the
$srcDir variable, using either of them would have caused dependency
issues.

Bug: 31948427
Test: compare build.ninja
Change-Id: Icf6d3bce2bea00fec1363fd65c0bdf96d09281bf
(cherry picked from commit de6bd86d24)
2016-11-07 10:53:49 -08:00
Treehugger Robot
6718d0ffac Merge "Add android.Expand" 2016-11-05 08:04:09 +00:00
Treehugger Robot
f543ff67ad Merge "Support a "platform-only" version tag." 2016-11-05 00:35:47 +00:00
Colin Cross
6bde0948d2 Add android.Expand
Add android.Expand to expand $() variables in properties.

Test: expand_test
Bug: 31948427
Change-Id: Id30856a1d21d02e8997fcf2358e4a5feeede05be
2016-11-04 15:59:23 -07:00
Dan Albert
300cb2fe87 Support a "platform-only" version tag.
We tried to support this by version name convention (foo_PLATFORM and
foo_PRIVATE), but not everything follows those conventions. libm has
a LIBC_DEPRECATED, which is a bit to generic to apply this convention
to.

Support a "platform-only" tag which omits the tagged version in the
NDK.

Test: nose2
Bug: None
Change-Id: Iba34628ea02a813d22c8b32d10e54064f17ac6df
2016-11-04 14:52:30 -07:00
Colin Cross
19ce4bddf1 Merge "Move globbing to Blueprint" 2016-11-04 18:09:36 +00:00
Colin Cross
fea56e1220 Merge "Move more includes from -isystem to -I" 2016-11-04 15:31:32 +00:00
Colin Cross
7f19f37443 Move globbing to Blueprint
Move Soong's globbing-with-dependencies support into Blueprint so it can
be used for subdirs= lines in Android.bp files.

Blueprint has a slight change in behavior around subname= lines, it now
always uses the subname and doesn't fall back to Blueprints.  To support
the Blueprints files in build/blueprint, use them directly with build=.

Test: build, add source file that matches glob, rebuild
Change-Id: Ifd0b0d3bc061aae0a16d6c7ca9a1cd8672656b4d
2016-11-04 04:54:16 +00:00
Treehugger Robot
28f9094ee7 Merge "Add proto property struct" 2016-11-04 01:02:27 +00:00
Colin Cross
328f04e778 Move more includes from -isystem to -I
-isystem hides all warnings.  There were no warnings in
hardware/libhardware_legacy/include, hardware/ril/include, or
libnativehelper/include, move them from -isystem to -I.

Test: m -j native
Bug: 31751828
Change-Id: I64cf08b6f6a7f2cfbb19f7d3cc2d2cc9f0157a38
2016-11-03 15:49:36 -07:00
Colin Cross
0feb169460 Add proto property struct
The ProtoProperties struct was not being added to the property struct
list, preventing proto.type and proto.static properties from being set
in Android.bp files.

Bug: 32286026
Test: Add proto.type to system/extras/perfprofd/Android.bp, run soong
Change-Id: I9a5b63ddd3e7a53881ddbfd381c42aa1b4c4f454
2016-11-03 14:38:52 -07:00
Dan Willemsen
9f3c574a39 Add support for Implicit Outputs
Test: mmma -j system/tools/hidl
Test: Inspect out/soong/build.ninja before/after
Change-Id: I8e91a033342a12302d51358c5be244e32ad689d7
2016-11-03 14:35:12 -07:00
Colin Cross
d8f2014d3b Fix race condition writing soong.config
soong_build is run twice simultaneously now, once for manifest
generation and once for docs generation.  If one starts writing the
default soong.config file, and the other starts reading it, the reader
can see an empty file and fail.  Write the soong.config file to a
temporary file and the atomically rename it into place.

Bug: 32628314
Test: rm out/soong/soong.config && m -j blah && cat out/soong/soong.config
Change-Id: I8119b11d45093284b24cbc926d81eb9ea4bf2e27
2016-11-03 16:48:37 +00:00
Dan Willemsen
5a054df23c Merge changes from topic 'genpath_yacc'
* changes:
  Add yacc generated headers to the include path
  Add subdir to GenPath
2016-11-03 07:13:32 +00:00
Treehugger Robot
42e04de8a7 Merge "Support sanitizing a single device arch" 2016-11-03 07:12:54 +00:00
Dan Willemsen
e1a3ce3609 Add yacc generated headers to the include path
Test: mmma -j system/tools/aidl
Change-Id: I444c7f2b004877e027f67e36e016b528511e1a32
2016-11-02 21:19:18 -07:00
Dan Willemsen
21ec49068f Add subdir to GenPath
We were emulating this for proto files, standardize it and make the
other generators use it as well.

Test: Compare out/soong/build.ninja before/after change
Test: mmma -j system/tools/hidl
Change-Id: I1888c7b981749060a398387bbb9b481270bf6d75
2016-11-02 21:19:11 -07:00
Dan Willemsen
eb716e2559 Merge "Update build.ninja.in for blueprint upgrade" 2016-11-03 02:39:18 +00:00
Dan Willemsen
627803256f Update build.ninja.in for blueprint upgrade
Bug: 32574042
Test: m -j
Change-Id: I34a3180a34b156955baf49c87fa985583083687e
2016-11-02 16:21:56 -07:00
Dan Willemsen
318af8be27 Allow overriding tidy configs using environment variables
This matches what Make did.

Bug: 32244182
Test: WITH_TIDY=1 m -j
Test: WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=* m -j
Test: WITH_TIDY=1 DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS=* m -j
Change-Id: I12ee413829d35e20f21f8ca49bb315ea831a6506
2016-11-02 15:47:20 -07:00
Colin Cross
23ae82a2b2 Support sanitizing a single device arch
Allow specifying one or more architectures to sanitize for.  Defaults to
sanitizing all architectures.  Allows reducing the cost of sanitization
by only sanitizing half of the platform.

Bug: 29498013
Test: No change to build.ninja files with m -j SANITIZE_TARGET=address
Test: m -j SANITIZE_TARGET=address SANITIZE_TARGET_ARCH=arm
Test: nm -D $OUT/system/bin/app_process64 | grep asan, no asan symbols found
Change-Id: I972cccc2f19443895d47b44bd8104105f93ffb7d
2016-11-02 15:18:19 -07:00