Commit graph

3951 commits

Author SHA1 Message Date
Jeff Gaston
743e29ee7c Fix Finder out path in multiproduct_kati
Bug: 64363847
Test: ./build/soong/build_test.bash --dist --keep
Change-Id: I70b08023b94b5789dc8394651bbac4c49c82787f
2017-08-17 14:17:14 -07:00
Jeff Gaston
8c47358417 Merge "Run the Finder and make its results available to Kati"
am: 8cd393688b

Change-Id: I588da94c0f8f21e6fdd2e140b8bf0e5064b65935
2017-08-17 19:48:38 +00:00
Jeff Gaston
8cd393688b Merge "Run the Finder and make its results available to Kati" 2017-08-17 19:40:56 +00:00
Jeff Gaston
7894cbc287 Merge "Refactor rate_limit.go for more clarify"
am: b90afd09d6

Change-Id: I5405c203be4d63bc07ec5bd34cdf9e1e6079e7be
2017-08-17 01:40:13 +00:00
Jeff Gaston
b90afd09d6 Merge "Refactor rate_limit.go for more clarify" 2017-08-17 01:31:21 +00:00
Colin Cross
7d08ced0d1 Merge "Export jar-args.sh script to make"
am: 8a55ec317d

Change-Id: I624dedaec652b167a75afdd39f9fa651fb8bb4be
2017-08-17 01:00:16 +00:00
Treehugger Robot
8a55ec317d Merge "Export jar-args.sh script to make" 2017-08-17 00:48:37 +00:00
Jeff Gaston
69f3b3e946 Refactor rate_limit.go for more clarify
This wasn't intended to change the behavior, but it does slightly.

  Previously any requests to acquire memory wouldn't block; only
  (subsequent) requests for execution would block (if another
  caller had already consumed the memory quota). Now the requests
  for memory can also also block.

It turns out in a brief test on my computer that soong_zip
runs about 10 to 20% faster with this change than without it.

  The final step involving soong_zip decreased from about
  3.6 sec to about 3.3 sec in tests on my computer.

  When testing the process of re-zipping the contents of
  angler-target_files*.zip , the time decreased from about
  6.3 sec to about 5.3 sec in tests on my computer, and the
  peak memory usage reported by `top` decreased from about
  1.5g to 1g

Bug: 64536066
Test: m -j dist showcommands # which runs soong_zip to package everything
Change-Id: I0422e4c363c675bb7a93309fac4616c768bfbe8f
2017-08-16 15:54:25 -07:00
Jeff Gaston
b64fc1cab5 Run the Finder and make its results available to Kati
The Finder runs roughly 200ms faster than findleaves.py in aosp,
and runs roughly 400ms faster in internal master.

Bug: 64363847
Test: m -j

Change-Id: I62db8dacc90871e913576fe2443021fb1749a483
2017-08-16 14:56:00 -07:00
Jeff Gaston
a873c44722 Merge "Have soong_zip add entries for ancestor directories"
am: 16c04e0621

Change-Id: Iaf29cb3adc27ca4450abd52fa9336831ef7535a3
2017-08-16 19:58:55 +00:00
Jeff Gaston
16c04e0621 Merge "Have soong_zip add entries for ancestor directories" 2017-08-16 19:41:27 +00:00
Jeff Gaston
5e13d9d527 Merge "Fail the Finder in case of unexpected fs error"
am: cefa501304

Change-Id: Ia3064ec9c158f6d34428a0de3ee4a4ad0d4f01b3
2017-08-16 02:17:15 +00:00
Treehugger Robot
cefa501304 Merge "Fail the Finder in case of unexpected fs error" 2017-08-16 02:08:34 +00:00
Jeff Gaston
2d174132c4 Have soong_zip add entries for ancestor directories
Bug: 64536066

Test: When I run:

$ mkdir -p a/b/c
$ touch a/b/c/d
$ soong_zip -o test.zip -d -C . -f a/b/c/d
$ zipinfo -1 test.zip
a/b/c/
a/b/c/d

I should get:
a/
a/b/
a/b/c/
a/b/c/d

Change-Id: I779bb48062dfaf88a70fab08d8d98d1e366087b3
2017-08-15 18:57:39 -07:00
Colin Cross
4da8e311d8 Merge changes I18acac41,Ib8baefed,I38e78bb9
am: 972a160062

Change-Id: I829fd57bdee32e2f151b971985308c6e171461aa
2017-08-16 00:25:04 +00:00
Colin Cross
972a160062 Merge changes I18acac41,Ib8baefed,I38e78bb9
* changes:
  Work around LLVM bug where TLS not emulated in LTO mode
  Add LTO support to soong
  Pass correct emulation string to gold
2017-08-16 00:13:00 +00:00
Jeff Gaston
5895aea53a androidmk no longer escaping escaped quotes in CFLAGS
am: fd4ce1bb68

Change-Id: I884a50bd8d8053747ab5ff23d6e2671b3e983450
2017-08-16 00:04:01 +00:00
Jeff Gaston
fd4ce1bb68 androidmk no longer escaping escaped quotes in CFLAGS
Bug: 37547491
Test: m -j

Change-Id: I2f406be477f3990bf109778eb9adc9c33db2f2ad
2017-08-15 22:05:39 +00:00
Colin Cross
ded8a97c32 Export jar-args.sh script to make
Export jar-args.sh in JAR_ARGS so that make doesn't have to
duplicate the sed scripts.

Test: m -j checkbuild
Bug: 64634025
Change-Id: Ia5d0a303f23b32b8ff672fc882d51d5e99316ffa
2017-08-15 14:29:04 -07:00
Jeff Gaston
b629e184dd Fail the Finder in case of unexpected fs error
Permissions errors are ignored
Errors on pruned dirs are also ignored

Bug: 62455338
Test: m -j blueprint_tools # which runs unit tests
Change-Id: I8ba85fdd0295deb7dc374a851212e7c850e76b75
2017-08-15 13:18:24 -07:00
Stephen Crane
f5b9b95f01 Work around LLVM bug where TLS not emulated in LTO mode
In LTO mode the backend constructs a target exclusively from command line flags,
without opportunity to accept code gen arguments from Clang. Clang does not
currently pass the -emulated-tls parameter for Android, even though it defaults
to emulated TLS for Android in non-LTO builds. Until this is fixed upstream, we
can explicitly specify that the LTO output for Android should use emulated TLS.

Test: build libandroid with LTO, verified that it uses __emutls_get_address
rather than __tls_get_addr.

Change-Id: I18acac41aac885fc6635fbd55f96ba7c845eb5e7
2017-08-15 13:18:11 -07:00
Stephen Crane
ba090d16c2 Add LTO support to soong
Enabling the lto property for a module builds that module and all static
dependencies with LTO.

LTO (link-time optimization) allows the compiler to optimize and
generate code for the entire module at link time, rather than
per-compilation unit. LTO is required for Clang CFI and other
whole-program optimization techniques. LTO also allows cross-compilation
unit optimizations that should result in faster and smaller code, at the
expense of additional compilation time.

Test: make -j12 libc with lto: true for libc

Change-Id: Ib8baefedf60e02701d44673a7c473e0845730101
2017-08-15 12:54:12 -07:00
Stephen Crane
b3c2154f2a Pass correct emulation string to gold
Gold recognizes a different set of emulation strings to specify targets
than the bfd linker accepts. Clang only passes bfd emulations to the
linker, so we need to override these with the versions accepted by gold
when using gold.

Gold normally picks up the correct target from the first ELF input file
if it cannot parse the emulation parameter. However when using LTO, all
objects may be bitcode files, which causes gold to rely on the passed
--oformat or -m parameter to determine the proper target. If gold cannot
parse the emulation string passed by clang, it fails to link.

Test: build LTO version of libc

Change-Id: I38e78bb912fd3cc5fb7b4a762284f50ddd4f3998
2017-08-15 12:54:12 -07:00
Colin Cross
776c7730b4 Merge "Convert soong java from soong_zip to jar"
am: 38d3d5d2e5

Change-Id: Ifcd0bd4d69bf466bdc288a6aeb64e74b4351d05f
2017-08-14 22:41:18 +00:00
Treehugger Robot
38d3d5d2e5 Merge "Convert soong java from soong_zip to jar" 2017-08-14 22:35:03 +00:00
Colin Cross
4691dabe61 Merge "Install java_binary wrappers in make"
am: 1d15c37766

Change-Id: I2da7205c5292410eafd8c5a351ea1269c1645d23
2017-08-14 22:24:46 +00:00
Treehugger Robot
1d15c37766 Merge "Install java_binary wrappers in make" 2017-08-14 22:12:39 +00:00
Colin Cross
b852a58aa6 Convert soong java from soong_zip to jar
soong_zip produces jar files that are not compatible with java's
ZipInputStream.  Switch to jar using ugly sed scripts to munge
file lists into the alternating -C and file arguments required
by jar.

Bug: 64536066
Test: m -j checkbuild
Test: build/soong/scripts/jar_args.sh --test
Change-Id: Ifcc4bdab25e7d02342720eb246c673ff9a58bddb
2017-08-14 10:07:53 -07:00
Jiyong Park
6f57678794 cflags for vendor variants
am: a622de8498

Change-Id: I57c11adabc997370684f752f5277e0f27e204151
2017-08-14 06:18:19 +00:00
Jiyong Park
7ec30dbd55 a shared lib header is not exported to vendors if it is in exclude_shared_libs
am: 7447228e64

Change-Id: I2031a30cf0db94ad2317cba07e81ff2d2295bca8
2017-08-14 03:54:11 +00:00
Jiyong Park
a622de8498 cflags for vendor variants
cflags that are only applied when building the vendor variant of a lib
is now supported. This will be particularily useful when existing macro
should be turned off for the vendor variant:

cflags: ["-DENABLE_FEATURE_X"],

target: {
    vendor: {
        cflags: ["-UENABLE_FEATURE_X"],
    },
},

Without this, the library author has to undef the macro inside the
source code using __ANDROID_VNDK__, which is not desired especially for
external projects.

Bug: 64514237
Test: BOARD_VNDK_VERSION=current m -j libsqlite libsqlite.vendor
Merged-In: Ib484b5b12e14ab776276a30ed2763dffadc9d642
Change-Id: Ib484b5b12e14ab776276a30ed2763dffadc9d642
(cherry picked from commit 1e7495d973)
2017-08-14 11:46:42 +09:00
Jiyong Park
7447228e64 a shared lib header is not exported to vendors if it is in exclude_shared_libs
Since a lib in exclude_shared_libs are not used for the vendor variant,
it should also be removed from the export_shared_lib_headers.

Bug: 62471389
Test: BOARD_VNDK_VERSION=current m -j libxml2.vendor successful
(libxml2 has libicuuc in both exported_shared_lib_headers and
exclude_shared_libs for the vendor variant)

Merged-In: Ic9ddbd7be3c76df563e428ba2409a03bd2e1e113
Change-Id: Ic9ddbd7be3c76df563e428ba2409a03bd2e1e113
2017-08-14 11:40:54 +09:00
Colin Cross
10a0349d98 Install java_binary wrappers in make
Convert java_binary modules into two make modules, one for the
underlying java_library and one for the wrapper prebuilt.

Test: m -j checkbuild
Change-Id: I5ddf74f24f1e41fc1f39b3e8d254b7e191dbd47a
2017-08-11 22:22:48 -07:00
Colin Cross
07b79f21dd Merge changes Id9717132,I3e3b7251,I021c7971,I8a117a86,Ia5196f1f, ...
am: b8245ea839

Change-Id: I9cd28715891eb9bbd6e0d1a3e0a3e83da2d1d00f
2017-08-12 01:19:58 +00:00
Treehugger Robot
b8245ea839 Merge changes Id9717132,I3e3b7251,I021c7971,I8a117a86,Ia5196f1f, ...
* changes:
  Allow AndroidMkData.Custom handlers to extend normal values
  Remove error from AndroidMkDataProvider.AndroidMk
  Remove error from AndroidMkData.Custom
  Remove error from AndroidMkData.Extra
  Bring java support closer to current version of make
  Rename java_prebuilt_library to java_import
2017-08-12 01:11:59 +00:00
Colin Cross
80ce6b2b73 Use --hash-style=both for NDK binaries
am: 6774e2893a

Change-Id: I0a320191adae93e0d7f7f8e37e838a9426755fff
2017-08-11 23:58:53 +00:00
Colin Cross
0f86d186b1 Allow AndroidMkData.Custom handlers to extend normal values
Pass accumulated AndroidMkData to AndroidMkData.Custom handlers
and expose WriteAndroidMkData so that Custom handlers can write
out the normal make variables and then add their own.

Test: No change to out/soong/Android-aosp_sailfish.mk
Change-Id: Id9717132bbd6c5cf3af8596f3eaa9bbb05d98e40
2017-08-11 15:24:11 -07:00
Colin Cross
a18e9cfa29 Remove error from AndroidMkDataProvider.AndroidMk
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808
2017-08-11 15:24:11 -07:00
Colin Cross
91825d2279 Remove error from AndroidMkData.Custom
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I021c7971ede3e11bbe08cf1601f4690ed4d1a036
2017-08-11 15:24:11 -07:00
Colin Cross
27a4b05441 Remove error from AndroidMkData.Extra
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I8a117a86aa39aeb07d9d8d0686ef869c52784f19
2017-08-11 15:24:11 -07:00
Colin Cross
6416271a1f Bring java support closer to current version of make
Make the javac arguments match what is used by make, and export them
back to make.  A future change will switch make to use the the
exported ones.

This makes a dx.jar compiled with soong have identical class files
as one compiled with make.

Test: manual
Change-Id: Ia5196f1f42bc564e99de22e32e72fd2930e9fbae
2017-08-11 15:24:11 -07:00
Colin Cross
74d73e2bfb Rename java_prebuilt_library to java_import
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.

Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
2017-08-11 15:24:11 -07:00
Colin Cross
6774e2893a Use --hash-style=both for NDK binaries
Old devices don't support gnu hashes, use --hash-style=both when
the sdk_version property is set.

Test: m -j checkbuild
Bug: 64608507
Change-Id: Iec5229a08fc192f1c8872466ee4bf866adf50443
2017-08-11 22:21:39 +00:00
Vishwath Mohan
866abe518b Merge changes from topic 'revert_mutator_changes'
am: c4cab48c26

Change-Id: I220d38b2ce5aa54ef5ebf3c7b89cf3189c13d471
2017-08-11 14:51:52 +00:00
Vishwath Mohan
c4cab48c26 Merge changes from topic 'revert_mutator_changes'
* changes:
  Revert "Fix ASAN mutator."
  Revert "Don't apply sanitizer mutators to host modules."
2017-08-11 14:47:17 +00:00
Jiyong Park
e78c43584e Merge "List of VNDK-related libs are exported to make"
am: c5d3abf107  -s ours

Change-Id: I06590b4318fc567a243738d5229ebe7374f04914
2017-08-11 02:17:49 +00:00
Treehugger Robot
c5d3abf107 Merge "List of VNDK-related libs are exported to make" 2017-08-11 01:38:15 +00:00
Vishwath Mohan
952293044f Revert "Fix ASAN mutator."
This reverts commit 12758d0cec.

Change-Id: I475e63d7e56ff166c2046fc423a1729ed098ff66
2017-08-11 00:56:44 +00:00
Vishwath Mohan
e615345f28 Revert "Don't apply sanitizer mutators to host modules."
This reverts commit bba1927bde.

Change-Id: Ie895d8eae5abb533468b836639e0835e7adbf8c9
2017-08-11 00:52:44 +00:00
Vishwath Mohan
18b69e7cf4 Merge "Don't apply sanitizer mutators to host modules."
am: e5d3ef4cc8

Change-Id: If45d74d6be4c1817ae5f2a73e9b4e902d57e5c5c
2017-08-10 23:58:25 +00:00