Commit Graph

3749 Commits

Author SHA1 Message Date
Paul Duffin
9d8d609fcd Pass SdkMember to AddPrebuiltModule instead of the name
This is needed for a follow up change that makes sure that the
prebuilt modules have the same visibility as the source modules.

Bug: 143678475
Test: m conscrypt-module-sdk
Change-Id: I9461c8c094ab19ee9ececb5e5fd50565789f2fa2
2019-12-09 13:28:36 +00:00
Jooyung Han
b90e491e2b Expose some factories for aidl_test.go
Because aidl_interface depends on some ndk modules, their factories are
exposed so that aidl_test.go can use them.

Bug: n/a
Test: m
Change-Id: I98d282cc77310d5896a7abaf3936456a14d56ccf
2019-12-09 18:21:48 +09:00
Inseob Kim
d110f878a7 Fix generated headers of snapshot
For VNDK snapshot and SDK snapshot, deps files have been used to capture
generated headers. But exported deps might contain intermediate phony
files instead of actual header files, which are for optimization of
ninja. To correctly capture all headers, exported generated header files
are gathered separately.

Bug: 65377115
Test: m nothing
Change-Id: Ia03fa69186490a818578190e3c0bfb0261d1fd6e
2019-12-09 12:38:34 +09:00
Colin Cross
da0c37bb44 Merge "Move ImageMutator after archMutator" am: e2f3b5dfe5 am: a129b29c76
am: 2e8290cfc7

Change-Id: Id08e19ede38a0eaa1999a44f3e012e19913249f3
2019-12-06 16:50:32 -08:00
Treehugger Robot
e2f3b5dfe5 Merge "Move ImageMutator after archMutator" 2019-12-07 00:37:30 +00:00
Elliott Hughes
fe50cc5ba8 Merge "Enable -Wpragma-pack warnings as errors." am: b5d11197d3 am: d06667fc1a
am: e4dd3eb114

Change-Id: I271e7892259010e3760e0080f6326c4cf2c38744
2019-12-06 14:27:27 -08:00
Elliott Hughes
b5d11197d3 Merge "Enable -Wpragma-pack warnings as errors." 2019-12-06 22:07:20 +00:00
Colin Cross
ae6c5207cc Move ImageMutator after archMutator
Move the ImageMutator to be registered just after the archMutator
in preparation for moving it between osMutator and archMutator.
Requries updating variants in a few tests that now run the
ImageMutator.

Bug: 142286466
Test: no change to build.ninja
Test: all soong tests
Change-Id: Ia9d2a7bc0e225bedec3c9a83ea04f471a931bf47
2019-12-06 12:37:14 -08:00
Paul Duffin
6e2ab7db45 Merge changes Ia7dbcd41,I93140450,I4d3fe18f,Ib00870dd,I10203594 am: 3a7caaa80c am: f44ca6b363
am: 4fe2c14a9b

Change-Id: Ib4d1eef9e11c7c10f4912fc446b538ddd229c6dd
2019-12-06 08:03:25 -08:00
Paul Duffin
1387957727 Parameterize the sdk member processing
Extracts the type specific functionality into the SdkMemberType
interface which has to be implemented by each module type that can
be added as a member of the sdk. It provides functionality to add
the required dependencies for the module type, check to see if a
resolved module is the correct instance and build the snapshot.

The latter was previously part of SdkAware but was moved because
it has to be able to process multiple SdkAware variants so delegating
it to a single instance did not make sense.

The custom code for handling each member type specific property,
e.g. java_libs, has been replaced with common code that processes
a list of sdkMemberListProperty struct which associates the
property (name and getter) with the SdkMemberType and a special
DependencyTag which is passed to the SdkMemberType when it has to add
dependencies.

The DependencyTag contains a reference to the appropriate
sdkMemberListProperty which allows the resolved dependencies to be
grouped by type.

Previously, the dependency collection methods would ignore a module if
it was an unsupported type because they did not have a way of
determining which property it was initially listed in. That meant it
was possible to add say a droidstubs module to the java_libs property
(and because they had the same variants) it would work as if it was
added to the stubs_sources property. Or alternatively, a module of an
unsupported type could be added to any property and it would just be
ignored.

However, the DependencyTag provides information about which property
a resolved module was referenced in and so it can detect when the
resolved module is of the wrong type and report an error. That check
identified a bug in one of the tests where the sdk referenced a
java_import module (which is not allowed in an sdk) instead of a
java_library module (which is allowed). That test was fixed as part
of this.

A list of sdkMemberListProperty structs defines the member properties
supported by the sdk and are processed in order to ensure consistent
behaviour.

The resolved dependencies are grouped by type and each group is then
processed in defined order. Within each type dependencies are grouped
by name and encapsulated behind an SdkMember interface which includes
the name and the list of variants.

The Droidstubs and java.Library types can only support one variant and
will fail if given more.

The processing for the native_shared_libs property has been moved into
the cc/library.go file so the sdk package code should now have no type
specific information in it apart from what is if the list of
sdkMemberListProperty structs.

Bug: 143678475
Test: m conscrypt-module-sdk
Change-Id: I10203594d33dbf53441f655aff124f9ab3538d87
2019-12-06 12:16:59 +00:00
Jiyong Park
7cfc8613a4 Merge "apex_available is defaultable" am: cea93afe76 am: f8bde14a30
am: b80bcbae27

Change-Id: Ic262f9b6ef94acbc2109e8d21e68ae5a2f36175d
2019-12-06 01:11:13 -08:00
Ivan Lozano
587697c3fb Merge "Exclude dirs from binder interface whitelisting" am: 1fdb0b55a5 am: cc9c86c35e
am: 450180fedf

Change-Id: I27163dde20667333700e6bd4cc1ad8da739a17e4
2019-12-06 00:58:08 -08:00
Mitch Phillips
03b84f7063 Merge "Fix cc_fuzz ignoring soong namespaces." am: 5eb62bc2fe am: 8e83eb03c7
am: 71d1368552

Change-Id: I472f59e4aa76eda1dbb57f0aafedc8170a2a902a
2019-12-06 00:43:22 -08:00
Nick Desaulniers
0d1f2ae0b4 Merge "soong: upgrade Android platform to clang-r370808" am: ac0336d81f am: e350a6bf35
am: b02c16c39b

Change-Id: I3d0d22be63ede77455bc1be0307b0ce82bf3d847
2019-12-06 00:43:06 -08:00
Treehugger Robot
cea93afe76 Merge "apex_available is defaultable" 2019-12-06 04:23:37 +00:00
Ivan Lozano
1fdb0b55a5 Merge "Exclude dirs from binder interface whitelisting" 2019-12-06 02:25:10 +00:00
Tri Vo
ad172d88b6 cc_fuzz: add "data" field
"data" field specifies data dependencies that will be installed in
fuzzer's output directory.

"data" behaves similar to "corpus", except "data" preserves directory
structure, e.g.

    data: ["foo/bar.txt"]

is installed into

    $OUT/data/fuzz/<arch>/<target>/data/foo/bar.txt

Test: build a fuzzer with data depenency, check data is installed
correctly
Change-Id: Ia1255026278435181b6d93f91f8f9ad39c96d07f
2019-12-05 14:45:51 -08:00
Treehugger Robot
5eb62bc2fe Merge "Fix cc_fuzz ignoring soong namespaces." 2019-12-05 21:41:41 +00:00
Nick Desaulniers
ac0336d81f Merge "soong: upgrade Android platform to clang-r370808" 2019-12-05 20:12:08 +00:00
Mitch Phillips
6a9bf214f9 Fix cc_fuzz ignoring soong namespaces.
cc_fuzz ignored soong namespaces, and built all cc_fuzz modules into the
architecture package. This caused naming conflicts where two modules had
the same name but were in different namespaces.

Now, cc_fuzz will only build modules that are in the same namespace as
the product definition - resolving the duplicate definitions error.

Bug: 145240569
Test: m haiku
Change-Id: I0a0acd139426301586ac5e3aba8ce5527cb7a1b5
2019-12-05 09:38:56 -08:00
Ivan Lozano
d094d4006f Exclude dirs from binder interface whitelisting
Exclude vendor/ and hardware/ from the manually written binder interface
whitelist.

Bug: 136279235
Test: interfaces in excluded directories are not checked against whitelist.
Change-Id: I0d640e23489b37d0c0787d5fca6bcdab10034109
2019-12-04 09:10:21 -08:00
Elliott Hughes
2cdbdf1093 Enable -Wpragma-pack warnings as errors.
The use of pragma pack(1) affects the packed-ness of every struct
definition that follows it in the translation unit, even in following
header files. This can lead to multiple translation units disagreeing
on whether a struct is packed.

Enable the warnings (as errors) that help spot this problem.

Bug: http://b/73971777
Test: treehugger
Change-Id: Id3096f35dff5dc8723d30d1305f1ed7ae8190a32
2019-12-04 08:48:45 -08:00
Logan Chien
e274fc9892 Run ABI checks for shared libs exported by APEX
This commit enables ABI checks for shared libs exported by APEX and
explicitly enabled ABI checks.

Bug: 145608479
Test: m com.android.resolv
Change-Id: I3b58178b0258df35fcc848e84642152516f6774f
2019-12-04 15:26:37 +00:00
Automerger Merge Worker
7a6199666f Merge "Add -instcombine-lower-dbg-declare to hwasan flags." am: e643cd2b61 am: f23fd9f1f9
Change-Id: If8f9d343d956a5cad6932e478714fbcbba1227cf
2019-12-03 02:41:55 +00:00
Treehugger Robot
e643cd2b61 Merge "Add -instcombine-lower-dbg-declare to hwasan flags." 2019-12-03 02:19:08 +00:00
Jiyong Park
3814f4df2b apex_available is defaultable
Previously, it was defaultable only for cc_library. Now, it is
defaultable for all module types.

Bug: 128708192
Test: m
Change-Id: If248f593da6f4b724bf889ccd7f2e077d48069b5
2019-12-02 13:48:33 +09:00
Nick Desaulniers
4f49e35902 soong: upgrade Android platform to clang-r370808
-Wc99-designators warns for the use of nested and array initializers in
C++20 code. Many internal projects have pushed back against this
warning.

Disables:
- -Wimplicit-int-float-conversion
- -Wpointer-compare
- -Wxor-used-as-pow
- -Wfinal-dtor-non-final-class
- -Wreorder-init-list

For projects under external/, vendor/, etc, but only if they use
Android.bp (not Android.mk) and -Wreorder-init-list may be re-enabled by
-Wall if set locally.

-Wno-incomplete-setjmp-declaration is needed for NDK stubs that get
generated (functions without full definitions of their parameters).

Sets
- -Wno-error=implicit-int-float-conversion
- -Wno-error=reorder-init-list
for all projects in order to unblock landing the compiler upgrade due to
internal projects not being able to disable or fix these before the
upgrade.

Bug: 139945549
Test: build (aosp_crosshatch, crosshatch, aosp_x86_64-eng,
  walleye), boot internal devices, bionic + RS atests, kernel builds.
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Change-Id: I18e3c0eb657fd59824526f36c6dd57bdcf0526ba
2019-11-26 10:09:15 -08:00
Steven Moreland
1f1b4f6e55 Merge "vndkMustUseVendorVariantList += vintf-vibrator" am: 16fc49db61 am: 3443e7df09
am: 9d05d7e823

Change-Id: Ia7aa7d28f71d7b68bda4a51ac077de70bbfbc1b5
2019-11-25 15:50:17 -08:00
Steven Moreland
16fc49db61 Merge "vndkMustUseVendorVariantList += vintf-vibrator" 2019-11-25 23:42:48 +00:00
Steven Moreland
e7b5b72015 vndkMustUseVendorVariantList += vintf-vibrator
TARGET_VNDK_USE_CORE_VARIANT devices explicitly track libs which are
differentiated between system/vendor. b/145157349 is filed to try to
catch these errors during normal builds (or in presubmit).

aidl libs need to be differentiated because they explicitly set
different system/vendor stabilities.

Fixes: 145154788
Test: fixes build
Change-Id: I682ceaa2dd23f0f80ba060ae262d766b1367187e
2019-11-25 15:21:44 -08:00
Colin Cross
dce17fa832 Merge changes I0dcc9c7b,I9bc40642 am: 09ef474b6f am: dc5ae0ee6a
am: adac91844b

Change-Id: I4ea46273aec2b36d7d7d140d4b5f1a6efbbfe939
2019-11-25 14:48:14 -08:00
Colin Cross
09ef474b6f Merge changes I0dcc9c7b,I9bc40642
* changes:
  Move cc.imageMutator into the android package
  Make CreateVariations return []android.Module
2019-11-25 22:30:17 +00:00
Colin Cross
1e70757891 Make TestContext.RegisterModuleType take an android.ModuleFactory am: 4b49b768a2 am: 89169a36dd
am: ac3fe4d8ae

Change-Id: I7c0e5d743434231ec8784e1bb9ba7dc12d7c0c07
2019-11-25 14:28:57 -08:00
Colin Cross
4b49b768a2 Make TestContext.RegisterModuleType take an android.ModuleFactory
Avoid having to pass ModuleFactoryAdaptor to every call to
RegisterModuleType in a test by wrapping RegisterModuleType.

Test: all soong tests
Change-Id: If8847d16487de0479cc3020b728256922b3cadba
2019-11-25 10:59:44 -08:00
Evgenii Stepanov
64bee4decf Add -instcombine-lower-dbg-declare to hwasan flags.
This is a workaround to improve hwasan reports involving stack
variables.

Bug: 112437883
Test: SANITIZE_TARGET=hwaddress, build and boot

Change-Id: I21ea2fdd2d1f04e2bb9b9847785c00a951030c74
2019-11-22 18:40:07 -08:00
Colin Cross
4179bf95ba Merge "Make fuzz rules reproducible" am: 87847f7280 am: 2d42ef51d2
am: 4fc208edc9

Change-Id: I361999e3de2ec083468c04b7842620cbcc000279
2019-11-22 12:13:29 -08:00
Treehugger Robot
87847f7280 Merge "Make fuzz rules reproducible" 2019-11-22 19:09:42 +00:00
Ivan Lozano
d201caf19d Merge "Allow cc.LinkabeInterfaces to request "" variants." am: 3bc70db398 am: 239c81f2e0
am: 87af635df0

Change-Id: If00bc4b7c0aa4f43ffb20569a30c67b6d4dfd965
2019-11-21 18:58:09 -08:00
Jiyong Park
4f64217110 Merge "symbols in stub library isn't affected by -fvisibility=hidden" am: 66278b6224 am: e3dfb51c8c
am: 31a7aa8b09

Change-Id: I4f4c4bcf89fe30def4e84e710ddf3c848adb73fa
2019-11-21 18:56:37 -08:00
Ivan Lozano
3bc70db398 Merge "Allow cc.LinkabeInterfaces to request "" variants." 2019-11-22 00:24:23 +00:00
Treehugger Robot
66278b6224 Merge "symbols in stub library isn't affected by -fvisibility=hidden" 2019-11-22 00:22:48 +00:00
Ivan Lozano
2b26297dc7 Allow cc.LinkabeInterfaces to request "" variants.
cc.LinkableInterfaces should be able to request if an empty variant is
required from the LinkageMutator. We were previously assuming that if only
static or shared libraries were being built, then we didn't need the
empty variant. However this should be explicit to handle cases where the
default set of variants being created may not include both static and
shared libraries.

Bug: 144861059
Test: m -j crosvm.experimental
Change-Id: I66724bdc16ff350b06dfa4d049c82f33019979a5
2019-11-21 13:25:08 -08:00
Colin Cross
dc809f9bc5 Make fuzz rules reproducible
Use lists instead of maps to make the order and contents of fuzz
packaging rules reproducible.

Test: m nothing; touch Android.bp; m nothing
Change-Id: Id11323f7528e594370c391bfe82eb7367bc1bcd5
2019-11-21 11:03:23 -08:00
Martin Stjernholm
c41ffd9767 Merge "Reland "Recognize libdl_android as a Bionic library"." am: d0738b3608 am: 6be9b91b79
am: fa08f7ae9a

Change-Id: I51ee1d9e3613a798aa61b6eeb9d8d1be43b98a21
2019-11-21 08:40:55 -08:00
Jiyong Park
48d75efa6f symbols in stub library isn't affected by -fvisibility=hidden
Fixing the bug that -fvisibility=hidden in a cc_library is used even
when compiling stub.c file where the symbols shouldn't be hidden.

Bug: 144781653
Test: add folowing to libEGL and build
+    stubs: {
+        symbol_file: "libEGL.map.txt",
+        versions: ["29"],
+    },

Change-Id: Iab70f36a4fb98737fc35827dbc9e1ca1a99d4354
2019-11-21 15:11:49 +09:00
Colin Cross
7228ecd5e3 Move cc.imageMutator into the android package
Prepare for making the image mutator available to all modules and
moving it between the os and arch mutators by moving it into the
android package and using an interface implemented by the module
types to control it.

Bug: 142286466
Test: No unexpected changes to out/soong/build.ninja
Change-Id: I0dcc9c7b5ec80edffade340c367f6ae4da34151b
2019-11-20 15:21:32 -08:00
Martin Stjernholm
203489b321 Reland "Recognize libdl_android as a Bionic library".
Necessary to create the symlinks from /system/lib{,64} to the Runtime APEX.

Test: build & boot
Bug: 135753770
Bug: 144343305
Change-Id: I221bed87a85f18c927ba44ee75b7db75316c1f49
2019-11-19 16:35:47 +00:00
Mitch Phillips
ae82283e9e Merge changes Idea4f04c,I3b85ef66 am: 6dd78bdda0 am: ff2da83225
am: 80a34b5936

Change-Id: I500f352dd565d630d0379eec5e3322593f17b646
2019-11-14 20:47:27 -08:00
Treehugger Robot
6dd78bdda0 Merge changes Idea4f04c,I3b85ef66
* changes:
  Add $$ORIGIN/lib to rpath for fuzz targets.
  Prebuilt shared libraries should be collected for fuzz targets.
2019-11-15 04:26:22 +00:00
Ivan Lozano
ac7f3cebbe Merge "Allow cc modules to pull in rust includes." am: 36396b26ef am: b6eddf33c0
am: 7e93f62567

Change-Id: I198ebf22a3dabecad9d54c854e96c169e1968fc1
2019-11-14 18:50:38 -08:00