Commit graph

3281 commits

Author SHA1 Message Date
Colin Cross
f3898e3bef Merge "Forbid -Weverything" 2019-11-13 15:01:48 +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
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
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
69c013694d Merge "Expand ClangExtraExternalCflags to non-Google vendor projects" 2019-11-12 17:45:15 +00: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
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
3980ced987 Merge "Revert submission of topic 'libdl_android-in-apex'" 2019-11-08 11:51:39 +00: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
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
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
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
267e406830 Merge "Fix Soong CMakeLists.txt generator" 2019-11-06 23:41:28 +00:00
Ramy Medhat
75c82fb518 Merge "Run non-RBE supported actions in the local pool when USE_RBE is set." 2019-11-06 18:36:18 +00:00
Fabien Sanglard
33ca8080e5 Fix Soong CMakeLists.txt generator
Problem: Soong does not guarantee that the list of parameters will
be in individual strings. This means the CMakeLists generator can
receive as input:

  params = {"-isystem", "path/to/system"}

or it could receive:

  params = {"-isystem path/to/system"}

Solution: Normalize the list of parameters into a flattened list
of parameters where each parameters is in an individual string.

Fixes: 143378093
Test: None
Change-Id: I9bd1a2006a1cf0ba383f467748b6fd4eadef6866
2019-11-05 16:26:37 -08:00
Martin Stjernholm
f4ed8df84d 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
Change-Id: I231b4ec48869843de233ebb7c2e4fc5a49e7288a
2019-11-06 00:22:37 +00:00
Ramy Medhat
dd0418a4d4 Run non-RBE supported actions in the local pool when USE_RBE is set.
Bug: 143938974
Test: ran CTS build at -j500 successfully.
Change-Id: I55074bd67308cd716972e24fb56a20bc393d5d9d
2019-11-05 22:57:35 +00:00
Inseob Kim
242ef0c4de Fix and generate vndk snapshot entirely in Soong
- VNDK snapshot now respects stem and suffix.
- ld.config.txt is removed from snapshot as linkerconfig has become default.
- Soong builds entire snapshot, and make just calls dist-for-goals.

Bug: 142589718
Test: build and install snapshot
Test: development/vndk/snapshot/update.py with past version of snapshot
Change-Id: Id1ed658c22bb2e41c0ee50d1fe2a97924a76d7dc
2019-11-04 17:03:25 +09:00
Treehugger Robot
f68f98eeb6 Merge "Fix vendor variants generation of vndk" 2019-11-04 02:00:41 +00:00
Treehugger Robot
1f056cd69d Merge "delete redundant code" 2019-11-01 18:15:33 +00:00
Inseob Kim
bc093672ed Fix vendor variants generation of vndk
Current routine to check whether BOARD_VNDK_VERSION variant is created
or not is not correct, because only non-VNDK modules are installed in
/vendor. Thus, BOARD_VNDK_VERSION variants should only be created with
non-VNDK modules.

Bug: N/A
Test: m nothing
Change-Id: I2ee7821fce407214ac6be4f4b6d62483c907971f
2019-11-01 13:28:59 +09:00
Jooyung Han
7acbfc033d Merge "Soong generates vndk-related .libraries.txt files" 2019-11-01 01:57:50 +00:00
Treehugger Robot
40dfbe3a16 Merge "native shared libs in an SDK can be snapshotted" 2019-11-01 01:23:35 +00:00
Jooyung Han
a463f720aa delete redundant code
no need to use separate test-only key for config.Once().

Test: m
Change-Id: I9e05d413504114df8f8ea8d9ef521db1d5da5d01
2019-11-01 09:00:11 +09:00
Jooyung Han
0302a84ddc Soong generates vndk-related .libraries.txt files
This is a follow-up CL of I9a24f6975bd4b226a94f61a13d43857dcdce6b88

Generated files are passed to make via MakeVars:
- SOONG_LLNDK_LIBRARIES_FILE
- SOONG_VNDKCORE_LIBRARIES_FILE
- SOONG_VNDKSP_LIBRARIES_FILE
- SOONG_VNDKPRIVATE_LIBRARIES_FILE
- SOONG_VNDKCOREVARIANT_LIBRARIES_FILE
- SOONG_VNDK_LIBRARIES_FILE

Previously filenames were "guessed" from module names. Now VndkMutator
stores filenames as well and generate those files with them.

Bug: 142963962
Bug: 141450808
Test: m && device boots && TH
Change-Id: I0c248b707188f904df60ead50059fefe90bfd17f
2019-11-01 04:35:21 +09:00
Kris Alder
5d0b3b7195 Merge "change output file extension (config.txt -> config.json)" 2019-10-31 04:59:55 +00:00
Jooyung Han
bdad6c378f Merge "apex: __ANDROID_APEX__ defined with no value" 2019-10-30 23:50:58 +00:00
Kris Alder
db97af4a4b change output file extension (config.txt -> config.json)
This is causing some build errors because the config.json file isn't
associated with a rule (because the rule looks for .txt).

Test: ran locally, checked output directory
Bug: 142551000
Change-Id: Idcdb226fa2d23055a8850b2a0545202921edc3b1
2019-10-30 20:58:54 +00:00
Treehugger Robot
9f221955f4 Merge "Use unstripped binaries in fuzz target packaging." 2019-10-30 20:48:14 +00:00
Chih-hung Hsieh
bb3e6c3c35 Merge "Add rust_test and rust_test_host." 2019-10-30 07:22:53 +00:00
Chih-Hung Hsieh
a5f22ed6b0 Add rust_test and rust_test_host.
* Rust tests are like binary files compiled with --test.
  New test.go follows binary.go code patterns and reuses
  some code in binary.go.
* Generate one test per source file as testPerSrc in cc/test.go.
  The "all tests" variation feature of cc/test.go is not copied yet.
  Fix some Stem and SubName settings to make testPerSrc work.
* Move cc.CheckDuplicate to android.CheckDuplicate,
  which is now shared by cc and rust.
* Refactor tests in binary_test.go and add new test_test.go.

Bug: 140938178
Test: mm in rust projects, added rust_test and rust_test_host
Change-Id: Ia6fec8b4cf2572fd352ab1938a1f3c7b5cca2212
2019-10-29 17:19:03 -07:00
Jooyung Han
b01c114d27 Do not install VNDK lib in favor of VNDK APEX
Since VNDK APEX replaces VNDK lib /system/lib/vndk{-sp}, VNDK libs are
not installed.

Bug: 141451661
Test: m && boot device
Change-Id: I14686927a56ded5176839c89f29a2fd7e0fca658
2019-10-30 00:07:25 +00:00
Mitch Phillips
d5bd5773e3 Use unstripped binaries in fuzz target packaging.
Unstripped binaries allow for online symbolization, and offline
symbolization using the debug info in the binary. Debug information
isn't stripped for host binaries, but is for target. Target should also
contain debugging info.

Bug: N/A
Test: m fuzz && # Check that fuzz targets in the fuzz-*.zip package have
debug info.

Change-Id: Ibd3002674d519e927340a50dfdfbf44f2d809d58
2019-10-29 17:04:22 -07:00
Jooyung Han
87a7f3064f Fix apex_vndk with TARGET_VNDK_USE_CORE_VARIANT
When TARGET_VNDK_USE_CORE_VARIANT is set, vndk apex should have only
- vndk sp libraries
- vndk core libraries which are marked as "must use vendor variant"

Previously, vndk sp libs are discarded when TARGET_VNDK_USE_CORE_VARIANT
is set.

Bug: 143374795
Bug: 139772411
Test: TARGET_VNDK_USE_CORE_VARIANT=true m com.android.vndk.current
      see if vndk sp lib(e.g. libunwindstakc) is included.

Change-Id: Iae218fff5c354eb874839a1f71be30633fb8a9ab
2019-10-30 09:04:13 +09:00
Jooyung Han
6b8459be4f apex: __ANDROID_APEX__ defined with no value
__ANDROID_APEX__ was defined with the name of apex module.
-D__ANDROID_APEX__=com.android.foo

But in this way, conditional compilation is not easy since comparing
macro's string value is not supported in C/C++.
(There's no usages of this value in source tree.)

In most cases, modules can check if __ANDROID_APEX__ is defined to see
if they are compiled for apex.
For modules which should behave differently according to which apex they
are included, they can check __ANDROID_APEX_<NAME>__.

Bug: 142582178
Test: m (soong tests run) && boot device && TH
Change-Id: I0f5e3e9463ccd96cbba333a8bdd648470c5c912d
2019-10-29 23:47:59 +00:00
Ivan Lozano
765fe7a501 Merge changes Ia7deed13,I7378a46f
* changes:
  Add support for Rust C libraries.
  Add a common interface for cc linkable libraries.
2019-10-29 21:47:14 +00:00
Ivan Lozano
52767be335 Add support for Rust C libraries.
Adds the ability for rust modules to be compiled as C libraries, and
allows cc modules to depend on these rust-generated modules. This also
means that soong-rust should not have any dependencies on soong-cc aside
from what's required for testing.

There's a couple small fixes included as well:

 - A bug in libNameFromFilePath that caused issues when library's had
 "lib" in their name.
 - VariantName is removed from rust library MutatedProperties since this
 was unused.

Bug: 140726209
Test: Soong tests pass.
Test: Example cc_binary can include a rust shared library as a dep.
Test: m crosvm.experimental
Change-Id: Ia7deed1345d2423001089014cc65ce7934123da4
2019-10-28 22:09:01 -07:00