Commit graph

2655 commits

Author SHA1 Message Date
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
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
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
e5d3ef4cc8 Merge "Don't apply sanitizer mutators to host modules." 2017-08-10 23:49:25 +00:00
Jeff Gaston
7943aebaa2 Merge changes Ib63e8e10,I9f730316
* changes:
  Darwin support for Finder
  Revert "Revert "Cacheable, multithreaded finder.""
2017-08-10 22:59:16 +00:00
Jeff Gaston
9f6da315aa Darwin support for Finder
Bug: 62455338

Test: m -j # while on Mac

Change-Id: Ib63e8e10bddcb3b507878364218273e8a5a8aa82
2017-08-10 14:22:16 -07:00
Jeff Gaston
f1fd45e784 Revert "Revert "Cacheable, multithreaded finder.""
Bug: 62455338
Test: m -j

This reverts commit d1abeb9d98.

Change-Id: I9f73031636157511b5f1c6ce8a205e9bc91669ff
2017-08-10 12:20:30 -07:00
Vishwath Mohan
bba1927bde Don't apply sanitizer mutators to host modules.
This CL blocks modules intended for the host from having the bottom up
sanitizer mutator applied. We only maintain a single copy of host
binaries, so generating variants doesn't make sense
anyway. Additionally, the existing logic was causing an error with
builds not embedded in make (eg: aosp-build-tools which uses
soong_ui.bash) where the wrong variant was installed on the host. This
change should fix that.

Bug: 64536751
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Test: aosp-build-tools build breakage is fixed.
Change-Id: Ia79b4661f69ce26a7be17c4339c18ca0f397d760
2017-08-10 11:05:00 -07:00
Jiyong Park
d5b18a55bb List of VNDK-related libs are exported to make
LL-NDK, VNDK-core, VNDK-SP libraries are exported to make as
SOONG_LLNDK_LIBRARIES, SOONG_VNDK_CORE_LIBRARIES, and
SOONG_VNDK_SAMEPROCESS_LIBRARIES. This can be used to auto-generate
ld.config.txt from a template.

Bug: 64013660
Test: BOARD_VNDK_VERSION=current m -j successful
Test: check out/soong/make_vars*.mk and look for SOONG_*_LIBRARIES

Merged-In: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
Change-Id: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
2017-08-10 14:15:39 +09:00
Vishwath Mohan
46c6a171aa Merge "Fix ASAN mutator." 2017-08-10 02:42:31 +00:00
Jeff Gaston
c3f32070dc Merge "Revert "Cacheable, multithreaded finder."" 2017-08-10 01:21:09 +00:00
Jeff Gaston
d1abeb9d98 Revert "Cacheable, multithreaded finder."
This reverts commit b6d161bf16.

Reason for revert: New Build Breakage: aosp-master/sdk_mac @ 4260825

Change-Id: I8bda8c50c5e5c9f84621d11a4c15b168833bcd21
2017-08-10 01:16:34 +00:00
Vishwath Mohan
12758d0cec Fix ASAN mutator.
This CL fixes a bug in the ASAN top down mutator which was incorrectly
checking (and setting) SanitizeDep to true only for the parent module
and not for the visited child modules.

Fixing this also requires some changes to the variant creation logic
to ensure that the correct variant is passed to make for
installation. This will eventually be replaced by logic that appends
an appropriate suffix to sanitized libraries (eg: libc++.asan), which
will allow both variants to be passed to make.

Bug: 64536751
Test: m -j40 && SANITIZE_TARGET="address" m -j40
Change-Id: Id5e5a5946192adf07418dd433bca503047177007
2017-08-09 16:58:36 -07:00
Jeff Gaston
c17e048bad Merge "Cacheable, multithreaded finder." 2017-08-09 22:18:13 +00:00
Jeff Gaston
ccb58c1eb3 Merge "Move build system documentation" 2017-08-09 22:17:43 +00:00
Jeff Gaston
9ec0117915 Merge "Point root.bp at build/make/tools instead of build/tools" 2017-08-09 19:43:40 +00:00
Jeff Gaston
df4a081292 Move build system documentation
Bug: 62201421

Test: make help
Change-Id: I7d7b448d3f736e171ebfbdceee46eef7de748742
2017-08-09 19:40:01 +00:00
Dan Willemsen
e0879fc3ae Add --skip-make to replace Soong's blueprint wrapper with soong_ui
This way we only have one way to start a build, which always has logging
/ tracing / etc, even if we don't need Kati.

There's two ways to use this:

As a direct replacement for mkdir out; cd out; ../bootstrap.bash;
./soong -- as long as --skip-make is always passed, we'll never run
Kati, and Soong will run outside of it's "make" mode. This preserves
most of the speed, and allows full user control over the Soong
configuration.

A (experimental, dangerous) way to temporarily bypass the product
variable and kati steps of a build. As long as a user is sure that
nothing has changed from the last build, and they know exactly which
Ninja targets they want to build (which may not be the same as the
arguments normally passed to 'm'), this can lead to shorter build
startup times.

Test: rm -rf out; m --skip-make libc
Test: rm -rf out; m libc; m --skip-make libc
Test: rm -rf out; mkdir out; cd out; ../bootstrap.bash; ./soong libc
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: Ic0f91167b5779dba3f248a379fbaac67a75a946e
2017-08-08 22:49:28 -07:00
Colin Cross
8d6aed7ed7 Merge "Copy prebuilt binaries" 2017-08-09 02:50:54 +00:00
Jeff Gaston
c466cce948 Point root.bp at build/make/tools instead of build/tools
Bug: 64397960
Test: m -j
Change-Id: Iac06584b871634f59a7d1a15c743ec8e4901a5d0
2017-08-08 17:46:14 -07:00
Colin Cross
94921e78df Copy prebuilt binaries
The final name of the prebuilt binary is going to match the basename
of the return value of link(), so copy the binary to the intermediates
directory to a file name that honors the name and stem properties of
the module.

Test: manual
Change-Id: Ieed4df79b11382924ca0be8e940d3279b45f748a
2017-08-08 16:23:32 -07:00
Jeff Gaston
b6d161bf16 Cacheable, multithreaded finder.
It can find every Android.bp in internal master in
about 2.5 sec the first time and 0.3 sec subsequent times

Bug: 62455338

Test: m -j blueprint_tools # which runs the unit tests

Test: m -j blueprint_tools && \
  out/soong/host/linux-x86/bin/finder \
    -v
    --db /tmp/mydb \
    --names Android.mk \
    --prune-files .android-out-dir \
    --exclude-dirs .git,.repo \
    . \
    >/tmp/finder-log 2>&1

Change-Id: I5ab2650459a1dae0d5d076faf411ec2d053c743d
2017-08-08 14:19:55 -07:00
Treehugger Robot
998d9eb6b9 Merge "Allow vndk library dependecies to dump abi again." 2017-08-08 18:08:02 +00:00
Jayant Chowdhary
2a96640335 Allow vndk library dependecies to dump abi again.
As a part of the fix for bug 38304436, the condition for dumping abi for
a source file was reduced to : if the source file belongs to a library
belonging the vndk or the llndk, dump the abi. This needs to be changed back to:
if the source file comes through a dependency of a vndk library (static,
whole static or source), whether or not the dependency may be vndk-enabled, dump
the abi.

Test: mm -j64 in external/libcxx.
Without the change, libc++ does not produce any abi dump, since it
depends on whole static libraries not marked vndk enabled. After the
change, libc++ has an abi dump combining abi exposed by whole static,
static and source dependencies.

Bug: 38304436

Change-Id: Ida3dceeca11342756191f316bee74ea08bcdd984
2017-08-08 18:06:09 +00:00
Treehugger Robot
ec0aca3a84 Merge changes I047d103b,I35de5d93,I3327d275
* changes:
  Add prebuilts/misc to root.bp
  Export java modules to make
  Fix java prebuilts
2017-08-08 04:38:45 +00:00
Dan Albert
59034511c5 Pass Platform_version_all_codenames to NDK build.
We're still only generating the released versions and "current" when
we build with build-ndk-prebuilts.sh. Pass
Platform_version_all_codenames from make to generate the in-progress
platform versions as well.

Also move this over to soong.variables, since that's the appropriate
place for them. The Platform_sdk_version we were passing wasn't
actually being used before.

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

Change-Id: Iccb709f5c12309754073ac8f0d4bc365019dfcd3
2017-08-03 14:33:26 -07:00
Dan Albert
31384debd7 Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
Don't preserve the confusing names from make. Rename AllCodenames to
ActiveCodenames, add FutureCodenames, and add CombinedCodenames to
fetch the *real* AllCodenames.

To allow `introduced=P` in NDK library definitions, we need to know
that P exists. Use the combined list of current and future API
codenames generating stubs.

Test: make ndk
Test: check out/soong/api_levels.json
Bug: None
Change-Id: I435f9ce7446236edc268a84e33474044a55a6302
2017-08-02 17:14:10 -07:00
Colin Cross
b3af348dc0 Add prebuilts/misc to root.bp
Test: manual
Change-Id: I047d103b7df9e93923908cb0b84084eb016f20a4
2017-08-01 16:18:11 -07:00
Treehugger Robot
bbe3ff4c50 Merge changes from topic 'ndk-weak-stubs'
* changes:
  Add NDK API codenames for old releases.
  Add support for weak symbols in the NDK stubs.
2017-08-01 23:11:12 +00:00
Colin Cross
44bc7456e2 Export java modules to make
Export java modules as prebuilts to makefiles.

Test: manual
Change-Id: I35de5d9398245beff4492c8c7be76251d7a175b1
2017-08-01 16:06:43 -07:00
Colin Cross
5ea9bcc50b Fix java prebuilts
The java prebuilt tests weren't registering the prebuilts mutators,
which hid an issue where prebuilts modules weren't getting renamed
to avoid collisions with source modules of the same name, which
ended up causing the prebuilt module to try to add a dependency
on itself.

Test: java_test.go
Change-Id: I3327d27533591cb08a4b8b8b5e1668a6f72be8df
2017-07-31 23:50:01 -07:00
Treehugger Robot
ed2c78ef4e Merge "Add support for Exynos-M1" 2017-08-01 01:00:37 +00:00
Dan Albert
151027107d Add NDK API codenames for old releases.
Without these, we'd need to go rewrite all the stub templates to stop
using the codename and use the number instead whenever an API is
released.

Test: changed something in libc to use introduced=L, make ndk
Bug: None
Change-Id: I1b8703655664c567f8a5c36219e73f11ba27d99a
2017-07-28 12:31:28 -07:00
Dan Albert
f55f0787a7 Add support for weak symbols in the NDK stubs.
Test: nose2
Bug: None
Change-Id: I202f718103f4a645b1eb83c0a9f5313bcdb4d485
2017-07-28 11:00:22 -07:00
Treehugger Robot
074a5d35bf Merge "Delete output files before copying to them." 2017-07-27 01:53:56 +00:00
Treehugger Robot
9ccbabc1ea Merge "Map cpp_std c++17/gnu++17 to 1z." 2017-07-27 00:20:16 +00:00
Jiyong Park
27b188bc86 .vendor suffix is added only for libs having core/vendor variants
When the lib is vendor-only, then .vendor suffix is not added.
Furthermore, this change correctly adds .vendor suffix even to the names
listed in LOCAL_SHARED_LIBRARIES so that we don't need to add the suffix
in the make world.

This also allows us to use the original name (without the .vendor
suffix) of the vendor-only modules in make (e.g. in PRODUCT_PACKAGES or
as a make target).

Bug: 37480243
Test: BOARD_VNDK_VERSION=current m -j <name> is successful, where <name>
is one of the vendor-only libraries in Soong. (i.e.
android.hardware.renderscript@1.0-impl)
Test: m -j does not break anything

Change-Id: I203e546ff941878a40c5e7cfbb9f70b617df272d
2017-07-27 08:54:52 +09:00
Josh Gao
ae15271392 Delete output files before copying to them.
Avoid ETXTBSY when copying over a file that's being executed.

Test: manual
Test: m -j
Change-Id: I0427b5018e67e12f685bce95028831b5661eee2c
2017-07-26 15:38:40 -07:00
Josh Gao
f5720175dd Map cpp_std c++17/gnu++17 to 1z.
C++17 is basically done, but not rubber stamped yet. Rewrite c++17 and
gnu++17 to their 1z equivalents until this happens, and we get a
version of clang that allows it.

Test: mma in a project with cpp_std c++17
Change-Id: I1626c366c3a9b47c997cc27dc9c5205201ebbdf5
2017-07-26 15:13:50 -07:00
Justin Yun
4b2382f78e Allow 'vndk' tag in cc_defaults
'vndk' tag must be parsed in cc_defaults as well.

Test: build with a module that has 'vndk' tag in cc_defaults.
Change-Id: I21a5a831dbf8cae00be98c00f4bb98504da53c8d
2017-07-26 07:24:29 +00:00
Treehugger Robot
98be5836de Merge "Remove java version checks" 2017-07-25 19:55:48 +00:00
Colin Cross
adc0e17019 Merge "Enable ubsan check flag in build" 2017-07-25 17:48:06 +00:00
Dan Willemsen
05f17764c3 Use a unified ninja builddir
Instead of calling SetNinjaBuildDir, pass it to bootstrap.bash, so that
the bootstrap package can set it consistently during bootstrapping and
normal execution.

Bug: 63720725
Test: m -j nothing
Test: mkdir o; ../bootstrap.bash; ./soong
Change-Id: Ica88d2d5f1461b5be49bfe6316c6ec4ef4d89d49
2017-07-24 15:58:20 -07:00