Commit graph

8998 commits

Author SHA1 Message Date
Jiyong Park
9d45299ba4 Add ApexModule interface for APEX-aware modules
ApexModule is the interface for APEX-aware modules. The module type apex
uses the interface to get APEX-specific information from other modules,
such as the list of APEXs that a module should be built for.

A module that is included in an APEX will be built specificaly for the
APEX. This is especially required for shared libraries; we shouldn't
just copy the artifacts built for platform, because they may be linking
against private (=unstable) symbols that are not available to APEXs
which are basically unbundled.

This CL, as a first step, makes cc.Module an APEX-aware module type.

Bug: 112672359
Test: m apex.test; the built apex has all the direct and transitive
shared lib dependencies of the libs and executables listed in Android.bp

Change-Id: I21f6a586654779984f0f5154b2a08b2adbf2168b
2018-10-11 11:19:07 +09:00
Yi Kong
35e8e19cd8 Add an option for libraries to opt out of libcrt
am: 2c188bea78

Change-Id: Ic78a8733437f360d60e96431230df0f02577a865
2018-10-10 18:02:41 -07:00
Yi Kong
2c188bea78 Add an option for libraries to opt out of libcrt
Test: m checkbuild
Bug: 29275768
Change-Id: I9c0999ddc15ad152c47089509f91dc1dc901f7e4
2018-10-10 15:56:14 -07:00
Pirama Arumuga Nainar
8fd5a96959 Remove --allow-multiple-definitions for 32-bit Windows
Bug: http://b/109759970
Bug: http://b/91353691

There are no multiple-defintion errors after switching to clang-r339409
and libc++.

Test: m native-host-cross
Change-Id: I5576b3894ed1d88c9b2e5f4d92e1d3bfadfb029b
2018-10-10 20:10:15 +00:00
Pirama Arumuga Nainar
a403cc7254 Change STL for Windows to libc++.
- Stop including libstdc++ headers.
- '-pthread' and 'static-libgcc' are unused when we pass -nodefaultlibs.
We didn't pass -nodefaultlibs for libstdc++.
- Use SjLj exceptions for 32-bit.  libgcc_eh implements SjLj exception
model for 32-bit.
- Disable visibility annotations for libcxx and libcxxabi since we are
only going to support these as static libraries.
- Use Win32 threads.  MinGW pthreads throws an error when building
libcxx since it's pthread_mutex_initializer is not constant (needs a
cast).
- Link libgcc_eh, which needs pthread, which in turn depends on
kernel32.  Wrap the libraries with --start-group and --end-group and
remove duplicates.

Test: Build and test Windows binaries under Wine.

Change-Id: I8be51b004585e11ef51b7d5012f2a51330d1260f
2018-10-10 20:09:37 +00:00
Yi Kong
d871ae11f4 Merge "Revert "Revert "Move libgcc to libcrt.builtins"""
am: 38441856ca

Change-Id: If51950dbcef748b58a71cf72b8c2a8f67e7c5bc4
2018-10-10 12:33:56 -07:00
Treehugger Robot
38441856ca Merge "Revert "Revert "Move libgcc to libcrt.builtins""" 2018-10-10 19:08:04 +00:00
Pirama Arumuga Nainar
14b3cb0ab3 Switch to clang-r339409b
Bug: http://b/117499735

Test: clang-tools build, AOSP taimen build and TH
Change-Id: I9fada181e2cb85e65c66672f870b59e8da0be9ce
2018-10-10 18:38:11 +00:00
Neil Fuller
1fee9f3dd0 Include all core libs in default boot classpath
To migrate the default compilation over to using
"core platform api" stubs we need to make the "before"
state as close to the "after" state as possible.

The stubs will include all "core libraries" so it
makes sense to include those that contribute to the
"core platform api": okhttp, bouncycastle and conscrypt.

(apache-xml is not included because it doesn't contribute
to the core platform API).

After this change all explicit dependencies to okhttp,
bouncycastle and conscrypt in situations where the
default boot classpath is used can be removed.

A knock-on of this change is that the conscrypt, bouncycastle
and okhttp targets need to be adjusted to explicitly
depend on core-oj / core-libart with no_standard_libs: true
to avoid a cycle.

Bug: 113148576
Test: treehugger
Change-Id: I1677af8d9d48fd026874ebce4c864f39ec1a5a3d
2018-10-10 08:42:12 +00:00
Dan Willemsen
dc1b833df0 Remove GCC-specific toolchain methods
am: bd4abf5dfc

Change-Id: Iaea003158a8fddcd73eee1dcc2c7803687a15e71
2018-10-09 22:46:52 -07:00
Dan Willemsen
e9e20dd3e4 Remove perl from the allowed PATH tools list
This is no longer used within Android builds. We don't have any way of
providing extra libraries, or using a hermetic version of perl.

Bug: 117338567
Test: check build logs for the last 48 hours
Change-Id: I06d41a0006a47508a435dbf44bfccc4b385d9f41
2018-10-09 19:51:30 -07:00
Dan Willemsen
c44d620c52 Log uses of make and xmllint within the Android Build
am: 6afcd9aab9

Change-Id: I0f29796ddf387ef1c3edc234dfc32783a29dec81
2018-10-09 19:48:52 -07:00
Dan Willemsen
bd4abf5dfc Remove GCC-specific toolchain methods
Test: m
Change-Id: I06442347ade2d60bc42131b3126ecc17840c9e31
2018-10-09 19:44:54 -07:00
Inseob Kim
21f26907cc Add support for sysprop description files to c++
From now on, a c++ shared library can be built only with adding
".sysprop" description file to srcs. Sysprop library generator will
automatically generate a .cpp and .h files, and the header file will be
exposed to any clients linking against the shared library. For the full
schema of description file, see system/tools/sysprop/sysprop.proto.

Bug: 80125326
Test: 1) write a .sysprop description file.
2) create cc_library_shared and add description file to srcs.
3) create another module, link against library of 2), include generated
header, and access generated sysprop functions
4) see compile succeeded.

Change-Id: I95005a0724aeb8f11a856b7aee92787a16a5374d
2018-10-10 00:33:01 +00:00
Dan Willemsen
6afcd9aab9 Log uses of make and xmllint within the Android Build
Now that we've got prebuilts of make, turn on logging so that
we can find all the users and convert them to the prebuilt.

We also build xmllint as part of the tree, so log uses of that
too.

Test: treehugger
Change-Id: I8a6a5d481dfc709dc0eb3424c51430bc54763c1e
2018-10-09 23:57:45 +00:00
Dan Willemsen
6e9fe7c6ec Merge "Restore lld parts of "Remove cortex-a53 linker workaround for new cpus.""
am: 55e095b6d8

Change-Id: I8f9d87561e02ffbeb0aae0f9435ad971c9bc1e2f
2018-10-09 16:26:41 -07:00
Colin Cross
ecdbe4fac2 Merge "zip2zip: support included an excluded file"
am: 8bb0f530f7

Change-Id: I6f968cf1c87ed7604ad6a6eaf0292c0a84b855be
2018-10-09 16:19:45 -07:00
Colin Cross
3fcc5dea6f Merge "genrule: add $(location) for inputs and outputs"
am: f4465da1dc

Change-Id: I3c142b3234594d62b166c5411af60a1e69a094ee
2018-10-09 16:16:30 -07:00
Colin Cross
36cd70271d Merge changes from topic "soong_jni"
am: 08914b9c98

Change-Id: Ibd51eded5d2ca3afc01f49f4b4e1d3aa8d6d57a2
2018-10-09 15:51:34 -07:00
Treehugger Robot
55e095b6d8 Merge "Restore lld parts of "Remove cortex-a53 linker workaround for new cpus."" 2018-10-09 22:51:11 +00:00
Treehugger Robot
8bb0f530f7 Merge "zip2zip: support included an excluded file" 2018-10-09 22:35:26 +00:00
Colin Cross
f4465da1dc Merge "genrule: add $(location) for inputs and outputs" 2018-10-09 22:33:17 +00:00
Dan Albert
f5b8184abe Python 3 fix.
Test: nose2  # With python3 nose2
Bug: None
Change-Id: I84812c55be0daa58a594752702d866daf3c2d8f0
2018-10-09 15:22:15 -07:00
Treehugger Robot
08914b9c98 Merge changes from topic "soong_jni"
* changes:
  Add android_test_helper_app
  Add support for android_app_certificate modules
  Add support for JNI libraries to android_app modules
2018-10-09 21:50:40 +00:00
Dan Willemsen
e28663fb28 Restore lld parts of "Remove cortex-a53 linker workaround for new cpus."
https://android-review.googlesource.com/c/platform/build/soong/+/689585
added, but was skipped going into pi-dev-plus-aosp, as the pi-dev
version (which did not have these lld bits) was already merged there.
When pi-dev-plus-aosp was pushed to aosp-master, this got lost.

Merged-In is a random git_master change, since this needs to go
into pi-dev-plus-aosp too, but no further.

Bug: 78133793
Test: git diff aosp-master..master -- cc/config/arm64_device.go
Change-Id: Iea69a2c040d11249e43a76a78859944274ce6a92
Merged-In: I7799feac522a1097ec4271bd7868cd6bfe147ad9
2018-10-09 14:44:46 -07:00
Yi Kong
7df0f30785 Revert "Revert "Move libgcc to libcrt.builtins""
This reverts commit 6fb831bd56.

Bug: 29275768
Test: checkbuild and bionic native tests on arm/arm64/x86/x86_64
Change-Id: I774dea64a209dac673f927115b30170e5470db76
Merged-In: I774dea64a209dac673f927115b30170e5470db76
(cherry picked from commit 85e9ba15b5)
2018-10-09 20:39:50 +00:00
Colin Cross
3824771b2d zip2zip: support included an excluded file
Make needs to exclude all files that match a filespec except for
those specified in a list.  Add a -X argument that overrides the
-x argument to allow files be included that were previously
excluded.

Bug: 69500920
Test: zip2zip_test.go
Change-Id: Icc8aebc788b53bcdde73a39c9c7cf3107a049251
2018-10-09 17:48:16 +00:00
Ivan Lozano
8a33fadc1e Apply minimal runtime to the rest of ubsan.
am: ae6ae1d880

Change-Id: I379d342ade35afc5c17c3cb205eace470f7b3bc9
2018-10-09 08:17:27 -07:00
Ivan Lozano
ae6ae1d880 Apply minimal runtime to the rest of ubsan.
Make sure that the minimal runtime gets applied to the rest
of the sanitizers we might use from ubsan.

Bug: 80195448
Test: Build success and checked build flags.
Change-Id: I31b211b80bb1068c153a9b65454a2605933c9568
2018-10-09 08:05:27 -07:00
Dan Willemsen
5d7598005a Remove GCC checks
am: 8536d6b3b7

Change-Id: I1ba28f29238db813a683169a6113baea33095f4c
2018-10-08 19:34:53 -07:00
Dan Willemsen
8536d6b3b7 Remove GCC checks
Clang is always used now, so we can remove all the GCC checks. Removing
GCC-specific configuration will happen in the next CL.

Test: m
Change-Id: I4835ecf6062159315d0dfb07b098e60bff033a8a
2018-10-09 02:16:58 +00:00
Chih-Hung Hsieh
cfba3658f4 Merge "Add default -Wimplicit-fallthrough."
am: 230e4c77a5

Change-Id: I15e7cbf40722360d91cafc196e4a9a908338df56
2018-10-08 18:02:54 -07:00
Treehugger Robot
230e4c77a5 Merge "Add default -Wimplicit-fallthrough." 2018-10-09 00:46:21 +00:00
Colin Cross
e7d88f198b zip2zip: add flag to uncompress files
am: b1a5e9cadf

Change-Id: Iae3b2fb6faa706115128a4011b626f0391dd12b6
2018-10-08 17:37:48 -07:00
Colin Cross
0c86c8f289 Export cc module types and mutators needed for JNI testing
am: e40b4eaeb0

Change-Id: I45e1d3e4955bb363414366bff4d8364426b5807a
2018-10-08 17:37:30 -07:00
Colin Cross
15ee317ddb Add multi-target variants
am: ee0bc3b290

Change-Id: I2efe1510b2927721a8ea9d26efe6aa9eddd4a248
2018-10-08 17:36:58 -07:00
Colin Cross
08f15ab466 genrule: add $(location) for inputs and outputs
There was no way to select a single source file from a genrule that
has multiple source files.  Make Soong's genrule closer to Bazel
by supporting $(location) for input and outputs.  Change the
label used for tools referenced through filegroups to the name
of the module instead of the name of the file, which means it
matches the string used in the tools property.

Also support :module format in the tools property in preparation
for deprecating the tool_files property and putting both files
and modules in the tools property.

Bug: 117354232
Test: genrule_test.go
Change-Id: Id31a4ac4ff7064076a576c1d8ffeb7c19fc6b9a4
Merged-In: Id31a4ac4ff7064076a576c1d8ffeb7c19fc6b9a4
(cherry picked from commit 098d22b5f6)
2018-10-08 16:05:48 -07:00
Colin Cross
252fc6f422 Add android_test_helper_app
Add a module that can build an APK that will be used by a test.
The APK will be sideloadable, and can be added to a test suite,
but will not autogenerate a test config file.

Test: m checkbuild
Change-Id: Idf325b1c9a2cbcd16b126da3331671e4aed4b3da
2018-10-08 15:26:00 -07:00
Colin Cross
bd01e2abee Add support for android_app_certificate modules
Some android_app modules need certificates located outside their
directory.  Instead of requiring paths from the root of the tree,
add an android_app_certificate module that exports the certificate
files.

Test: m checkbuild
Change-Id: Icbf3898894f3eb857e2d907e3e58dd072c6fabe9
2018-10-08 15:25:54 -07:00
Colin Cross
b1a5e9cadf zip2zip: add flag to uncompress files
Add -0 flag to convert files in a zip to stored instead of deflated.

Bug: 69500920
Test: zip2zip_test.go
Change-Id: I6c2b10f3b200a53a3339e3c97a78f65192b309ca
2018-10-08 15:20:56 -07:00
Colin Cross
e40b4eaeb0 Export cc module types and mutators needed for JNI testing
JNI testing will need to create basic native shared library
modules, export the minimum mutators and module types for
the required dependencies of a native shared library.

Bug: 80095087
Test: cc_test.go
Change-Id: Ibe7bc88b69cb0851291cb09a4c0c6cdb421b8651
2018-10-08 15:20:56 -07:00
Colin Cross
a4f08813a3 Add support for JNI libraries to android_app modules
Make android_app modules a MultiTargets module, which means the
common variant will have a list of Targets that it needs to handle.
Collect JNI libraries for each Target, and package them into or
alongside the APK.

Bug: 80095087
Test: app_test.go
Change-Id: Iabd3921e1d4c4b4cfcc7e131a0b0d9ab83b0ebbb
2018-10-08 15:20:56 -07:00
Colin Cross
ee0bc3b290 Add multi-target variants
Allow modules to specify that they will handle multiple targets in
the common variant.  This will be used by android_app modules to
handle JNI libraries from multiple architectures.

Bug: 80095087
Test: m checkbuild
Change-Id: Iede3e9c23b64fb516341c3ae08074a322b511d40
2018-10-08 15:20:21 -07:00
Chih-Hung Hsieh
bd783f13c1 Add default -Wimplicit-fallthrough.
After we fix all existing such warnings, it can be changed to an error.

Bug: 112564944
Test: make checkbuild
Change-Id: I61ee3a24a3f992ef018cfe6c995e957416551183
2018-10-08 22:12:35 +00:00
Dan Willemsen
2e19b81409 Merge changes from topic "update_make_flags"
am: 1c7e0a235b

Change-Id: I685103243f871207ebb01452285b80ab83891424
2018-10-08 15:06:47 -07:00
Dan Willemsen
d51d9234a8 Stop using GCC in toolchain_library
am: feea4dff66

Change-Id: I9ff471ec799b99f5d3e26d0d47e208b8a3f9cc5c
2018-10-08 15:06:24 -07:00
Dan Willemsen
1c7e0a235b Merge changes from topic "update_make_flags"
* changes:
  Update flags passed to make
  Stop using GCC in toolchain_library
2018-10-08 21:34:46 +00:00
Steven Moreland
0fd058badb Merge "Remove Sepolicy_split."
am: 445a4843cc

Change-Id: I1331c0c96ca13eb9148485a693d4f67fef59e940
2018-10-08 14:22:00 -07:00
Treehugger Robot
445a4843cc Merge "Remove Sepolicy_split." 2018-10-08 20:58:35 +00:00
Steven Moreland
d6ea749030 Remove Sepolicy_split.
It's not referenced anywhere anymore (or filled out).

Test: m nothing (parses Android.bp files)

Change-Id: I5a90bcc1ea949ee054c452eefeb2cfc2640cfaa6
2018-10-08 10:33:41 -07:00