Commit Graph

3749 Commits

Author SHA1 Message Date
Ivan Lozano
36396b26ef Merge "Allow cc modules to pull in rust includes." 2019-11-15 02:32:26 +00:00
Mitch Phillips
1f7f54f441 Add $$ORIGIN/lib to rpath for fuzz targets.
RPATH needs to be set to traverse the local directory's lib folder for
fuzz target packages.

Bug: N/A
Test: m fuzz
Change-Id: Idea4f04ce4c55315df7e808de5b2b4f06a88d82a
2019-11-14 15:08:59 -08:00
Mitch Phillips
1f6ba39697 Merge "Package fuzz targets into zipfiles, then coalesce." am: ed0070d453 am: 6efa5852b3
am: ab94bc0bc0

Change-Id: I46b6293359232d590144b60e766e8c27382e7aab
2019-11-14 11:04:17 -08:00
Mitch Phillips
f50bddb790 Prebuilt shared libraries should be collected for fuzz targets.
Currently, prebuilt shared libraries fail the linkable.CcLibrary()
check, as the module returned by NewPrebuiltSharedLibrary uses a
prebuiltLibraryLinker as the module.linker, rather than a
libraryDecorator (which is the check by CcLibrary()).

We also need to ensure that we discard LLNDK stubs libraries, so we
manually categorise and discard them as well. They unfortunately are are
cc.Modules that aren't CcLibraries, as they use a custom linker object
as well (stubDecorator).

Fixes: 144415986
Test: m fuzz
Change-Id: I3b85ef66d1602cb8c035a0a90bddf30674e2eb71
2019-11-14 11:02:50 -08:00
Mitch Phillips
ed0070d453 Merge "Package fuzz targets into zipfiles, then coalesce." 2019-11-14 18:37:48 +00:00
Mitch Phillips
2edbe8e6ed Package fuzz targets into zipfiles, then coalesce.
Instead of writing all fuzz target files into a huge zipfile (by number
of entries), we instead write each fuzz target and its files to a
zipfile, then coalesce them into a big zipfile.

This should simplify the repackager significantly, as no unzipping and
repackaging should be needed (just renaming).

This also solves b/144418402, where we are very close to hitting the
POSIX args limit on the soong_zip command for the device fuzz package,
due to the line length generated by all the entries in the huge zipfile.

Fixes: 144418402
Test: make fuzz
Change-Id: I89797e1bea2691ff4a33a227306f2f9083d8af6e
2019-11-14 08:14:24 -08:00
Ivan Lozano
e0833b1f5c Allow cc modules to pull in rust includes.
Make sure LinkabeInterfaces can export include dirs to cc modules. This
fixes the Rust implementation and makes sure these are pulled in for cc
modules.

Bug: 144052093
Test: cc module depending on a rust library includes dirs correctly.
Change-Id: I6b5d5e6ab6afb507178b4f2cbdc45f01031dbfe4
2019-11-14 07:23:26 -08:00
Jooyung Han
5e0bfd200c Merge "make ApexProperties defaultable" am: c5c4d18db0 am: 53b46ff2e9
am: a18014915f

Change-Id: I0c1a56d102eff5d7c83795f0e351be58f633987e
2019-11-13 17:04:30 -08:00
Jooyung Han
c5c4d18db0 Merge "make ApexProperties defaultable" 2019-11-14 00:42:43 +00:00
Colin Cross
f8535feeae Merge "Forbid -Weverything" am: f3898e3bef am: c0e94d6894
am: b4f00f7b05

Change-Id: I285b4dde0afb2f73921ac4fda447528ca4980d29
2019-11-13 08:23:56 -08:00
Colin Cross
f3898e3bef Merge "Forbid -Weverything" 2019-11-13 15:01:48 +00:00
Jooyung Han
18020eabc4 make ApexProperties defaultable
ApexPropreties are added in InitApexModule() and they are supposed to be
defaultable. To be defaultable, InitApexModule() should be called before
InitDefaultableModule().

Bug: 144332048
Test: m (soong test added)
Change-Id: I6c90ed3b66a086292a4c0ecb37c61f83769e62bd
2019-11-13 05:52:57 +00:00
Jiyong Park
92d6bc189c Rename # vndk tag to # llndk
The APIs that are tagged with # vndk are actually for LLNDK libraries.
Although LLNDK is part of VNDK, calling those APIs 'vndk' has given
users a wrong perception that the APIs don't need to be kept stable
because that's the norm for most of the VNDK libraries that are not
LLNDK.

In order to eliminate the misunderstanding, rename the tag to 'llndk' so
that people introducing new such API will realize what they are signing
themselves up for.

Exempt-From-Owner-Approval: cherry-pick from internal gerrit

Bug: 143765505
Test: m
Test: python3 test_gen_stub_libs.py
Merged-In: I2853df3b6e245056c21d4ab3d62466954cf26d72
(cherry picked from commit 3d7b69a657)
Change-Id: I2853df3b6e245056c21d4ab3d62466954cf26d72
2019-11-13 05:50:27 +00:00
TreeHugger Robot
7f2d7a86b8 Merge "Rename # vndk tag to # llndk" 2019-11-13 00:31:34 +00:00
Colin Cross
39ef52f1df Forbid -Weverything
Use of -Weverything blocks build system changes and toolchain updates
on new warnings.  Forbid it in the build system.  Developers can
experiment with -Weverything on their module by adding it to their
Android.bp file and building with
m ANDROID_TEMPORARILY_ALLOW_WEVERYTHING=true

Fixes: 143713277
Test: manual
Change-Id: If154db328c52f687161e7a41e486d56a129850ac
2019-11-12 15:55:03 -08:00
Mitch Phillips
ea4aefd269 Merge "'m fuzz' shared lib package should be per-fuzzer." am: 38dec1bcb5 am: fd869a69c7
am: 6796abbe9a

Change-Id: I2e2447898467f7101271449268bb0783ace96741
2019-11-12 14:30:23 -08:00
Treehugger Robot
38dec1bcb5 Merge "'m fuzz' shared lib package should be per-fuzzer." 2019-11-12 22:13:36 +00:00
Mitch Phillips
13ed3f5e34 'm fuzz' shared lib package should be per-fuzzer.
Change the ClusterFuzz package built by 'make fuzz' to now package
shared libraries per-fuzz target.

Changes documented in go/proposed-clusterfuzz-package

This has the impact of:
 - This package is much easier to post-process in the Haiku export
 cronjob.
 - Shared libraries are now per-fuzz-target. This means that we will
 have some level of duplication (libdl, libc, libc++, libclang_rt.*,
 etc.) as these libraries will be in multiple fuzz target's dirs.

This *only* affects the fuzz-$target-$arch.zip file, not the fuzz targets in
$ANDROID_HOST_OUT/fuzz or $ANDROID_PRODUCT_OUT/data/fuzz. These two
install directories still use the global shared libraries in order to
preserve space on devices.

Bug: 144360679
Test: m fuzz
Change-Id: I5f19a13070e01d2d39598f9f215a983b398a9f37
2019-11-12 11:12:10 -08:00
Nick Desaulniers
59ccc23e26 Merge "Expand ClangExtraExternalCflags to non-Google vendor projects" am: 69c013694d am: ebc13b056c
am: 5d53e272f4

Change-Id: I0de8fe352e6c24fde0950e915d84469d5af59f8c
2019-11-12 10:22:10 -08:00
Nick Desaulniers
69c013694d Merge "Expand ClangExtraExternalCflags to non-Google vendor projects" 2019-11-12 17:45:15 +00:00
Mitch Phillips
a5a468f4fb Merge "Sort fuzz target dependencies to avoid rebuilds." am: 3eceaa3240 am: b60e5fbdfe
am: fa2b7a02ad

Change-Id: Ic21ddad505ed9528499cd823884a95879d0b0ae7
2019-11-11 18:58:22 -08:00
Treehugger Robot
3eceaa3240 Merge "Sort fuzz target dependencies to avoid rebuilds." 2019-11-12 02:42:10 +00:00
Yi Kong
950e0baf2a Expand ClangExtraExternalCflags to non-Google vendor projects
Some of the warnings are too common to fix/opt-out for non-Google
projects.

Also in the change, minor clean up of duplicated code.

Test: presubmit
Bug: 139945549
Change-Id: Ic176ef1f17133405851a79592b6bef5ccb403bd9
2019-11-11 13:24:39 -08:00
Nick Desaulniers
0405b29044 Merge "soong: move -Wimplicit-fallthrough from cflags to cxxflags" am: 2d5ce8538b am: 3a24eefedb
am: 0d0b3980b8

Change-Id: I8ca47f5a92926f31ff4e5c68cb46801b2183a0b1
2019-11-11 10:29:58 -08:00
Colin Cross
6458fee442 Merge "Remove -Wno-thread-safety-negative" am: 075cc44a86 am: dcee4049d6
am: a45513cc6c

Change-Id: Ie671f3ef90115260b5ee604459b33725633110a9
2019-11-11 10:06:32 -08:00
Mitch Phillips
a6ad9a074a Merge "Soong frontend for shared library fuzzing." am: 722b02f84c am: f484975c2d
am: d8e72556ad

Change-Id: Id729340c98645b6b829bc0d7c6b89b374f087e41
2019-11-11 10:06:06 -08:00
Nick Desaulniers
2d5ce8538b Merge "soong: move -Wimplicit-fallthrough from cflags to cxxflags" 2019-11-11 16:54:25 +00:00
Mitch Phillips
0553ba356e Sort fuzz target dependencies to avoid rebuilds.
Some fuzz target dependencies are generated at Soong-time in a
nondeterministic fashion. When these are interpreted by Make, they may
cause rebuilds due to being in a different order.

Ensure that the dependencies are always sorted, which should avoid
triggering unnecessary rebuilds.

Bug: 144250431
Test: make <module> && make <module>, ensure no rebuild.
Change-Id: I44edc1a3bb3f57be3e3f093f765241b41928fa4d
2019-11-11 07:46:58 -08:00
Colin Cross
075cc44a86 Merge "Remove -Wno-thread-safety-negative" 2019-11-09 02:34:29 +00:00
Colin Cross
23d988d54a Remove -Wno-thread-safety-negative
-Wthread-safety-negative was disabled because it requires locks to
support an operator!(), and std::mutex in libc++ does not.  Disabling
it everywhere was preventing it being used for modules that want to
opt in to using it and provide their own lock that supports
operator!().  Modules that use -Weverything should either stop using
 -Weverything (preferred), or add -Wno-thread-safety-negative.

Bug: 143713277
Test: m native
Change-Id: I0b84679a806a21b16cabe7f739fde61c3efe2cbe
2019-11-08 18:27:40 +00:00
Nick Desaulniers
4e31fb87af soong: move -Wimplicit-fallthrough from cflags to cxxflags
The compiler upgrade to r370808 can now check C code for implicit
fallthrough. This is triggering a massive number of warnings throughout
external/ and the rest of the platform.

Revisit enabling this for C another day.

Bug: 139945549
Test: m
Change-Id: I8dfaedab78c6230b46e8a45a9e65106dec363380
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-11-08 09:52:56 -08:00
Mitch Phillips
e1ee1a1297 Soong frontend for shared library fuzzing.
Additional context (for Googlers): go/android-fuzzing-shared

This patch adds the Soong frontend for shared library fuzzing. We
traverse dependencies at soong install time to find all transient shared
libraries that $module depends on. We then ask the Make backend to
depend on the shared library.

We also create the source:destination mappings between where the shared
libraries are built to where they should be installed to for fuzzing.
This is then depended on by the Make backend.

Bug: N/A
Test: m fuzz, note the contents of $ANDROID_PRODUCT_OUT/data/fuzz/lib,
and out/soong/fuzz-target-*.zip now has shared libraries.

Change-Id: Id7afbd34bc9c055110af96cd3c668b730d404aee
2019-11-08 08:48:13 -08:00
Martin Stjernholm
e5ed6d1b09 Merge "Revert submission of topic 'libdl_android-in-apex'" am: 3980ced987 am: 6d01bf3b82
am: 632f7546c6

Change-Id: I4b45402545bff8b2c6cd7ae4feb52442e45610d8
2019-11-08 04:17:52 -08:00
Martin Stjernholm
3980ced987 Merge "Revert submission of topic 'libdl_android-in-apex'" 2019-11-08 11:51:39 +00:00
Colin Cross
12405b69e2 Merge changes from topic "reorder-cflags" am: 1f38237c12 am: 17da9db309
am: 157df18e9a

Change-Id: I8c9f2ba120a41c1b132e63a1a1baeada454f3812
2019-11-07 21:37:09 -08:00
Colin Cross
1f38237c12 Merge changes from topic "reorder-cflags"
* changes:
  Reorder local and global flags
  Split local and global cflags
2019-11-08 05:07:34 +00:00
Jooyung Han
93249c363d Merge changes from topic "libraries-txt-to-soong" am: 3e38230af7 am: 1813458be8
am: 128c4dd453

Change-Id: I09be59d00c34eb452075eed9e20df32d41cf47d7
2019-11-07 20:25:58 -08:00
Treehugger Robot
3e38230af7 Merge changes from topic "libraries-txt-to-soong"
* changes:
  VNDK APEX contains related *.libraries.txt files
  Make vndk*.libraries.txt as soong modules
2019-11-08 04:04:14 +00:00
Jiyong Park
421f4a80fb Merge "SDK snapshot is dist'ed" am: d0a4878b49 am: ed00b7fa5f
am: 971c649b6d

Change-Id: Ib79b76b12150064d9a718cc5d4101be38032360a
2019-11-07 17:22:32 -08:00
Treehugger Robot
d0a4878b49 Merge "SDK snapshot is dist'ed" 2019-11-08 00:45:50 +00:00
Colin Cross
6d88dbad0e Reorder local and global flags
Native compiler flags are currently applied in approximately:
global cflags
local cflags
local include dirs
global include dirs
global conlyflags
local conlyflags
global cppflags
local cppflags

This means that a flag that is enabled in the global cppflags
cannot be disabled in the local cflags, and an Android.bp author
must know to disable it in the local cppflags.

The previous CL split the global and local flags into separate
variables.  Rearrange the order that the variables are applied
to be:
global cflags
global conlyflags
global cppflags
local cflags
local include dirs
local conlyflags
local cppflags
global include dirs

Bug: 143713277
Test: m native

Change-Id: I171524ab40096a636a8e549e1e4bc3347ef9f97a
2019-11-07 15:27:58 -08:00
Colin Cross
4af21ed26f Split local and global cflags
Native compiler flags are currently applied in approximately:
global cflags
local cflags
local include dirs
global include dirs
global conlyflags
local conlyflags
global cppflags
local cppflags

This means that a flag that is enabled in the global cppflags
cannot be disabled in the local cflags, and an Android.bp author
must know to disable it in the local cppflags.  A better order
would be:
global cflags
global conlyflags
global cppflags
local cflags
local conlyflags
local cppflags
local include dirs
global include dirs

We are mixing both the global and local cflags into a single
variable, and similar for conlyflags and cppflags, which
prevents reordering them.  This CL prepares to reorder them
by splitting the global and local cflags into separate variables.

Bug: 143713277
Test: m native
Change-Id: Ic55a8c3516c331dc5f2af9d00e59ceca9d3e6c15
2019-11-07 15:27:58 -08:00
Yuexi Ma
31f36fbbd1 Revert submission of topic 'libdl_android-in-apex'
Reason for revert: broke numerous major apps in app compat testing
Bug: 144100240

Change-Id: I4b43b92963815dfd95a221fb3f560505e9799950
2019-11-07 19:19:54 +00:00
Martin Stjernholm
1fec8d0000 Merge "Recognize libdl_android as a Bionic library." am: 4945e7853e am: ae79228766
am: baf7ff0af9

Change-Id: Id18ba879d96058e7474223b84a31c692f73cf6a1
2019-11-07 03:21:56 -08:00
Martin Stjernholm
4945e7853e Merge "Recognize libdl_android as a Bionic library." 2019-11-07 11:01:36 +00:00
Jooyung Han
39edb6c6c1 VNDK APEX contains related *.libraries.txt files
These files were highly coupled with vndk version, so having them inside
the corresponding VNDK APEX is reasonable.

These files are used by linkerconfig and libnativeloader. In the future,
they reference these files from and VNDK APEX.

Bug: 141450808
Test: m com.android.vndk.current
Change-Id: I055a979d2636ddd8844a0afff81f6ba441f7965e
2019-11-07 16:47:38 +09:00
Jooyung Han
2216fb1f51 Make vndk*.libraries.txt as soong modules
Migrating from Make to Soong.

These files are generated by singleton and had to be defined as PREBUILT
modules in Make (system/core/rootdir/Android.mk)

Now, they are converted as soong modules.

To make things easier, a special kind of module 'vndk_libraries_txt' is
added which works like prebuilt_etc but its src file is generated by
soong.

Bug: 141450808
Test: m llndk.libraries.txt
Change-Id: Ia77e6af73f760fcd77020218c5bc37892b2cda1f
2019-11-07 15:12:03 +09:00
Jiyong Park
232e785b98 SDK snapshot is dist'ed
`m module_sdk dist` produces snapshots of all SDKs in the source tree.
A snapshot is a zip file consists of Android.bp, exported headers,
exported AIDL files, stubs for native libs and jars. The zip file is
expected to be downloaded from the build server and extracted to a
directory (which probably will be
/prebuilts/module_sdks/<module_name>/current).

Bug: 138182343
Test: m (sdk_test.go updated)

Change-Id: Idbe4bc24795fe08f26fc1cf7497028f9d162053a
2019-11-07 12:24:48 +09:00
Fabien Sanglard
1f8a6790bf Merge "Fix Soong CMakeLists.txt generator" am: 267e406830 am: eeb9ad6415
am: 9a4292b91f

Change-Id: I15a44d78dbebeacf434e922d4b644e2ecc33937c
2019-11-06 16:07:36 -08:00
Fabien Sanglard
267e406830 Merge "Fix Soong CMakeLists.txt generator" 2019-11-06 23:41:28 +00:00