Commit graph

387 commits

Author SHA1 Message Date
Colin Cross
7863cf53a8 Only use -read_only_relocs on darwin x86
Darwin x86_64 warns with -read_only_relocs:
ld: warning: -read_only_relocs cannot be used with x86_64

Only pass it for darwin x86.

Test: m -j on darwin
Change-Id: I080afb83d777587d14b60c8cd24b59005a275275
2016-10-20 10:47:21 -07:00
Dan Willemsen
cbceaab39c Export asan configuration to make
Test: Ninja files for ASAN'd aosp_flounder-eng identical
Change-Id: Ib29cac0bc391dadd9ff27992c7b356415182767f
2016-10-13 23:46:10 +00:00
Treehugger Robot
556566e5ad Merge changes I6e84da66,Ie9e3ed09
* changes:
  Initial prebuilt support
  Only register mutators once
2016-10-13 23:27:32 +00:00
Colin Cross
ce75d2c6a2 Initial prebuilt support
Support prebuilt shared libraries as an initial proof-of-concept of
prebuilts.  Future changes will support binaries and static libraries,
and the ability to select which to use based on something besides
blueprint properties.

Test: TestPrebuilts run during m -j
Change-Id: I6e84da667e9005ae11844bad01d25cbe4ced1ce3
2016-10-13 14:52:47 -07:00
Elliott Hughes
5a0401ab9c Consistently use -std=gnu99 for gcc as well as clang.
This matters for C files that are also built for Windows. Previously they'd
be compiled with -std=gnu99 for the host but [effectively] -std=gnu89 for
Windows.

Bug: http://b/32019064
Test: builds, and can build libcrypto_utils without a manual -std= line
Change-Id: I9c5cc7832220b5c3d6a007ff10d076e26fd8c75d
2016-10-13 14:41:31 +00:00
Colin Cross
fc754581fc Add a Name property
Blueprint is going to abdicate responsibility for determining the name
of a module.  Add a name property, and a method to retreive the name.

Test: build.ninja identical
Change-Id: I09c6f5283cd6e28ad4b04c24c5ab8b00f71ae2ab
2016-10-12 17:24:49 -07:00
Colin Cross
1e676bef94 Control mutator order
Register mutators inside lambdas that are called in a defined order to
correctly order mutators before and after the arch and deps mutators.

Test: build.ninja identical
Change-Id: Iefe2a3515aee8570e76a6e76925db4cda0e9e822
2016-10-12 15:33:33 -07:00
Colin Cross
798bfce9d0 Move registration into android package
Mutator registration is tightly coupled with the android package, move
all registration from the soong package to the android package.

Test: build.ninja identical
Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
2016-10-12 14:30:44 -07:00
Treehugger Robot
3f9bde87fb Merge "Move hardware/libhardware/include from -isystem to -I" 2016-10-09 01:05:31 +00:00
Treehugger Robot
44266e97f8 Merge "Move system/media/audio/include from -isystem to -I" 2016-10-07 20:40:54 +00:00
Colin Cross
2d44c2c716 Move hardware/libhardware/include from -isystem to -I
-isystem hides all warnings.  The warnings in hardware/libhardware/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j
Bug: 32018017
Change-Id: I9a602d5e1bd021638d3a92d93af3d2a18ab4caa7
2016-10-07 11:40:04 -07:00
Colin Cross
1928093246 Move system/media/audio/include from -isystem to -I
-isystem hides all warnings.  The warnings in system/media/audio/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j
Bug: 31997134
Change-Id: I1c0b68935d643992dd9fc7f76583bed286e49325
2016-10-07 11:39:58 -07:00
Josh Gao
15d523b933 Merge "Allow -lobjc and -framework IOKit in darwin host_ldlibs." 2016-10-06 23:59:58 +00:00
Colin Cross
315a6ffc99 Move frameworks/native/include from -isystem to -I
-isystem hides all warnings.  The warnings in frameworks/native/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j checkbuild
Bug: 31752268
Change-Id: Ie3656348b5b2a1828dec790aa047635ac0fe6d86
2016-10-05 12:58:29 -07:00
Dan Willemsen
0b24c74fcb Disable cc_benchmark for Darwin hosts
The google-benchmark library is disabled on Darwin, so we cannot create
host benchmarks. Instead of having every user specify this, put the
logic in Soong. Then if we decide to support it later, it's an easier
switch.

Test: build.ninja identical before/after on Linux
Test: Ignores failing cc_benchmark_host on Darwin
Change-Id: I61f3a571fd160d8e479a512992bc68601f1c9b28
2016-10-04 15:20:16 -07:00
Colin Cross
89562dc308 Enable toc optimization for host builds
The toc optimization had been disabled for host builds to ensure that
the timestamp of the final binary changed whenever its implementation
changed, in order to support rerunning host tools that were modified
during incremental builds.  However, only the final install rule must be
re-run to update the timestamp, and not the link rule.

Update the shared library install dependencies to use normal
dependencies instead of order-only dependencies for host modules, and
then enable the the toc optimization for host modules.  If the
implementation of a library changes it will be reinstalled, and
libraries or binaries that depend on it will also be reinstalled.

Also move toc generation to happen on the packed, stripped library,
which is what will be used for linking, to ensure that it is available
at link time when depending only on the toc file.

Bug: 26015464
Test: m -j; touch system/tools/hidl/Annotation.cpp; m -j, verify
      out/soong/host/linux-x86/bin/hidl-gen is updated
Change-Id: I8953261d2209376f3dccbf0b1a93f7af4e45c4d0
2016-10-04 10:12:04 -07:00
Colin Cross
4d67642cbd Fix toc path
toc path was including the build directory twice, which breaks builds
with absolute paths to the build directory.

Test: m -j
Bug: 26014946
Change-Id: Ibc0856d1b22a44ec0c297f5dd84a932fde9f20af
2016-10-04 09:36:43 -07:00
Colin Cross
26c34ede29 Add support for toc optimization in soong
Skip relinking against shared libraries whose interface hasn't changed.

Test: mmma -j frameworks/native/libs/gui
Test: touch frameworks/native/libs/gui/BufferItem.cpp
Test: mmma -j frameworks/native/libs/gui, see nothing relinks past libgui
Bug: 26014946
Change-Id: I4d4b8da6a35c682341ae51869f5c72b51e192053
2016-09-30 21:05:59 -07:00
Treehugger Robot
12013c8fe6 Merge "Ninja and shell escape command line flags" 2016-09-30 04:17:59 +00:00
Dan Willemsen
847dcc7d2a Handle dependencies with export_generated_headers
This sets up the proper dependencies within Soong by adding the imported
dependencies into GeneratedHeaders, and re-exporting them as necessary.
It also exports them to Make using the new LOCAL_EXPORT_C_INCLUDE_DEPS.

Bug: 31742855
Test: Inspection, build hardware/interfaces (pending)
Change-Id: I6a10ceec377a97966baa9d4876b90fcda391dd01
2016-09-30 01:37:38 +00:00
Colin Cross
4b963f8d6a Ninja and shell escape command line flags
Strings like cflags in Android.bp files are parsed by blueprint,
written to build.ninja files, parsed by ninja, and then passed to
/bin/sh -c.  This had resulted in a combination of blueprint
(\"), ninja ($$), and shell (\$) escaping being necessary.

Update Soong to automatically handle ninja and shell escaping in
cflags and ldflags.

Bug: 31221587
Test: m -j
Change-Id: Ibe087b2788b355b73c3225b5928870619a0a53bc
2016-09-29 15:57:59 -07:00
Josh Gao
3923e84a49 Allow -lobjc and -framework IOKit in darwin host_ldlibs.
Bug: http://b/31321337
Test: mma of external/libusb on darwin
Change-Id: I1023a2a7ff1fdf809ac47104bca7b4171861abef
2016-09-29 14:47:47 -07:00
Dan Willemsen
03ce63eaa6 Trigger binary installation in Soong from Make
We prepended Soong's binary installation path to PATH, but now
rebuilding binaries that are in Soong and exported to Make produces
inconsistent results. From an empty out directory:

Run `m -j hidl-gen`, PATH will get a hidl-gen binary in out/host/...
Run `m -j android.hardware.tests.foo@1.0`, PATH will get a new hidl-gen
binary in out/soong/host/...
Make a change to hidl-gen, then run `m -j hidl-gen`. The hidl-gen first
in PATH is still the one without the changes.

Bug: 31742855
Test: m -j hidl-gen showcommands
Change-Id: If01a76d10d786dac6f16f31d1142634af4964228
2016-09-29 13:56:02 -07:00
Treehugger Robot
81ef084a00 Merge changes from topic 'genrule-multi-out'
* changes:
  Remove shared lib name checks
  Add export_generated_headers
  Support multiple outputs for genrule
  Parse genrule's cmd property
  Expose HostToolPath on the cc module to fix genrule.tool
2016-09-29 05:33:04 +00:00
Dan Willemsen
27279ece28 Remove shared lib name checks
Now that we're no longer using -l, we don't need to strip off the "lib"
prefix and ".so" suffix. Therefore we don't need to make sure the prefix
and suffix exists.

Bug: 31742855
Test: Attempt to link android.hardware.* (hardware/interfaces/*)
Change-Id: I38555014cdc0e430f94359e173bb09e35d45c44e
2016-09-28 20:58:38 -07:00
Dan Willemsen
b3454ab24d Add export_generated_headers
Similar to export_shared_library_headers, this will export headers
imported from a gensrcs or genrule.

Bug: 31742855
Test: Add export_generated_headers, ensure it's in out/soong/Android-*.mk
Change-Id: Ieadefd007ece8b249f011a258a9c5b27f5d3f594
2016-09-28 18:31:04 -07:00
Dan Willemsen
4aa75ca244 Expose HostToolPath on the cc module to fix genrule.tool
Bug: 31742855
Test: Use `tool` in a genrule, ensure it runs properly.
Change-Id: Ib9ff35125edd66cdba8ede4f28aa6b753de0689b
2016-09-28 17:38:02 -07:00
Stephen Hines
fdab996f64 Switch to using clang-3289846.
Bug: http://b/30252254
Test: Built/boot platform using latest prebuilts.
Change-Id: I47c5e8255f84b6f41d1d3e1f3c986e8699ac573a
2016-09-28 08:52:48 -07:00
Colin Cross
81b4ca6817 Revert "Revert "Move system/core/include from -isystem to -I""
This reverts commit 763a26cef5.

Bug: 31492149
Change-Id: I322f5e31da306951ac13131f5113730e945dedd5
2016-09-23 19:20:54 +00:00
Colin Cross
763a26cef5 Revert "Move system/core/include from -isystem to -I"
This reverts commit e4bba1e835.

Bug: 31492149
Change-Id: If46d240274f1a59ac36579157c575b54f2ffd58f
2016-09-23 15:50:14 +00:00
Colin Cross
e4bba1e835 Move system/core/include from -isystem to -I
-isystem hides all warnings.  The warnings in system/core/include have
been cleaned up, so move it from -isystem to -I.

Test: lunch aosp_angler-eng && m -j
Test: lunch aosp_bullhead-eng && m -j
Test: lunch aosp_flounder-eng && m -j
Test: lunch aosp_fugu-eng && m -j
Test: lunch aosp_shamu-eng && m -j
Bug: 31492149
Change-Id: I29967428c2c45f753dabe21b65913fb08fdcabc4
2016-09-22 15:29:50 -07:00
Kenny Root
b912349c03 Add pthread to Windows allowed ldlibs
The MinGW update now includes pthread.

Test: update BoringSSL to use pthreads on Windows and compile
Change-Id: Id85d9fd3e03a310e07e0093ca80cefaf10fe8930
2016-09-20 14:49:33 -07:00
Colin Cross
b0f28957ae Support mixed ASAN and non-ASAN host builds
Host builds may build binaries that must have ASAN disabled.  Convert
host ASAN to use variants.  Since there is only one install location for
shared libraries, don't install the non-ASAN variant at all for now.

Test: mmma -j art SANITIZE_HOST=address
Change-Id: Iacefecac93df44823316624b4c540c24f643fb80
2016-09-19 16:50:35 -07:00
Colin Cross
f09c8437f9 Make ndk.timestamp optional
Singleton rules need to manually specify Optional: true, or they will be
built for any ninja invocation that has no targets specified.

Test: m -j on tradefed build
Change-Id: Ifc060b25bc32e664c48731eb8a0d963b73574591
2016-09-16 12:53:59 -07:00
Treehugger Robot
702b561ee5 Merge changes from topics 'ndk-libc++-libdl', 'ndk-compiler-rt_extras'
* changes:
  Always link libdl with libc++ for the NDK.
  Use libcompiler-rt_extras with NDK builds.
2016-09-16 06:40:32 +00:00
Colin Cross
0e19618906 Merge "Improve test support for art tests" 2016-09-15 21:47:07 +00:00
Colin Cross
1cfd89aca3 Split CommonGlobalIncludes for system includes
Split CommonGlobalSystemIncludes out of CommonGlobalIncludes in
preparation for moving global includes from -isystem to -I.

Bug: 31492149
Change-Id: Ib935ea038cdbf9515dc2ab68d7fff924c370906a
2016-09-15 09:33:57 -07:00
Treehugger Robot
98e7e66cb6 Merge "Sort NDK_MIGRATED_LIBS in make_vars" 2016-09-15 05:18:04 +00:00
Dan Willemsen
394e9dc876 Add Relocation Packer support
This only applies to shared libraries on the device, and like stripping,
we'll let make do the actual packing if we're embedded in Make.

Change-Id: I1585d74ecfc41e18dcbb5ffb70005adf007cc941
2016-09-15 03:39:05 +00:00
Dan Willemsen
65905f8f62 Sort NDK_MIGRATED_LIBS in make_vars
Otherwise this was changing every time, and causing Kati to find
make_vars-*.mk different every time.

Test: with https://android-review.googlesource.com/274439
Change-Id: I731b3b2fd434314bf6e8b7c2ec5310b9623512a5
2016-09-14 20:29:05 -07:00
Dan Albert
3895d5b246 Always link libdl with libc++ for the NDK.
Soong change to match
https://android-review.googlesource.com/#/c/274447/.

Test: make checkbuild tests
Bug: None
Change-Id: I25bfed6d99b97c406f40892ae4abc38f4e656e81
2016-09-14 16:50:48 -07:00
Dan Albert
83705c88d7 Use libcompiler-rt_extras with NDK builds.
Soong change to match
https://android-review.googlesource.com/#/c/274448/.

Test: make checkbuild tests
Bug: None
Change-Id: Ibc3732ce5b4a43a9151dca39a53572d248f86c45
2016-09-14 16:47:18 -07:00
Dan Willemsen
391cdde1da Remove extra LOCAL_CXX_STL := none
This was always being set in cc.Module.AndroidMk(), so we don't need to
declare it again. This was causing problems for cc_binary modules that
were using the NDK, since LOCAL_NDK_STL_VARIANT must be used instead.

Test: Manually put ifneq ($(LOCAL_CXX_STL),none); $(error) checks
Change-Id: If937b7b5ad30936e08c99f62ccf83b78d196dbfe
2016-09-14 16:12:29 -07:00
Colin Cross
600c9dfe7b Improve test support for art tests
Make gtest property a *bool so it can be overriden by defaults.
Make per-test install directory come after relative_install_path
property.

Change-Id: I2da38965c99c40415a39bf97b706b2d40bb082d6
2016-09-14 13:24:19 -07:00
Dan Willemsen
76ef5abd9a Fix lex/yacc path
Test: It no longer panics when there is a .yy/.ll file to build
Change-Id: I15c17d0df9449eabbede5d8afef955156baaba3d
2016-09-13 16:57:15 -07:00
Colin Cross
b4ce0ecad6 Remove cc.Customizer
Remove cc.Customizer, its functionality has been replaced by
android.PropertyCustomizer, and it is not used.

Change-Id: Ice32d554015b0800707bc042b187984f73df7979
2016-09-13 13:44:56 -07:00
Colin Cross
8b74d17220 Fix binaries and symlinks for prefer32
Track the primary architecture selected for each class based on the
module's multilib setting and the global config.  Fixes building
binaries with multlib set to first and DevicePrefer32BitExecutables set,
and fixes symlinks to binaries with multilib set to prefer32.

Bug: 31452121
Test: mmma -j art HOST_PREFER_32_BIT=true
Change-Id: I75094df42f3273f6d613e4058eaa565957174c28
2016-09-13 10:01:45 -07:00
Dan Willemsen
b1957a5021 Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.

Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
2016-09-08 13:50:36 -07:00
Colin Cross
42d1ba2d92 Add -z to valid multi-word linker flags
Art uses -z muldefs, allow it to be passed as a property.

Change-Id: Ief3b252d4b84762dbd49766ecdbebe00b333f523
2016-09-07 13:15:25 -07:00
Colin Cross
522e373a22 Allow CustomizeProperties to override linker
Allow CustomizeProperties to override the dynamic linker by setting a
DynamicLinker property.  Needed by art, which overrides the linker for
device-on-host testing.

Change-Id: Ia4cb5a85b9a995d8138da33eb13543addf3b38cc
2016-09-07 13:14:06 -07:00