Commit graph

1097 commits

Author SHA1 Message Date
Justin Yun
3e2323d202 Add binder32bit to vndk_prebuilt module
For a vndk_prebuilt module that was built with 32 bit binder, add
"binder32bit: true" to its Android.bp module.
This will add .binder32 suffix to the name.

Bug: 74362637
Bug: 80450527
Test: m -j vndk_snapshot_package
Change-Id: I81049adbf5e67fe5e63d5ea3a8b027aaf6eb355b
2018-06-08 15:56:40 +09:00
Chih-Hung Hsieh
30485c920c Use llvm-{objcopy,strip} when clang lld is used.
* Pass LLVM_{OBJCOPY,STRIP} to makefile rules.
* strip.sh is used only in soong-only mode.
  It will use llvm-strip and  and llvm-objcopy
  when --use-llvm-strip is given.
  Keep flags of strip.sh in alphabetic order.
* Tested build/soong/scripts/build-ndk-prebuilts.sh
  by adding "UseClangLld": true, to soong.variables file.

Bug: 80093681
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I612267304eea434c7a33cc086b27b577d5f64094
2018-06-07 16:04:14 -07:00
Yi Kong
cc80f8d64f Revert "Revert "Add external projects only CFlags option""
This reverts commit a9ccbb7b87.

Test: m
Change-Id: I92d7b7707f73ef3af5824d3e8cb6da0465b5e07d
2018-06-06 16:41:26 -07:00
Colin Cross
2d24c1b654 Remove references to SourceDepTag in module types
SourceDepTag is going to become a set of tags of the same type
instead of a single tag, remove references to it outside the
android module.

Bug: 80144045
Test: soong tests
Change-Id: I00b2ea5040e4fc95dfbfdd79e21579853c478fcb
2018-06-06 17:05:20 +00:00
Kevin Rocard
a9ccbb7b87 Revert "Add external projects only CFlags option"
This reverts commit 6a350878d8.

Reason for revert: Breakage of many AOSP targets

Change-Id: I917e6daa04ac02ecb98c7bb1816f9bdaf46429f5
2018-06-05 21:43:46 +00:00
Yi Kong
6a350878d8 Add external projects only CFlags option
Every time the toolchain adds a new warning, we had to suppress the
warning in every external projects that violates it, or disable it
globally -- which we end up doing most of the time since the first
option is way too time consuming.

Add a separate cflags option for external projects and move existing
-Wno-* flags there so that we can enforce better code quality for
internal projects.

TODO: Move more -Wno-* flags to ClangExtraExternalCflags

Test: m checkbuild
Change-Id: If3dee491616a1e7ba6223c2f522d100e10c5ee76
2018-06-05 19:32:02 +00:00
Treehugger Robot
85b1e39ffe Merge "Fix mac sdk build" 2018-06-05 00:47:16 +00:00
Treehugger Robot
1efd4a9c81 Merge "Add a preprocessed_ndk_headers module type." 2018-06-04 23:40:03 +00:00
Dan Willemsen
fdb20d05bc Fix mac sdk build
Use the host platform "strip", and also expose "nm" and "otool" used for
toc.

Test: `m PRODUCT-sdk-sdk` on Mac
Change-Id: I7a6d127f479d3e563385ead46bc3a4b49b99776b
2018-06-03 16:19:56 -07:00
Treehugger Robot
1d2318d6cd Merge "Allow more PATH tools, expose HOST_STRIP" 2018-06-01 23:58:15 +00:00
Chih-hung Hsieh
a4181126ee Merge "Handle pack_relocations in linker.cc" 2018-06-01 20:43:11 +00:00
Dan Willemsen
f6d300662e Allow more PATH tools, expose HOST_STRIP
atree was using the host's strip tool during sdk generation, so expose
the prebuilt for use instead.

`id` was used with a test running minijail0 during the build

`sha1sum` is used by development/build/tools/mk_sdk_repo_xml.sh

`rmdir` was being used to remove some tmp files

Test: m PRODUCT-sdk_arm64-sdk dist sdk_repo
Test: Run other builds through forrest
Change-Id: I49c756a3e9497c0bbd9030754e6aa193a2d989a4
2018-06-01 12:48:41 -07:00
Dan Albert
cb1b4b2d53 Add a preprocessed_ndk_headers module type.
Unlike the old version of this (which has been renamed to
verioned_ndk_headers), this module includes a property to specify the
preprocessor to be used.

This is going to be used for preprocessing ICU4C's unicode/uconfig.h
to alter a config value that needs to differ between the platform and
the NDK.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/548
Change-Id: If5c6f54f90cf5a4187693a941748d72f39b0d797
2018-06-01 11:02:38 -07:00
Vishwath Mohan
05b002dea0 Don't enable diagnostics for CFI when setting the CFI sanitizer.
The SetSanitizer() method in cc/sanitize.go was also enabling
diagnostics for CFI when invoked from the sanitizer mutator. We
shouldn't be doing this, so this CL disables that.

Bug: 79785496
Test: strings libziparchive.so | grep 'ubsan'
Change-Id: Iffe0d4e9c333ac5dfbec3f48e381c232ce5d4463
2018-05-30 20:52:39 -07:00
Jiyong Park
97686288dd LOCAL_SDK_VERSION is not emitted for recovery variant
recovery variants are not built with NDK (useSdk() is false for
recovery). So LOCAL_SDK_VERSION shouldn't be emitted for the recovery
variants as well.

Test: m -j liblzma.recovery does not show any link type check error

Change-Id: Icb6c4fc766060e3f1555c405d5785ef5a015c629
2018-05-30 10:37:25 +09:00
Chih-Hung Hsieh
8681471e70 Handle pack_relocations in linker.cc
When pack_relocations is false and clang lld is used,
pass --pack-dyn-relocs=none to lld.

Bug: 80093890
Test: build and boot with USE_CLANG_LLD=true
Change-Id: I0ffe77a111d7fbab5afaa1395d09734a8a390e09
2018-05-29 15:39:47 -07:00
Treehugger Robot
523cef04cb Merge "Use new flex binary" 2018-05-25 22:44:35 +00:00
Treehugger Robot
c8036c17ab Merge changes from topic "recovery_available"
* changes:
  fix: recovery.cflags now works
  Mark as recovery_available:true
  Add recovery_available to cc_genrule
2018-05-25 05:58:01 +00:00
Jiyong Park
4a2dcb5c4b fix: recovery.cflags now works
There was a bug that recovery.cflags is ignored. Respect the property
when building for recovery.

Bug: 79146551
Test: m -j
Change-Id: I24c1c1b593c83eb1992721571c6d5c42483a41a0
2018-05-25 08:43:50 +09:00
Dan Willemsen
b7adae8aaf Use new flex binary
Test: treehugger
Change-Id: Ie1d41a3ee223a80b6f471b7b1cbede63cc7051f5
2018-05-24 15:45:21 -07:00
Dan Albert
97f9c963ad Rename preprocessed_ndk_headers to versioned_ndk_headers.
The current rule runs a specific preprocessor over the source files,
and I'm adding support for generic preprocessed headers in a follow
up patch.

Test: make checkbuild
Bug: None
Change-Id: I1f3193cd595f151309e6321e1b41d8d16085379d
2018-05-24 15:12:51 -07:00
Dan Albert
19ff8b4662 Add exclude_srcs property to ndk_headers modules.
Test: make checkbuild
Bug: None
Change-Id: I2778c1140ab50abc0f7dee66da35ebacef77ea72
2018-05-24 15:12:26 -07:00
Dan Albert
7122205a5a Fix typo. Properies -> Properties.
Test: make checkbuild
Bug: None
Change-Id: I0b5e3dd44f507207f2de90e922dd7016cffce118
2018-05-24 15:12:20 -07:00
Jiyong Park
6caa21aa82 Mark as recovery_available:true
Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. adbd) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.

Bug: 79146551
Test: m -j
Change-Id: I1181fa0646d840c0194e4af2043ec228ec9eff16
2018-05-24 14:14:08 +09:00
Jiyong Park
3f736c9661 Add recovery_available to cc_genrule
recovery_available property is required in cc_genrule. Specifically,
we will mark libminijail as recovery_available:true as part of building
adbd and other stuffs for recovery. Some source code of libminijail is
created via cc_genrule, so we need recovery_available in the module
type.

Bug: 79146551
Test: m -j
Change-Id: I0cf0d9b1004dda055373573e5c5a7debd112685f
2018-05-24 14:01:54 +09:00
Christopher Ferris
1a6e5c0c15 Remove cortex-a53 linker workaround for new cpus.
Bug: 78133793

Test: Built target with cortex-a53 and verified that the flag is still
Test: there.
Test: Build target with cortex-a55/cortex-a75 and verified that the flag
Test: is not there.
Test: Built and booted on a taimen, ran bionic unit tests.
Change-Id: Ibd7f497ecf46e5781cd0265463b0782babdf062a
Merged-In: Ibd7f497ecf46e5781cd0265463b0782babdf062a
(cherry picked from commit a98d721485)
2018-05-21 12:57:51 -07:00
Jayant Chowdhary
39d167aa2c Temporarily remove -check-all-apis from header-abi-diff invocation.
-check-all-apis currently, produces noise for some libraries
(eg:libstagefright_soft_vpxenc), so remove this till a good solution
arrives.

Bug: 79928919

Test: create abi reference for libstagefright_soft_vpxenc; m -j
      libstagefright_soft_vpxenc.vendor; no warnings about struct LAYER_CONTEXT
      layout changing.

Change-Id: I8f30700c1b619c72504ca9aef69075f6e334ba5f
2018-05-18 08:10:58 -07:00
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