Commit graph

1070 commits

Author SHA1 Message Date
Treehugger Robot
5e011a2531 Merge "Disable dtor inlining for clang-tidy" 2018-05-15 22:15:55 +00:00
Ivan Lozano
59fdea2ac2 Don't export UBSan minimal runtime symbols.
When linking in the UBSan minimal runtime, don't export the symbols.
This was resulting in an edge case where symbols were sometimes
undefined at runtime on address sanitized builds if static library
dependencies were integer overflow sanitized.

Bug: 78766744
Test: readelf on libraries show either inclusion of the shared library
or no undefined symbols related to the minimal runtime.

Change-Id: Ide85c8c6b53b400ce9166ccaf96d250797fe4b24
2018-05-15 08:37:18 -07:00
Jiyong Park
f9332f1c86 Support recovery and recovery_available
`recovery: true` installs a module to the recovery partition.
`recovery_available: true` makes a module to be available to other
`recovery:true` or `recovery_available: true` modules.

These to are very similar to vendor, vendor_available properties, except
for the target partition.

Bug: 67916654
Bug: 64960723
Test: m -j, toybox_recovery is installed to the recovery/root/sbin
Change-Id: Iaebe0593de16c69fa70de251a61f4d018a251509
2018-05-15 16:27:12 +09:00
Dan Willemsen
f923f2b54c Remove the unused tags property
And fix up androidmk / bpfix to provide warnings about what to do
instead.

Test: m blueprint_tools  (runs the tests, ensures there aren't any tags left)
Change-Id: I1a3ad8600211050420041740207d6957f44463c8
2018-05-15 00:33:11 +00:00
Jayant Chowdhary
ce617bbbdb Merge "Allow abi diffs sanitized variants of vndk libraries on production devices." 2018-05-14 23:54:49 +00:00
George Burgess IV
030ccee01c Disable dtor inlining for clang-tidy
LLVM r328258 turned on a feature called temporary dtor inlining by
default for all of C++ in clang-tidy. This feature appears to be
somewhat over-aggressive when objects are being passed by value. For
example, given:

void foo(std::unique_ptr<int> i);

void bar() {
  auto x = std::make_unique<int>();
  int *i = x.get();
  foo(std::move(x));
  *i = 99;
}

...clang-tidy will complain about `*i = 99;` being a definite
use-after-free. This is incorrect, however: `foo` could stash the
`unique_ptr` it's given in a global, or a class member, or ...

Until upstream fixes this bug, it's probably best to keep this disabled.

Bug: None
Test: Ran the analyzer across Android locally. Nothing broke; number of
complaints dropped significantly.

Change-Id: I806c7ead34b61f4a88a7e6ec1c94751836a21e70
2018-05-14 16:30:46 -07:00
Christopher Ferris
ba14a8f4bb Add support for cortex-a55/cortex-a75.
Bug: 78133793
Bug: 78242072

Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
Merged-In: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
2018-05-11 00:43:39 +00:00
Jayant Chowdhary
b7e08ca830 Allow abi diffs sanitized variants of vndk libraries on production devices.
Previously abi diffs were allowed only on unsanitized variants of vndk
libraries. This CL allows them on all sanitized variants which go onto
production devices, eg: cfi variants.

Bug: 66301104

Test: Without this change, for arm64 libstagefright_foundation doesn't
      get an lsdump file since we don't build an unsanitized variant
      (aosp_arm64_ab).

Test: With this change, for arm64 libstagefright_foundation does
      get an lsdump file (aosp_arm64_ab)

Change-Id: I94f82fd84fc898e4980c3f3619df9677ed723c32
2018-05-10 15:32:18 -07:00
Treehugger Robot
cfedb7bdb3 Merge "Build System: Fix rpath error if native executable under testcase folder." 2018-05-10 00:41:27 +00:00
Yi Kong
ea144bf779 Merge "Take Enable_profile_use into account when checking if PGO is enabled" 2018-05-08 19:37:29 +00:00
Dan Willemsen
4339853a20 Add a dependency fixer for proto deps
protoc dependency files, at least for C++ outputs, uses the form of:

  a/b.c \
  a/b.h: <dep1> <dep2>...

Ninja will fail the command when it parses a dep file and there's more
than one output file (even though it doesn't care what the output file
name is). So this tool will parse the original file, and output a
version with only a single output file.

Bug: 67329638
Test: NINJA_ARGS="-t deps ...pb.c" m
Test: NINJA_ARGS="-t deps ...srcjar" m
Test: NINJA_ARGS="-t deps ...srcszip" m
Test: Run dep_fixer across all of taimen's dep files, no failures.
Test: Run dep_fixer against the processed files, no changes.
Test: Run androidmk across all of our Android.mk files, inspect the diffs
Change-Id: I4263b7d5faea37285afa6b24dedf5964aa7d19dc
2018-05-07 16:21:59 -07:00
Yi Kong
ca610d2be4 Take Enable_profile_use into account when checking if PGO is enabled
Test: m
Change-Id: I3c589043af145450d0d97ef354a74845e9fae483
2018-05-07 15:16:36 -07:00
yangbill
b3174d190e Build System: Fix rpath error if native executable under testcase folder.
error while loading shared libraries: libc++.so:
cannot open shared object file: No such file or directory

BUG: N/A
Test: make -j16 hello_world_test
      out/host/linux-x86/testcases/hello_world_test/x86_64/hello_world_test
      out/host/linux-x86/testcases/hello_world_test/x86/hello_world_test

Change-Id: I0ecb1955cd67295abe12fc19ab811fe046ac5f23
2018-05-07 07:46:16 +00:00
Pirama Arumuga Nainar
470969df19 Merge "Update clang to r328903" 2018-05-03 14:55:21 +00:00
Colin Cross
d2343a331e Fix data race when ALLOW_MISSING_DEPENDENCIES=true
Missing dependencies were modifying a slice owned by a dependency,
which could cause a data race.  Return a copy instead.

Test: build with race detector enabled
Bug: 70706626
Change-Id: I9f68c887bee94348f3e11284c0833d2e04d62599
2018-04-30 16:19:31 -07:00
Pirama Arumuga Nainar
d7feb380c1 Update clang to r328903
Bug: http://b/77532044

* b/77967848 - Disable -Wc++98-compat-extra-semi

Test: Test various targets in AOSP and internal branches.  For Googlers,
go/clang-r328903-testing

Change-Id: If08dafb9ad993fb686dfd6eeb5e2d61a9c99bd0b
2018-04-30 15:18:05 -07:00
android-build-prod (mdb)
6bcee9abff Merge "Fix incomplete LTO bug workaround." 2018-04-26 00:51:07 +00:00
Dan Albert
ea4b7b9ced Fix incomplete LTO bug workaround.
https://android-review.googlesource.com/c/platform/build/soong/+/641827
forgot this use of ClangTriple(), so static libraries aren't being
installed to the correct place.

Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
    build/soong/scripts/build-ndk-prebuilts.sh && \
    ls ndk-out/soong/ndk/sysroot/usr/lib
Bug: None

Change-Id: I750ab198deff92aac06935d38d529b53030f9636
2018-04-25 16:05:30 -07:00
Logan Chien
43d34c38d8 Introduce runtime_libs to cc_binary and cc_library
This commit adds `runtime_libs` to cc_binary and cc_library.

Similar to the `required` property, if a module specifies the
`runtime_libs` properties and it is installed, then the modules
specified in `runtime_libs` will be installed as well.

Differnt from the `required` property, if a module is using VNDK and the
module names specified in `runtime_libs` are resolved to the modules
with both core and vendor variants, then '.vendor' will be appended to
those module names.

For example, if `libb` is vendor_available and `libd` is a vendor lib,
then LOCAL_REQUIRED_MODULES will contain `libb.vendor` (instead of
`libb`).

Bug: 72343507
Test: lunch aosp_arm64_ab-userdebug && make  # this runs the unit tests
Test: Create a vendor module with runtime_libs property to a
vendor_available shared library and check the generated Android.mk.

Change-Id: I9e245d80004dab597a5d3db5acd8a09117118db7
2018-04-25 14:47:50 +08:00
Chih-Hung Hsieh
e5ac609355 Disable LLD for Darwin host executables.
* See upstream status of lld for Mach-O at https://lld.llvm.org/AtomLLD.html

Bug: 73768157
Test: make checkbuild
Change-Id: I2e892193b6d75afd4358df8b2f674aa94888fb32
2018-04-24 18:07:16 -07:00
Treehugger Robot
2782ca4102 Merge "Add support for generating Compdb file" 2018-04-24 17:07:42 +00:00
Alex Light
ec868fc42a Add support for generating Compdb file
Some tools (i.e. you-complete-me) make use of a 'compdb' file
(compile_commands.json) that records (among other things) the
arguments needed to compile a file. These tools can use this with
libclang to provide semantic completions and perform other IDE
actions. This CL adds support for soong to generate a (simple)
compile_commands.json file.

Test: make SOONG_GEN_COMPDB=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
      examine $ANDROID_BUILD_TOP/compile_commands.json

Change-Id: I751bb344b90dfcdad1dfd71c2a85bacd345f0464
2018-04-24 08:15:02 -07:00
Pirama Arumuga Nainar
0b882f0394 Revert "Support coverage instrumentation for Linux host"
This reverts commit 358056c058.

Reason for revert: Breaks build_test target in some branches.

Change-Id: I604561033038d4ff15b74caf7b81ff5c8dd9632f
2018-04-23 22:44:39 +00:00
Pirama Arumuga Nainar
358056c058 Support coverage instrumentation for Linux host
Bug: http://b/77792074

- Add the libclang_rt.profile runtime libraries directly to the compile
command (for both host and target) instead of relying on the Clang
driver.
- Move the coverage mutator to PreDepsMutators so the mutation has
already happened when runtime libraries are added during dependence
computation.
- Factor out cc/config/toolchain to identify libclang_rt.profile modules
for the x86 and x86_64 host.

Test: make NATIVE_COVERAGE=true produces coverage-enabled host binaries.
Change-Id: I1ebc8cffdf11622bfc18199a57674672888b3a5f
2018-04-23 10:34:37 -07:00
Treehugger Robot
4884a172de Merge "Add double_loadable property and checks for it" 2018-04-21 02:14:51 +00:00
Treehugger Robot
7e1130cded Merge "build/make: set LOCAL_NATIVE_BENCHMARK for Google Benchmark Test" 2018-04-20 23:08:36 +00:00
Pirama Arumuga Nainar
2b8959ad5a Make 'use_clang_lld' property specifiable per architecture
Bug: http://b/73768157

Test: Mark 'use_clang_lld: true' for one arch of a module and verify by
inspection that only that arch variant uses lld.

Change-Id: I4b0d7a2bc43ee0b8462ab09a5f5c50807129a7fb
2018-04-20 19:11:50 +00:00
Chih-hung Hsieh
94853de469 Merge "Define clang lld flags for hosts." 2018-04-19 17:03:02 +00:00
Treehugger Robot
21838336c4 Merge "Friendlier message for ABI reference update" 2018-04-19 03:15:57 +00:00
Jiyong Park
a5f11e426c Friendlier message for ABI reference update
This change is to let people to just copy & paste the update command

Test: break the ABI of libbinder intentionally and make.
The message includes absolute path to the create_reference_dump.py tool.

Change-Id: If7703d64be1f51ea4b054aa1e815276e1d6dbc14
2018-04-19 10:42:40 +09:00
Pirama Arumuga Nainar
955dc4999e Fix few issues with filegroups
Bug: http://b/64121881
Bug: http://b/78188880

- Allow filegroup's properties to be extended by a LoadHook
- Support a filegroup (':module') in a prebuilt's 'Srcs' property to
export files from a different path as the prebuilt's sources.

This change also includes a refactoring that moves genrule/filegroup.go
to android/filegroup.go so that FileGroupFactory is visible in
prebuilt_test.go.

Test: Test
https://android-review.googlesource.com/c/platform/development/+/469159
in clang-tools branch on Linux, Darwin.  Test regular build in
aosp/master.

Change-Id: I3ff6215ab2e62955f039fd1086c31f1bd50ebcf6
2018-04-18 18:56:33 +00:00
Nelson Li
1f6b14e822 build/make: set LOCAL_NATIVE_BENCHMARK for Google Benchmark Test
Set LOCAL_NATIVE_BENCHMARK to true. Then, build system can use it
to auto generate the related Test config file of Google Benchmark
Test

Bug:74844131
Test: Use mm to rebuild any module in cc_benchmark
Change-Id: I6a8f1ff78f7aec3f4eb17e218845f0cdf3f57f32
2018-04-18 17:28:57 +00:00
Jiyong Park
5fb8c10f2b Add double_loadable property and checks for it
double_loadable is a property that tells whether a module is capable or
being loaded with other instance (possibly an older version) of the same
module in the same process. Currently, a shared library that is a member
of VNDK can be double loaded in a vendor process if the library is also
a dependency of an LLNDK library. Such libraries now must be explicitly
marked as `double_loadable: true` by the owner, or the dependency from
the LLNDK lib should be cut if the lib is not designed to be double
loaded.

Bug: 77155589
Test: m -j
Merged-In: I3b839f860cbdc01f43b59872cd7bb84ac4a7d73e
Change-Id: I3b839f860cbdc01f43b59872cd7bb84ac4a7d73e
(cherry picked from commit 89943d8be2)
2018-04-18 11:46:51 +09:00
Chih-Hung Hsieh
3101a969aa Define clang lld flags for hosts.
* Add -fuse-ld=lld to hostGlobalLldflags.
* Set up *ClangLldflags variables for hosts.
  They are the same as *ClangLdflags, but could be changed in the future.

Bug: 73768157
Test: make checkbuild
Change-Id: I3d61504ab7262d472bbf933df7c1a9bef62519e1
2018-04-17 16:01:08 -07:00
Treehugger Robot
556752d3d4 Merge "Fix ABI diff reporting with dist" 2018-04-17 19:35:35 +00:00
Jayant Chowdhary
b391feaea5 Setting SKIP_ABI_CHECKS=true will make soong skip native abi checks.
Bug: 78118272

Bug: 72225642

Test: SKIP_ABI_CHECKS=true mm -j64 in external/libjpeg-turbo; no abi
      dumping / diffing happens

Test: SKIP_ABI_CHECKS=false mm -j64 in external/libjpeg-turbo; abi
      dumping / diffing happens

Test: SKIP_ABI_CHECKS=foo mm -j64 in external/libjpeg-turbo; abi
      dumping / diffing happens

Change-Id: I6330bc6de81abd589e78572af8efdf70d4c69b80
2018-04-17 18:13:45 +00:00
Dan Willemsen
edd1ae0817 Fix ABI diff reporting with dist
When we're doing ABI diffing, we run something like:

  (run-abi-diff) || (echo && exit 1)

When `dist` is added, we attempt to copy out the result:

  (run-abi-diff) || (echo) && (copy && exit 1)

But this always fails, since it will always run exit 1. We really want
the parenthesis around the entire second section. This change switches
it to:

  (run-abi-diff) || (echo && (copy) && exit 1)

This matches the behavior before Iae25374fe937a0cbe8a8ddf9e23c3bc1f62bbb2a

Test: treehugger on P
Change-Id: Ic39da4d4630ee950b811ec7854d55d65c52f8661
2018-04-17 10:42:18 -07:00
Chih-Hung Hsieh
02b4da53a7 Add USE_CLANG_LLD and use_clang_lld.
* USE_CLANG_LLD is unedefined in current builds.
* When USE_CLANG_LLD is defined to 'true' or '1',
  use clang's lld instead of ld or ld.gold.
* When lld is enabled:
  * ld-only flags are not passed to 'lld'.
  * location_packer is disabled.
  * Use new lld's --pack-dyn-relocs=android.
* When lld does not work:
  * In Android.mk files use LOCAL_USE_CLANG_LLD := false.
  * In Android.bp files use use_clang_lld: false.
* Only arm, arm64, x86, and x86_64_devices have LLD flags;
  all other hosts and targets do not call lld yet.

Bug: 73768157
Test: make checkbuild and boot
Change-Id: I06b8a1e868a600997a7e70fe05c299d751d23d5f
2018-04-12 14:37:35 -07:00
Treehugger Robot
18f568f651 Merge "Remove early-return statements of link-type check" 2018-04-11 23:18:32 +00:00
Colin Cross
b3f16dea37 Merge "Consistently use Bool instead of proptools.Bool" 2018-04-11 14:46:31 +00:00
Inseob Kim
da2171ae9d Remove early-return statements of link-type check
Bug: 77834464
Test: m -j
Change-Id: I75e431ee48e23130167d1fafbe80e88c8222d79b
2018-04-11 06:45:38 +00:00
Inseob Kim
34b22839f2 Fix misleading error messages
Bug: 77834464
Test: None
Change-Id: I5c21625d1e6406399f5c397ac466f3d36a2c0cbc
2018-04-11 06:08:56 +00:00
Inseob Kim
01a2872c05 Check compatibility between STLs correctly
During link-type check, if a module with sdk_version "current" refers
another, compatibility check between STLs has not been performed.

Bug: 77834464
Test: m -j succeeded
Change-Id: Id82a39372670daca779d4fb4af2deb202170a2fd
2018-04-11 06:08:47 +00:00
Colin Cross
ff3ae9da74 Consistently use Bool instead of proptools.Bool
Use Bool instead of proptools.Bool and String instead of proptools.String.

Test: m checkbuild
Change-Id: I32d84add9f27128c7a65413e9612fd920613584f
2018-04-10 22:50:34 -07:00
Colin Cross
ed1268268d Merge "Use proptools.BoolDefault" 2018-04-11 04:38:31 +00:00
Dan Willemsen
674dc7f7f0 Expose ProductVariables from TestConfig
In preparation for unexporting ProductVariables, explicitly return a
pointer to the structure from TestConfig / TestArchConfig.

Bug: 76168832
Test: m blueprint_tools
Change-Id: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
2018-04-11 01:45:22 +00:00
Dan Willemsen
3fb1faeeb9 Use Config/DeviceConfig functions to access ProductVariables
An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
2018-04-11 01:45:14 +00:00
Colin Cross
38b40dffd6 Use proptools.BoolDefault
Replace x == nil || *x with proptools.BoolDefault(x, true)

Test: m checkbuild
Change-Id: Icc5378cab3ea72d86544b40761c2f00b278cc0a1
2018-04-10 16:26:10 -07:00
Kweku Adams
fb5b31ce96 Fixing protoOutParams concatenation.
ParseGeneratorParameter delimits based on commas, not colons:
external/protobuf/src/google/protobuf/compiler/code_generator.cc

Bug: 72570104
Test: flash device with new build
Change-Id: I00042782a718d288ca6b0cb78f856d0fb223a926
2018-04-05 17:48:32 -07:00
Jayant Chowdhary
bc30a77591 Merge "Add informational message to help with updation of VNDK abi references." 2018-04-04 23:40:06 +00:00