Commit graph

1917 commits

Author SHA1 Message Date
Jerome Gaillard
ba0653cdb4 Merge "Add flags for Windows assembly builds" 2018-11-30 12:30:06 +00:00
Nikita Iashchenko
7a782203b9 Revert "C++17: switch the default."
This reverts commit c35fc0e130.

Reason for revert: fix broken targets in the internal master.

Change-Id: I70447a05ae5b2afa7efc7ab21c0432e651cab1ba
2018-11-30 11:15:16 +00:00
Treehugger Robot
b44bdb2be3 Merge "C++17: switch the default." 2018-11-30 08:06:02 +00:00
Evgenii Stepanov
98f5b0642c Add sanitizer runtime library to recovery when needed.
Make sanitized targets in recovery depend on ".recovery" flavor of
sanitizer runtime library. This forces installation of the runtime
library in recovery image as long as at least one target depends on it.

Test: hwasan build can boot into recovery
Bug: 112438058
Bug: 119582521
Change-Id: I1b7f9fa4ff5f29acb03c27074512ea24467a3d37
2018-11-29 23:22:20 +00:00
Ivan Lozano
a6703fe6b7 Merge "Disable AArch64 XOM when not using lld." 2018-11-29 15:58:39 +00:00
Jerome Gaillard
80fec097b1 Add flags for Windows assembly builds
This is necessary to build libjpeg for Windows.

Test: lunch sdk, make libjpeg
Change-Id: I6ace0e524d1d710b5ce78320e7a06777511d1634
2018-11-29 15:47:31 +00:00
Stephen Hines
c027b309f1 Merge "Support Qualcomm Kryo 385 CPU variant." 2018-11-29 07:23:40 +00:00
Elliott Hughes
c35fc0e130 C++17: switch the default.
Bug: http://b/111067277
Test: builds
Change-Id: I5065b03218772bf8cf8173f3d9808b3f0a484dc5
2018-11-28 21:45:23 -08:00
Elliott Hughes
4afedfadb2 Merge "Bump "experimental" C++ to C++2a." 2018-11-29 01:48:54 +00:00
Elliott Hughes
37976122aa Bump "experimental" C++ to C++2a.
C++17 is so last year.

Test: treehugger
Change-Id: Ifd5e6d4a4837fe037837c49c31ee2fe1499e2d79
2018-11-28 14:16:39 -08:00
Dan Albert
23d37e09e9 Allow NDK APIs to be marked as drafts.
Draft APIs are available to the platform and to CTS to allow
developers to iterate on an API, but hidden from the NDK artifacts to
avoid releasing the API until it is ready.

Test: Mark binder_ndk headers and library as drafts, make checkbuild,
      build-ndk-prebuilts.sh, verify missing from NDK artifact.
Bug: http://b/120091134
Change-Id: I8685e92bdaaea581e17fe98e7a2bfb9388f9f132
2018-11-28 09:52:12 -08:00
Ivan Lozano
bd721269d3 Disable AArch64 XOM when not using lld.
AArch64 execute-only memory is only supported when using lld as the
linker. There's still a few modules which don't use lld, so in those
cases we need to disable this option.

Bug: 77958880
Test: Module with use_clang_lld false builds without XOM
Test: Module without use_clang_lld defined builds with XOM
Change-Id: I4ab961c4d7342c54c6b40b9facfe18a45ed883bd
2018-11-28 09:17:26 -08:00
Dan Albert
90b9bbc5dc Don't use libandroid_support post-21.
Test: m checkbuild
Bug: http://b/119587551
Change-Id: I7ee1cdc7c0119dbec0e57522b9b494aeb3c16a43
2018-11-27 13:58:18 -08:00
Dan Albert
fac114b9a5 Remove legacy NDK code.
Test: make checkbuild
Bug: None
Change-Id: Ib25e851b5ac25e918c5e20d79348c6d705bddeb2
2018-11-27 13:58:18 -08:00
Steven Moreland
742989eedb Update error message for double loadable libraries.
Before it just mentioned 'double_loadable', but in this context,
LL-NDK and VNDK-SP libraries also work.

Bug: 119790516
Test: N/A
Change-Id: Ie09a959fd5e05b9cb73db30d3cc2853694577dfe
2018-11-26 12:41:04 -08:00
Ivan Lozano
074ec480ef Add support for AArch64 XOM binaries.
Adds build system support for generating AArch64 binaries with
execute-only memory layouts via a new xom module property. Also adds
support for an ENABLE_XOM build flag for global builds.

Bug: 77958880
Test: make -j ENABLE_XOM=true
Change-Id: Ia2ea981498dd12941aaf5ca807648ae37527e3ee
2018-11-21 08:59:37 -08:00
Artem Serov
d3072b0c7c Support Qualcomm Kryo 385 CPU variant.
Support Kryo 385 cpu variant which should be used for
Qualcomm Snapdragon 845.

Motivation:
  kryo385 CPU *IS NOT* an Arm Cortex-A75.

Particular problem:
  Cortex-A75 CPU must support optional ARMv8.2 dot product
  feature; kryo385 CPU (Qualcomm Snapdragon 845) doesn't
  support it.

Test: Builds when kryo385 is used as cpu variant.
Test: Pixel 3 boots to GUI with kryo385 as CPU variant
      with this patch on AOSP 9.0.0 r16.

Bug: 119564566

Change-Id: I62ffb46b1977b48446c6c1ca1400b1b39f7a8457
2018-11-21 10:15:07 +00:00
Peter Collingbourne
073d687637 Merge "Add an "scs" flag for enabling shadow call stack on targets." 2018-11-20 18:13:10 +00:00
Peter Collingbourne
8c7e6e2626 Add an "scs" flag for enabling shadow call stack on targets.
Shadow call stack (SCS) is a security mitigation that uses a
separate stack (the SCS) for return addresses.

The effect of setting sanitize.scs on a shared library is to build
the library and all of its static library dependencies with SCS. This
is similar to CFI and the other sanitizers.

Bug: 112907825
Bug: 119557795
Change-Id: I82fb2b38b10eac911c4d2d120b74fea4af0622ad
2018-11-19 17:39:23 -08:00
Dan Willemsen
569edc5f66 Add dist support to Soong
When dist'ing a library or binary that has use_version_lib set, always
distribute the stamped version, even for the device.

Test: m test_build_version_test dist
Change-Id: I2995ec516b1d182ce18f099aeaa4d186ffbcf01f
2018-11-19 15:26:14 -08:00
Treehugger Robot
56cb729e82 Merge "Apply HWASan to libc-in-recovery." 2018-11-19 20:59:09 +00:00
Treehugger Robot
6a8d765843 Merge "Use prebuilt llvm-rs-cc for unbundled build" 2018-11-19 07:51:24 +00:00
Colin Cross
2548b447f6 Use prebuilt llvm-rs-cc for unbundled build
Matches the make logic.

Bug: 117295826
Test: tapas com.android.media && m
Change-Id: Ie97220af9c72540d5f5cfd5f9f9e04f5edfea781
2018-11-18 20:58:10 -08:00
Dan Willemsen
60e62f0c44 Add nanopb-c support
Test: cd hardware/ril; mma
Change-Id: Id1481940d15a2a3f6eb29af54ee30080ff2286cb
2018-11-17 15:28:25 -08:00
dimitry
d95964a350 Enable overrides and add stem library properties
This allows modules to override exiting libraries
with custom implementations.

Bug: http://b/114470065
Test: make
Change-Id: I2692a5416a2620ab2268df8998dd2620074adc1f
2018-11-16 18:45:56 +00:00
Evgenii Stepanov
1e79844f15 Apply HWASan to libc-in-recovery.
HWASan is disabled in recovery strictly for code size, not for
correctness. With this change, HWASan binaries and libraries can be
used in recovery.

The real reason is the make build system which has no idea of the big
picture, and makes it hard to disable HWASan in _all_ recovery modules
recursively. A few static libraries have sneaked in.

Bug: 119582521
Test: sideload an OTA onto a hwasan device
Change-Id: I6536cc7bf5bfb37f939b585545a23c2068fbd47f
2018-11-15 17:34:18 -08:00
Jaewoong Jung
16c7d3d263 Revert "Revert "Revert "Revert "Export static libraries.""""
This reverts commit 555c114283.

Reason for revert: The namespace issue in the pi-dev-plus-aosp-without-vendor branch is now fixed.

Change-Id: I26ed591447797a8ee505f43bdd209162418b6c5e
2018-11-16 01:20:05 +00:00
Treehugger Robot
61d5f9a7c7 Merge "Enable benchmarks on darwin" 2018-11-15 01:09:27 +00:00
Treehugger Robot
4855c4f460 Merge "Add to support armv8-2a on 2nd arch. variant" 2018-11-14 00:51:53 +00:00
Colin Cross
5f45e81f84 Enable benchmarks on darwin
libgoogle-benchmark works fine on darwin, enable it.

Bug: 77585931
Test: m checkbuild
Change-Id: I8d1cfe4ada634675c8c4c16f42681069d0311771
2018-11-13 15:28:07 -08:00
Pirama Arumuga Nainar
538be1f81c Switch to clang-r344140b
Bug: http://b/119270185

This prebuilt has a cherry-pick to fix PGO instrumentation.

Test: m ANDROID_PGO_INSTRUMENT=all,
      Build and boot a few devices in internal branch.
Change-Id: I97ca17fbc039a17db57b2749a1adf2ef981c5918
2018-11-13 17:21:01 +00:00
mtk15504
270ba75991 Add to support armv8-2a on 2nd arch. variant
Add arch. variant option to support cores that implement armv8-2a ISAs.

Test: set TARGET_2ND_ARCH_VARIANT := armv8-2a, build successful and 32bit app launch ok

BUG: 118414869
Change-Id: I755b8858726bd887068923123bad106aed7b1ec8
2018-11-13 16:40:38 +08:00
Chih-Hung Hsieh
2fcac47e9d Revert "Add lld --no-rosegment flag to work with unwinder."
This reverts commit b18814e7a4.

Reason for revert: The originating bug is now fixed.

Test: make checkbuild
Change-Id: Iabcfbeed5977336fc27fb1ccbad269c1fa81ef6e
2018-11-12 21:09:28 +00:00
Colin Cross
c17727d06b Shard arch property structs
Arch property struct types are created at runtime.  Go has a limit
of 2**16 bytes for the name of a type, and the type of a struct
created at runtime is a string containing all the names and types
of its fields.  To avoid going over the limit, split the runtime
created structs into multiple shards.

Also undo MoreBaseLinkerProperties now that it is no longer
required.

Bug: 80437643
Test: m checkbuild
Test: no change to out/soong/build.ninja
Change-Id: I035b20332ec63f3d4b1696855c5b0b0a810597b7
2018-11-12 19:04:13 +00:00
Yi Kong
ee53a98e31 Remove unnecessary warning suppression
All instances of no-self-assign-overloaded warning have been fixed,
remove the suppression flag.

Test: m checkbuild
Change-Id: I70d9d6f721b36ebb5c3974893f79a09e4b1d1f4d
2018-11-09 23:09:19 +00:00
Jaewoong Jung
555c114283 Revert "Revert "Revert "Export static libraries."""
This reverts commit eb05c2a633.

Reason for revert: Yet another broken build.

Change-Id: I4198f2dd5c7848365d71d03f6dbd598998fb9bd8
2018-11-09 22:25:37 +00:00
Jaewoong Jung
eb05c2a633 Revert "Revert "Export static libraries.""
This reverts commit 3affc07ca0.

Reason for revert: The notice dependency bug is now fixed.

Change-Id: I5424ade9d742fbe190651097c04914a29db6dfa0
2018-11-09 16:02:34 +00:00
Peter Collingbourne
abde584fd1 Stop passing the gold plugin path to llvm-ar.
llvm-ar takes a --plugin argument but it is ignored for compatibility,
so passing it has no effect.

Change-Id: I4fc51d226d66cf2a43462d3d4ccc12e6e5ebb226
2018-11-08 20:13:16 -08:00
Yi Kong
ec2f6cba80 Merge "Revert "Prevent clang from using the x18 register on arm64."" 2018-11-09 01:32:34 +00:00
Yi Kong
8c3c0f50d0 Revert "Prevent clang from using the x18 register on arm64."
This reverts commit 98d8580c3a.

Change no longer needed with the new LLVM toolchain update.

Bug: 112907825
Bug: 111759196
Change-Id: Ife3ce47a602dd850ac84bb51abc70c0ca157776e
2018-11-08 21:07:08 +00:00
Martin Stjernholm
c51ffaf1f2 Merge "Add shared_libs to vendor and recovery targets." 2018-11-08 10:55:01 +00:00
Treehugger Robot
2eb88c7135 Merge "Use the real compiler for compdb" 2018-11-08 01:41:19 +00:00
Alex Light
be96aeac1a Use the real compiler for compdb
Some tools (eg ccls) require that the compiler in argv[0] of the
compdb be an actual compiler binary. Until now we had simply filled
that slot with /bin/false. This change fills it with the current
default clang binary instead.

Test: make -j50 SOONG_GEN_COMPDB=1 SOONG_GEN_COMPDB_DEBUG=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
Test: Use ccls
Change-Id: I920e8d3113e398b629228070a904dbf1535856e0
2018-11-07 11:35:47 -08:00
Martin Stjernholm
ef449fe62e Add shared_libs to vendor and recovery targets.
Prerequisite for https://android-review.googlesource.com/815573.

Test: Built system/core/libunwindstack with https://android-review.googlesource.com/815573
Bug: 118374951
Change-Id: I6dd7ba1416f34291792c8ac5cf74048753f3e2f6
2018-11-07 11:00:59 +00:00
Yi Kong
8a89f21746 Merge "Update clang to r344140" 2018-11-07 01:39:56 +00:00
Jaewoong Jung
3affc07ca0 Revert "Export static libraries."
This reverts commit 9d5ca159dc.

Reason for revert: This broke few builds.

Change-Id: Id9c4d7c145602a55ae07bb177f2c236e16f4fb63
2018-11-06 18:00:39 +00:00
Jaewoong Jung
9d5ca159dc Export static libraries.
Export static libraries through LOCAL_STATIC_LIBRARIES and
LOCAL_WHOLE_STATIC_LIBRARIES. This enables dependency-based NOTICE file
generation. Also, add a notice property in the libwinpthread module.

Bug: 36073965
Test: cc_test.go
Change-Id: If1ca1f9159e80cf8fbe71df7a13ca5d6a1f63b40
2018-11-05 23:48:10 +00:00
Jiyong Park
da732bd63a Set __<libname>_API__ macro when building against stubs
When building against libFoo#ver, __LIBFOO_API__ macro is set to ver so
that headers from libFoo can be conditionally compiled (e.g., hide APIs
that are not available for the version, etc.)

Bug: 112672359
Test: m (cc_test added)
Change-Id: I863ef95b385cdd842eec1bf34e81f44b5e3b58b3
2018-11-04 13:38:24 +09:00
Jaewoong Jung
3e6b1fbcfb Revert "Export static libraries."
This reverts commit 5d19e1de88.

Reason for revert: Broke aosp-build-tools/darwin_mac

Change-Id: I1af36848fb5a00849aec69941ddef33769b1b536
2018-11-02 22:56:30 +00:00
Yi Kong
53ed59ef35 Update clang to r344140
Bug: 111759196
Test: Test various targets in AOSP and internal branches.
      For Googlers, go/clang-r344140-testing
Change-Id: I70fc5a2824de698d78c95ce2acd42eff9c5ebe15
2018-11-01 23:13:25 +00:00
Jaewoong Jung
5d19e1de88 Export static libraries.
Export static libraries through LOCAL_STATIC_LIBRARIES and
LOCAL_WHOLE_STATIC_LIBRARIES. This enables dependency-based NOTICE file
generation. Also, add a notice property in the libwinpthread module.

Bug: 36073965
Test: cc_test.go
Change-Id: Ic63ca523b40acac82bbe876f7aa40ecd495907c5
2018-11-01 22:45:59 +00:00
Chih-hung Hsieh
c29e55d439 Merge "DO NOT MERGE, Make default -Wimplicit-fallthrough as error." 2018-11-01 17:51:41 +00:00
Alex Light
d6bb90dc0d Merge "Remove -fno-emulated-tls from linux_bionic" 2018-11-01 16:15:35 +00:00
Alex Light
a08ae8487c Remove -fno-emulated-tls from linux_bionic
This was preventing tools using 'thread_local' from compiling and is
not needed. Bionic fully implements TLS.

Test: cd tools/dexter/slicer; mma
Bug: 31559095
Change-Id: Ib362ad8bc950726080356b61ccae83f155ce040b
2018-10-31 11:18:22 -07:00
Chih-Hung Hsieh
53390f2557 DO NOT MERGE, Make default -Wimplicit-fallthrough as error.
Other branches might still have this warning for some build targets.

Bug: 112564944
Test: make checkbuild
Change-Id: I3db52b8a60bb28861fc9ba963a7d1cd1fe49e903
2018-10-31 18:04:22 +00:00
Logan Chien
96ef45a3dd Merge "Use prebuilt bionic versioner" 2018-10-31 01:30:54 +00:00
Logan Chien
2f066354d4 Use prebuilt bionic versioner
This commit replaces versioner host binary (built just-in-time) with
a prebuilt binary under `prebuilts/clang-tools/${OS}/bin/versioner`.
This is a part of the effort to switch to clang-r339409b.

See also.
https://android-review.googlesource.com/c/platform/bionic/+/799321

Bug: 113263746
Test: make checkbuild
Change-Id: Ia845e1c01d8b8084d00bdc4af706e867e1599863
2018-10-30 10:11:45 +08:00
Jiyong Park
7ed9de3b81 Add support for versioned stubs.
A cc_library or cc_library_shared can be configured to have stubs
variants of the lib.

cc_library_shared {
    name: "libfoo",
    srcs: ["foo.cpp"],
    stubs: {
        symbol_file: "foo.map.txt",
        versions: ["1", "2", "3"],
    },
}

then, stubs variants of libfoo for version 1, 2, and 3 are created
from foo.map.txt. Each version has the symbols from the map file where
each symbol is annotated with the version that the symbol was introduced
via the 'introduced=<ver>' syntax. The versions don't need to be in sync
with the platform versions (e.g., P for 28). The versions are local to
the library.

For another library or executable to use the versioned stubs lib, use
the new 'name#ver' syntax to specify the version:

cc_binary {
    name: "test",
    ....
    shared_libs: ["libFoo#2"],
}

Internally, a new mutator 'version' is applied to all cc.Module objects.
By default, a variant named 'impl' is created for the non-stub version.
If the versions property is set, additional variations are created per a
version with the mutable property BuildStubs set as true, which lets the
compiler and the linker to build a stubs lib from the symbol file
instead from the source files.

This feature will be used to enforce stable interfaces among APEXs. When
a lib foo in an APEX is depending on a lib bar in another APEX, then bar
should have stable interface (in C lang) and foo should be depending on
one of the stubs libs of bar. Only libraries in the same APEX as foo can
link against non-stub version of it.

Bug: 112672359
Test: m (cc_test added)

Change-Id: I2488be0b9d7b7b8d7761234dc1c9c0e3add8601c
2018-10-30 09:55:48 +09:00
Peter Collingbourne
63c6361f91 Merge "Enable safe ICF with LLD." 2018-10-27 00:59:55 +00:00
Treehugger Robot
33195833de Merge "Enable SHT_RELR sections to encode relative relocations." 2018-10-25 21:02:44 +00:00
Peter Collingbourne
486e42c353 Enable safe ICF with LLD.
Support for safe ICF was added to LLD in LLVM r337429. This reduces
the size of sailfish system.img by 7.6MB.

The address-significance tables created by Clang to support LLD's
implementation of safe ICF are incompatible with ld -r. Therefore we
need to pass -fno-addrsig to the compiler to prevent it from creating
an address-significance table when building a cc_object.

Change-Id: I83e28741e6b3cdf09566447d2658ce48594f2074
2018-10-25 13:40:28 -07:00
Treehugger Robot
1e30905f65 Merge "Revert "ATest: GTest auto gen config support run_test_as in Android.bp ."" 2018-10-25 08:53:24 +00:00
Bill Yang
fd18c42b37 Revert "ATest: GTest auto gen config support run_test_as in Android.bp ."
This reverts commit d30b940dff.

Reason for revert: sed -i requires an argument on mac, break build on mac.

Change-Id: Iba2db061ae888d265e02b750e50959019cf0f168
2018-10-25 07:10:40 +00:00
Treehugger Robot
05802ab51d Merge "Move Ndk_abis from soong.config to soong.variables" 2018-10-25 04:56:33 +00:00
Peter Collingbourne
98d8580c3a Prevent clang from using the x18 register on arm64.
This is achieved via the compiler flag -ffixed-x18 for non-LTO builds
and the linker flag -plugin-opt -mattr=+reserve-x18 for LTO builds.

This change should be reverted once we upgrade past LLVM r340889
which does this by default on Android.

Bug: 112907825
Bug: 111759196
Change-Id: I05473ddbb98319d87d442425b4d715647eae3a38
2018-10-24 23:40:49 +00:00
Colin Cross
395f2cfa89 Move Ndk_abis from soong.config to soong.variables
soong.config is not cleared between builds, which can cause
problems when switching between an ndk build and a platform build.

Bug: 118398924
Test: OUT_DIR=out_ndk DIST_DIR=dist build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: Ifc03a0c25f46625375cdda5723e4a09d7d8050d5
2018-10-24 23:20:10 +00:00
Treehugger Robot
f2ea4dddeb Merge "ATest: GTest auto gen config support run_test_as in Android.bp ." 2018-10-24 13:53:50 +00:00
Treehugger Robot
c75885a1d6 Merge "Allow cc_genrule srcs to vary by architecture" 2018-10-23 23:18:26 +00:00
Dan Willemsen
10db384ff7 Apply rtti settings to linux_bionic
Otherwise linking fails with:

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by contexts_split.cpp
>>>               contexts_split.o:(typeinfo for ContextsSplit) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__class_type_info
>>> referenced by contexts_split.cpp
>>>               contexts_split.o:(typeinfo for Contexts) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by contexts_serialized.cpp
>>>               contexts_serialized.o:(typeinfo for ContextsSerialized) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a

ld.lld: error: undefined symbol: vtable for __cxxabiv1::__si_class_type_info
>>> referenced by system_properties.cpp
>>>               system_properties.o:(typeinfo for ContextsPreSplit) in archive out/soong/.intermediates/bionic/libc/libc_common/linux_bionic_x86_64_static/libc_common.a
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)

Bug: 31559095
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: I03a02c7e55948a0cd04bdcb5c090bb74e1723a0f
2018-10-23 19:53:13 +00:00
Colin Cross
ef35448ac5 Allow cc_genrule srcs to vary by architecture
Add arch_variant to the genrule srcs property so that cc_genrule
modules can vary the srcs and outs by architecture.

Test: cc/genrule_test.go
Change-Id: Idb17013e137d7ca21ca4cfc3e4c1fa7d89977043
2018-10-23 18:40:37 +00:00
Treehugger Robot
5b9fde2d15 Merge "Add support for sysprop description files to c++" 2018-10-23 03:57:56 +00:00
Dan Willemsen
a0790e35c7 Rework how linux_bionic is built with LLD
In order to simplify the wrapper function, and stop using a linker
script, generate a set of flags to pass to LLD. Then run
host_bionic_inject on the linked binary in order to verify the
embedding, and give the wrapper function the address of the original
entry point (_start).

Bug: 31559095
Test: build host bionic with prebuilts/build-tools/build-prebuilts.sh
Change-Id: I53e326050e0f9caa562c6cf6f76c4d0337bb6faf
2018-10-22 15:46:03 -07:00
Dan Willemsen
9ff34c0ca8 Update linux_bionic configuration
Add a missing toolchain method, don't require modules to opt in to
linux_bionic.

Bug: 31559095
Test: attempt to build host bionic
Change-Id: Ia5c8e2f127b88f56191b7abc389d5329cfdb0720
2018-10-22 15:46:03 -07:00
Dan Willemsen
4f644da0ad Don't use arch-specific modules when we want a single module
This breaks when two host OSes are enabled for example.

Bug: 31559095
Test: enable host bionic as a second Host OS, attempt a build
Test: treehugger
Change-Id: If52f77d7d3b0755d768028cbddda320303a69e65
2018-10-22 15:46:03 -07:00
Dan Willemsen
0ef639bb59 Allow generating modules once per OS instead of once per Class
When building with two OSes of the same class (Host, etc) enabled,
independently produce variants of each module for each OS, instead of
making `compile_multilib: "first"` select just one of the OSes.

My use case this is for Linux + LinuxBionic, which are both considered
Host class, but this would also applied if we wanted to generate rules
for Linux+Darwin, or some combination of firmware bits (either in
addition to Android in the Device Class, or multiple firmwares in a new
Class)

Bug: 31559095
Test: enable host bionic, see a linux(_glibc) and linux_bionic
      definition for binaries
Change-Id: I55e7f046758b3dc2a31da2c4b20274ec68ece0a0
2018-10-22 15:46:03 -07:00
Rahul Chaudhry
1ffac8e636 Enable SHT_RELR sections to encode relative relocations.
Proposal for adding SHT_RELR sections in the generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

This CL requires clang-r328903.

The following test results are on clang-r339409.

Size comparison for "aosp_marlin-userdebug":
$ du -B1 -s {none,pack,relr,both}/out/target/product/marlin/system
1014616064      none/out/target/product/marlin/system
1001074688      pack/out/target/product/marlin/system
1004273664      relr/out/target/product/marlin/system
1000099840      both/out/target/product/marlin/system

none contains a build with no packing (--pack-dyn-relocs=none).
pack contains a build with current settings (--pack-dyn-relocs=android).
relr contains a build with relr packing only (--pack-dyn-relocs=relr).
both contains a build with both options enabled (--pack-dyn-relocs=android+relr).

With --pack-dyn-relocs=android+relr, lld will encode the relative
relocations in a SHT_ANDROID_RELR section, and pack the rest of
the dynamic relocations in a SHT_ANDROID_REL(A) section.

--pack-dyn-relocs=android was saving us 13,541,376 bytes (1.35%) (none - pack).
--pack-dyn-relocs=relr will save us 10,342,400 bytes (1.03%) (none - relr).
--pack-dyn-relocs=android+relr is saving us 14,516,224 bytes (1.45%) (none - both).

Size comparison for the "system/bin" directory:
$ du -B1 -s {none,pack,relr,both}/out/target/product/marlin/system/bin
29413376        none/out/target/product/marlin/system/bin
28319744        pack/out/target/product/marlin/system/bin
28258304        relr/out/target/product/marlin/system/bin
28180480        both/out/target/product/marlin/system/bin

--pack-dyn-relocs=android was saving us 1,093,632 bytes (3.72%) (none - pack).
--pack-dyn-relocs=relr will save us 1,155,072 bytes (3.93%) (none - relr).
--pack-dyn-relocs=android+relr is saving us 1,232,896 bytes (4.19%) (none - both).

Bug: None
Test: Built aosp_marlin-userdebug image, boots on device.
Test: Built aosp_x86_64-userdebug image, boots in emulator.
Change-Id: Ibb726c3b9d87688f387a7f2974fdae9bfc24efc9
2018-10-22 20:29:39 +00:00
yelinhsieh
d30b940dff ATest: GTest auto gen config support run_test_as in Android.bp .
Feature request from developer, support setting uid in Android.bp.

Bug:113359343

Test: source build/envsetup.sh ; lunch
    vim platform_testing/tests/example/native/Android.bp
    add
    test_options: {
        run_test_as: "1234",
    },
    in cc_test
    make hello_world_test
    cat out/target/product/xxxx/testcases/hello_world_test/hello_world_test.config
    Will see  <option name="run-test-as" value="1234" />
    below <test class="com.android.tradefed.testtype.GTest" >

Change-Id: I5604af5f20c45728d19f4c01396a20a74997f8a8
2018-10-22 14:14:29 +08:00
Dan Willemsen
fa2aee1ca4 Remove USE_CLANG_LLD[=false]
This should always be true now. It will be a change for side branches
(build_tools, etc) that weren't setting UseClangLld in the
soong.variables file.

Test: treehugger
Change-Id: I9fd6157fda630bf8bb939677dbcb026f02685f19
2018-10-21 19:54:12 -07:00
Dan Willemsen
2d31a44b8a Stop using DIST_DIR in Soong
We're only using it to distribute files in case of failure, which isn't
well supported currently, but can be handled for now by using the
DIST_DIR environment variable during the command execution.

This was at least one cause that we'd be re-running Soong during every
build server build, as the DIST_DIR values are unique.

Test: m dist
Change-Id: Ibd5e6b6c46695350de80b745bfb6a6aa685033a0
2018-10-20 21:33:41 -07:00
Martin Stjernholm
e608208a67 Merge "Improve messages for VNDK dependency errors."
am: c325edce18

Change-Id: I825ac5a438b13eb4c1edff75acfeafe317d2d72a
2018-10-17 05:10:03 -07:00
Martin Stjernholm
c325edce18 Merge "Improve messages for VNDK dependency errors." 2018-10-17 11:56:57 +00:00
Logan Chien
aceb86e345 Merge "Remove flags from ClangLibToolingUnknownCflags"
am: 0b6bcd4014

Change-Id: I7f7e9e80052e748c1d92f46fee4552c1b4a45a2b
2018-10-17 03:08:54 -07:00
Logan Chien
0b6bcd4014 Merge "Remove flags from ClangLibToolingUnknownCflags" 2018-10-17 09:46:26 +00:00
Logan Chien
61f2d11e75 Remove flags from ClangLibToolingUnknownCflags
This commit removes flags from ClangLibToolingUnknownCflags.  These
flags were added to workaround an old version of clang in
`external/clang`.  Since we have updated to clang-r339409b, we don't
need these workaround anymore.

Bug: 117764794
Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py
Change-Id: Ifbeebf05df5c08ee3bb7d489f39250d8fd5f5acf
2018-10-16 17:52:12 +08:00
Martin Stjernholm
257eb0c933 Improve messages for VNDK dependency errors.
Test: build_test.bash

Change-Id: I8a52664d7bbb05232bc01b32580f926aae98056d
2018-10-16 10:38:57 +01:00
Haibo Huang
3df2d5986a Merge "Add support for cortex-a76 in soong"
am: 2bfa2c852c

Change-Id: Ieabcb61634e3e60f26589837b8c0d3c29d072371
2018-10-15 14:15:52 -07:00
Haibo Huang
a31e2bda89 Add support for cortex-a76 in soong
Bug: 117125298
Test: Change a device to be A76 and build
Change-Id: Iae0773d54e57b247c818d44f8044180d5a3f95a8
2018-10-12 23:55:38 +00:00
Evgenii Stepanov
5368c31baf Define HWADDRESS_SANITIZER_GLOBAL_OPTIONS.
am: 109029fb5c

Change-Id: I6fb2bb61f37032d819dcd6dd66e2f232779e8091
2018-10-12 15:01:33 -07:00
Evgenii Stepanov
109029fb5c Define HWADDRESS_SANITIZER_GLOBAL_OPTIONS.
It will be exported in device environment as HWASAN_OPTIONS.

Bug: 112438058
Test: none
Change-Id: I574b46060b3193c9f2351116a91ebc35470ae803
2018-10-12 18:18:13 +00:00
Kostya Kortchinsky
b03b69be6d Merge "Scudo minimal runtime support for Soong"
am: d054c225fb

Change-Id: Ia506665582e4668d6ca29d1a1680c889844a95d1
2018-10-12 10:03:30 -07:00
Kostya Kortchinsky
d054c225fb Merge "Scudo minimal runtime support for Soong" 2018-10-12 16:49:31 +00:00
Dan Albert
e119bd1785 Merge changes I30719eaf,I84812c55,Ifa397b2b
am: 383707f5ea

Change-Id: Iae1c5a75026d1203b07da744906c91d64a1e6907
2018-10-11 20:31:30 -07:00
Treehugger Robot
383707f5ea Merge changes I30719eaf,I84812c55,Ifa397b2b
* changes:
  Better error message for multiple defined symbols.
  Python 3 fix.
  Pylint fix.
2018-10-12 03:16:53 +00:00
Logan Chien
6e07d547bd Merge "Switch include path of header-abi-dumper headers"
am: 3b8f3e91c1

Change-Id: I518fc2fe33016a75d70e797599ea312dc3d96595
2018-10-11 20:09:00 -07:00
Logan Chien
3b8f3e91c1 Merge "Switch include path of header-abi-dumper headers" 2018-10-12 02:56:14 +00:00
Dan Albert
756f2d0e1b Better error message for multiple defined symbols.
Test: nose2
Test: m ndk
Bug: http://b/116629622
Change-Id: I30719eaf29d63d8c6595bbab4e5214a1ce6189ca
2018-10-11 13:50:49 -07:00
Kostya Kortchinsky
ad73b2e18a Scudo minimal runtime support for Soong
Scudo is now compatible with the -fsanitize-minimal-runtime, and offers a new
dynamic library that doesn't bundle UBSan.

This patch adds support for this new library in Soong, preferring it over the
full one, unless a UBSan or diagnostic dependency is found.

Test: aosp compiled with m -j
Test: local test enabling Scudo for tombstoned
Change-Id: I17794131db148b33f8a8710ac43302cadf1af314
2018-10-11 11:55:16 -07:00
Pirama Arumuga Nainar
2985a30e1e Merge changes from topic "windows-libcxx"
am: f4ecf76b2d

Change-Id: I9bc7c290899afe5aa6e15730ae812e23ed665c16
2018-10-11 10:22:26 -07:00
Pirama Arumuga Nainar
5f193cb677 Change STL for Windows to libc++.
am: a403cc7254

Change-Id: Ieb1487d7c6dcc200ca0cf1dafa10378803de6b05
2018-10-11 10:22:08 -07:00
Pirama Arumuga Nainar
6048e3c52d Merge "Switch to clang-r339409b"
am: 3558470d28

Change-Id: I75a339f7cc25227a8e709b6267dbeb8797353d22
2018-10-11 10:21:36 -07:00
Pirama Arumuga Nainar
f4ecf76b2d Merge changes from topic "windows-libcxx"
* changes:
  Remove --allow-multiple-definitions for 32-bit Windows
  Change STL for Windows to libc++.
2018-10-11 17:00:53 +00:00
Pirama Arumuga Nainar
3558470d28 Merge "Switch to clang-r339409b" 2018-10-11 16:59:27 +00:00
Logan Chien
3ff624f24b Switch include path of header-abi-dumper headers
This commit switches the include path of header-abi-dumper clang headers
to `prebuilts/clang-tools/${os}-x86/clang-headers`.  This decouples the
cross git repositories dependencies.

Bug: 111579848
Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py
Change-Id: I53083298ca7be39b3fbaffb123146c12c189e7c3
2018-10-11 17:11:34 +08:00
Jiyong Park
b6e966984d Add ApexModule interface for APEX-aware modules
am: 9d45299ba4

Change-Id: Ica517fea677af7098e7ac082cb15997b25c90f0a
2018-10-11 00:56:00 -07:00
Jiyong Park
9d45299ba4 Add ApexModule interface for APEX-aware modules
ApexModule is the interface for APEX-aware modules. The module type apex
uses the interface to get APEX-specific information from other modules,
such as the list of APEXs that a module should be built for.

A module that is included in an APEX will be built specificaly for the
APEX. This is especially required for shared libraries; we shouldn't
just copy the artifacts built for platform, because they may be linking
against private (=unstable) symbols that are not available to APEXs
which are basically unbundled.

This CL, as a first step, makes cc.Module an APEX-aware module type.

Bug: 112672359
Test: m apex.test; the built apex has all the direct and transitive
shared lib dependencies of the libs and executables listed in Android.bp

Change-Id: I21f6a586654779984f0f5154b2a08b2adbf2168b
2018-10-11 11:19:07 +09:00
Yi Kong
35e8e19cd8 Add an option for libraries to opt out of libcrt
am: 2c188bea78

Change-Id: Ic78a8733437f360d60e96431230df0f02577a865
2018-10-10 18:02:41 -07:00
Yi Kong
2c188bea78 Add an option for libraries to opt out of libcrt
Test: m checkbuild
Bug: 29275768
Change-Id: I9c0999ddc15ad152c47089509f91dc1dc901f7e4
2018-10-10 15:56:14 -07:00
Pirama Arumuga Nainar
8fd5a96959 Remove --allow-multiple-definitions for 32-bit Windows
Bug: http://b/109759970
Bug: http://b/91353691

There are no multiple-defintion errors after switching to clang-r339409
and libc++.

Test: m native-host-cross
Change-Id: I5576b3894ed1d88c9b2e5f4d92e1d3bfadfb029b
2018-10-10 20:10:15 +00:00
Pirama Arumuga Nainar
a403cc7254 Change STL for Windows to libc++.
- Stop including libstdc++ headers.
- '-pthread' and 'static-libgcc' are unused when we pass -nodefaultlibs.
We didn't pass -nodefaultlibs for libstdc++.
- Use SjLj exceptions for 32-bit.  libgcc_eh implements SjLj exception
model for 32-bit.
- Disable visibility annotations for libcxx and libcxxabi since we are
only going to support these as static libraries.
- Use Win32 threads.  MinGW pthreads throws an error when building
libcxx since it's pthread_mutex_initializer is not constant (needs a
cast).
- Link libgcc_eh, which needs pthread, which in turn depends on
kernel32.  Wrap the libraries with --start-group and --end-group and
remove duplicates.

Test: Build and test Windows binaries under Wine.

Change-Id: I8be51b004585e11ef51b7d5012f2a51330d1260f
2018-10-10 20:09:37 +00:00
Yi Kong
d871ae11f4 Merge "Revert "Revert "Move libgcc to libcrt.builtins"""
am: 38441856ca

Change-Id: If51950dbcef748b58a71cf72b8c2a8f67e7c5bc4
2018-10-10 12:33:56 -07:00
Treehugger Robot
38441856ca Merge "Revert "Revert "Move libgcc to libcrt.builtins""" 2018-10-10 19:08:04 +00:00
Pirama Arumuga Nainar
14b3cb0ab3 Switch to clang-r339409b
Bug: http://b/117499735

Test: clang-tools build, AOSP taimen build and TH
Change-Id: I9fada181e2cb85e65c66672f870b59e8da0be9ce
2018-10-10 18:38:11 +00:00
Dan Willemsen
dc1b833df0 Remove GCC-specific toolchain methods
am: bd4abf5dfc

Change-Id: Iaea003158a8fddcd73eee1dcc2c7803687a15e71
2018-10-09 22:46:52 -07:00
Dan Willemsen
bd4abf5dfc Remove GCC-specific toolchain methods
Test: m
Change-Id: I06442347ade2d60bc42131b3126ecc17840c9e31
2018-10-09 19:44:54 -07:00
Inseob Kim
21f26907cc Add support for sysprop description files to c++
From now on, a c++ shared library can be built only with adding
".sysprop" description file to srcs. Sysprop library generator will
automatically generate a .cpp and .h files, and the header file will be
exposed to any clients linking against the shared library. For the full
schema of description file, see system/tools/sysprop/sysprop.proto.

Bug: 80125326
Test: 1) write a .sysprop description file.
2) create cc_library_shared and add description file to srcs.
3) create another module, link against library of 2), include generated
header, and access generated sysprop functions
4) see compile succeeded.

Change-Id: I95005a0724aeb8f11a856b7aee92787a16a5374d
2018-10-10 00:33:01 +00:00
Dan Willemsen
6e9fe7c6ec Merge "Restore lld parts of "Remove cortex-a53 linker workaround for new cpus.""
am: 55e095b6d8

Change-Id: I8f9d87561e02ffbeb0aae0f9435ad971c9bc1e2f
2018-10-09 16:26:41 -07:00
Dan Albert
f5b8184abe Python 3 fix.
Test: nose2  # With python3 nose2
Bug: None
Change-Id: I84812c55be0daa58a594752702d866daf3c2d8f0
2018-10-09 15:22:15 -07:00
Dan Willemsen
e28663fb28 Restore lld parts of "Remove cortex-a53 linker workaround for new cpus."
https://android-review.googlesource.com/c/platform/build/soong/+/689585
added, but was skipped going into pi-dev-plus-aosp, as the pi-dev
version (which did not have these lld bits) was already merged there.
When pi-dev-plus-aosp was pushed to aosp-master, this got lost.

Merged-In is a random git_master change, since this needs to go
into pi-dev-plus-aosp too, but no further.

Bug: 78133793
Test: git diff aosp-master..master -- cc/config/arm64_device.go
Change-Id: Iea69a2c040d11249e43a76a78859944274ce6a92
Merged-In: I7799feac522a1097ec4271bd7868cd6bfe147ad9
2018-10-09 14:44:46 -07:00
Yi Kong
7df0f30785 Revert "Revert "Move libgcc to libcrt.builtins""
This reverts commit 6fb831bd56.

Bug: 29275768
Test: checkbuild and bionic native tests on arm/arm64/x86/x86_64
Change-Id: I774dea64a209dac673f927115b30170e5470db76
Merged-In: I774dea64a209dac673f927115b30170e5470db76
(cherry picked from commit 85e9ba15b5)
2018-10-09 20:39:50 +00:00
Ivan Lozano
8a33fadc1e Apply minimal runtime to the rest of ubsan.
am: ae6ae1d880

Change-Id: I379d342ade35afc5c17c3cb205eace470f7b3bc9
2018-10-09 08:17:27 -07:00
Ivan Lozano
ae6ae1d880 Apply minimal runtime to the rest of ubsan.
Make sure that the minimal runtime gets applied to the rest
of the sanitizers we might use from ubsan.

Bug: 80195448
Test: Build success and checked build flags.
Change-Id: I31b211b80bb1068c153a9b65454a2605933c9568
2018-10-09 08:05:27 -07:00
Dan Willemsen
5d7598005a Remove GCC checks
am: 8536d6b3b7

Change-Id: I1ba28f29238db813a683169a6113baea33095f4c
2018-10-08 19:34:53 -07:00
Dan Willemsen
8536d6b3b7 Remove GCC checks
Clang is always used now, so we can remove all the GCC checks. Removing
GCC-specific configuration will happen in the next CL.

Test: m
Change-Id: I4835ecf6062159315d0dfb07b098e60bff033a8a
2018-10-09 02:16:58 +00:00
Chih-Hung Hsieh
cfba3658f4 Merge "Add default -Wimplicit-fallthrough."
am: 230e4c77a5

Change-Id: I15e7cbf40722360d91cafc196e4a9a908338df56
2018-10-08 18:02:54 -07:00
Treehugger Robot
230e4c77a5 Merge "Add default -Wimplicit-fallthrough." 2018-10-09 00:46:21 +00:00
Colin Cross
0c86c8f289 Export cc module types and mutators needed for JNI testing
am: e40b4eaeb0

Change-Id: I45e1d3e4955bb363414366bff4d8364426b5807a
2018-10-08 17:37:30 -07:00
Colin Cross
e40b4eaeb0 Export cc module types and mutators needed for JNI testing
JNI testing will need to create basic native shared library
modules, export the minimum mutators and module types for
the required dependencies of a native shared library.

Bug: 80095087
Test: cc_test.go
Change-Id: Ibe7bc88b69cb0851291cb09a4c0c6cdb421b8651
2018-10-08 15:20:56 -07:00
Chih-Hung Hsieh
bd783f13c1 Add default -Wimplicit-fallthrough.
After we fix all existing such warnings, it can be changed to an error.

Bug: 112564944
Test: make checkbuild
Change-Id: I61ee3a24a3f992ef018cfe6c995e957416551183
2018-10-08 22:12:35 +00:00
Dan Willemsen
2e19b81409 Merge changes from topic "update_make_flags"
am: 1c7e0a235b

Change-Id: I685103243f871207ebb01452285b80ab83891424
2018-10-08 15:06:47 -07:00
Dan Willemsen
d51d9234a8 Stop using GCC in toolchain_library
am: feea4dff66

Change-Id: I9ff471ec799b99f5d3e26d0d47e208b8a3f9cc5c
2018-10-08 15:06:24 -07:00
Dan Willemsen
feea4dff66 Stop using GCC in toolchain_library
Instead, hardcode the ~dozen paths into build/soong/Android.bp, which
will unblock removing more GCC support.

Bug: 114286031
Test: m
Change-Id: I2508432e00b1469141f01e667f3c6a2fe30cd805
2018-10-07 23:50:34 -07:00
Dan Willemsen
25cc01f160 Update flags passed to make
Remove more GCC-specific flags, TARGET_(arm|thumb)_CFLAGS now contains
pre-filtered clang flags, and GLOBAL_CLANG_CFLAGS_NO_OVERRIDE now
contains all flags instead of just the clang additional flags.

Test: m
Change-Id: I61e4c5a92113d4ff3b95261783269dc1d226c57a
2018-10-07 23:50:34 -07:00
Chih-hung Hsieh
88eb6873f5 Merge "Revert "Disable performance-noexcept-move-constructor check.""
am: 66ee92f3c1

Change-Id: I5c5636b8194b13fc54bb4fdaf58c40c5b39fce11
2018-10-05 16:15:34 -07:00
Treehugger Robot
66ee92f3c1 Merge "Revert "Disable performance-noexcept-move-constructor check."" 2018-10-05 23:01:46 +00:00
Yi Kong
ddaa3ac609 Merge "Revert "Move libgcc to libcrt.builtins""
am: d48fec1b90

Change-Id: I1c08dc5a825b4d7ba676ec11431174a237dc18e0
2018-10-05 15:23:43 -07:00
Yi Kong
d48fec1b90 Merge "Revert "Move libgcc to libcrt.builtins"" 2018-10-05 22:11:49 +00:00
Yi Kong
6fb831bd56 Revert "Move libgcc to libcrt.builtins"
This reverts commit 77e62dbf59.

Reason for revert: caused boot failure on mirror-aosp-master-with-vendor

Change-Id: I594df35878616dba8990d044d7cd529458a601b6
2018-10-05 22:10:04 +00:00
Chih-hung Hsieh
fac4eec15e Revert "Disable performance-noexcept-move-constructor check."
This reverts commit 1b5470afe1.

Reason for revert: Most of these warnings were fixed.

Change-Id: I63ada2b7d6f3d6a446a8fbfc9221dee668c7a30b
2018-10-05 18:45:06 +00:00
Colin Cross
6cd3f89e3a Merge changes Ibf8af35f,I32edd26b,I981875bb
am: 886d45d8dd

Change-Id: I665abf19e63ffb77c2a431f064ed026f7c13f4d9
2018-10-04 17:32:20 -07:00
Colin Cross
886d45d8dd Merge changes Ibf8af35f,I32edd26b,I981875bb
* changes:
  Make prefer32 a lambda
  Clean up archMutator
  Make more java modules defaultable
2018-10-05 00:17:07 +00:00
Yi Kong
f8aad83fba Merge "Move libgcc to libcrt.builtins"
am: 1b9970727f

Change-Id: I6e52f504712dd2f5caa97eafd6018ac6f9f408f9
2018-10-04 15:25:09 -07:00
Yi Kong
1b9970727f Merge "Move libgcc to libcrt.builtins" 2018-10-04 22:09:55 +00:00
Yi Kong
77e62dbf59 Move libgcc to libcrt.builtins
libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

libc and libm are excluded from the switch due to some symbols being
hidden in libcrt.builtins but not in libgcc. These will be addressed in
a separate CL.

Bug: 29275768
Test: checkbuild and bionic native tests on arm/arm64/x86/x86_64
Change-Id: Icc85bf88513e989a4b1547564405a22cf847db8a
2018-10-04 03:03:19 +00:00
Colin Cross
a9d8bee9f3 Make prefer32 a lambda
prefer32 needs to be set differently for app and native modules.
Make it use lambda provided by the module type instead of trying
to make archMutator figure it out.

Test: m checkbuild
Change-Id: Ibf8af35fdd3e1721725539d1f5452f4439d2125c
2018-10-03 14:31:10 -07:00
Pirama Arumuga Nainar
b56f1e22a7 Remove --allow-multiple-definion linker flag for 64-bit Windows
am: b83de950e7

Change-Id: Iff346710722c019a059639b99fd61866833741e2
2018-10-03 14:03:08 -07:00
Pirama Arumuga Nainar
b83de950e7 Remove --allow-multiple-definion linker flag for 64-bit Windows
Bug: http://b/109759970

r335286 fixed this for 64-bit Windows.  This remains broken for 32-bit
Windows.

Test: m native-host-cross
Change-Id: I4d11b83d51db055406c6723aad89efd1b86b9b7b
2018-10-03 11:40:23 -07:00
Alex Light
f9a6b7e8f5 Merge "Don't include empty-string arguments in compile_commands.json"
am: c8b28a367d

Change-Id: Ibf6814ed3367b028a8ec31d255cb94c1dc7eef94
2018-10-02 15:09:05 -07:00
Treehugger Robot
c8b28a367d Merge "Don't include empty-string arguments in compile_commands.json" 2018-10-02 21:59:23 +00:00
Colin Cross
9519ec27a0 Merge "Fix double space in include argument"
am: a112b514e7

Change-Id: Id602abf9429649b53db37bdb73a8af318628a1f8
2018-10-02 14:54:27 -07:00
Treehugger Robot
a112b514e7 Merge "Fix double space in include argument" 2018-10-02 21:12:40 +00:00
Alex Light
0c7cc1caa1 Don't include empty-string arguments in compile_commands.json
compdb.go was incorrectly splitting compiler arguments. This could
cause empty strings to be included in compile_commands.json,
potentially confusing tools.

Bug: 117124308
Test: m checkbuild
Test: m SOONG_GEN_COMPDB=1 \
        SOONG_GEN_COMPDB_DEBUG=1 \
        SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
      Examine $ANDROID_BUILD_TOP/compile_commands.json
Change-Id: I375baf255c50a1329cd644ac584d200aba9daa69
2018-10-02 11:28:25 -07:00
Colin Cross
06080f4137 Fix double space in include argument
The double space is confusing compdb.go.  compdb.go should be fixed,
but the double space is unnecessary so remove it.

Also make -isystem consistently followed by a space.

Bug: 117124308
Test: m checkbuild
Change-Id: I5ce7530d2ef66be8d8285e252d60a39299984a06
2018-10-02 11:16:56 -07:00
Christopher Ferris
8cea552a38 Merge "Add an isolated option for cc_test targets."
am: 946492f005

Change-Id: Ida02678de02acfe1f619217e814b2d99ac5c035d
2018-10-01 16:37:02 -07:00
Christopher Ferris
946492f005 Merge "Add an isolated option for cc_test targets." 2018-10-01 23:07:31 +00:00
Jack He
7ea77bf1ed Merge "Soong: Add relativeFilePathFlag category in CMakeList generator"
am: ecdcb52270

Change-Id: Iaf6a53445fa8d78b785d89cfafdcf56f2759601d
2018-10-01 09:49:22 -07:00
Treehugger Robot
ecdcb52270 Merge "Soong: Add relativeFilePathFlag category in CMakeList generator" 2018-10-01 16:41:33 +00:00
Stephen Hines
f4fe6300e6 Merge "Switch to clang-r339409."
am: ee15f2a7c7

Change-Id: Ic7de9d629900ce71315029a82f32a89a11c730be
2018-10-01 09:20:41 -07:00
Stephen Hines
ee15f2a7c7 Merge "Switch to clang-r339409." 2018-10-01 15:57:35 +00:00
Jack He
4a10b65fdc Soong: Add relativeFilePathFlag category in CMakeList generator
* Add relativeFilePathFlag compiler flag category whose format must be
  a=b/c/d, where "a" is the flag name and "b/c/d" is the flag value that
  is a relative path
* During CMake conversion, "b/c/d" will be prefixed with ANDROID_ROOT
  before being written to CMakeLists.txt

Bug: 112599284
Test: cd system/bt; mm -j40
      croot; make -j40

Change-Id: I4bb039678482201db60f0af97ab280d5028e0463
2018-10-01 07:59:54 -07:00
Christopher Ferris
9df92d6438 Add an isolated option for cc_test targets.
Test: Built a test using the isolated flag.
Change-Id: I0fe51437a66e03dbfb4ffcfd3a04af094388c6bc
2018-09-27 22:23:13 -07:00
Logan Chien
018fe90276 Merge "Allow cc_prebuilt version suffix to include svn"
am: f25112a70f

Change-Id: Ie85611438fc874748c4375cc1d0e5f4e277cbf9c
2018-09-27 18:32:24 -07:00
Logan Chien
f25112a70f Merge "Allow cc_prebuilt version suffix to include svn" 2018-09-28 01:24:24 +00:00
Jack He
4466656211 Merge "TradeFed: Add "test_config_template" flag in Android.bp"
am: dbc2962c42

Change-Id: If22f6b2b252be0ae724763b1a971777706edf6fb
2018-09-27 17:43:57 -07:00
Treehugger Robot
dbc2962c42 Merge "TradeFed: Add "test_config_template" flag in Android.bp" 2018-09-28 00:29:04 +00:00
Colin Cross
df61e69f74 Merge "Allow cc_object modules to use STL"
am: fc2aac5c71

Change-Id: Ied45fa5fe78e00b13345359ed582ab1db6d6a28e
2018-09-27 16:25:32 -07:00
Colin Cross
907769f0fb Allow cc_object modules to use STL
cc_object modules may need access to the STL headers.

Test: m checkbuild
Change-Id: I88ad556a349d9530d24949f05eebf8b6fab4c62a
2018-09-27 18:06:23 +00:00
Jack He
3333889da5 TradeFed: Add "test_config_template" flag in Android.bp
* Allow module owner to specify a test_config_template in Android.bp
* The rule goes:
  1. When "test_config" is set, Soong uses specified test config
  2. If 1 is not true, check if "AndroidTest.xml" exist in the
     directory, if so, use "AndroidTest.xml
  3. If 1 and 2 are not true, check if "test_config_template" is set.
     If so, use module specific template to generate test config
  4. Otherwise, use Soong default template for test config for autogen

Bug: 113359343
Test: make
Change-Id: I9fb4b2b266be9e0c7cf23da4a51e1c8ae67cd857
2018-09-26 18:02:55 -07:00
Stephen Hines
c91ab9eb6d Switch to clang-r339409.
This also changes over llvm-strip to use the -o flag, rather than
relying on nonstandard (and no longer functional) positional arguments.

Bug: http://b/111998531
Test: Multiple new builds. For googlers - http://go/clang-r339409-testing
Change-Id: I8c82d06304af24a001e6552e36e2f540d8e364ce
2018-09-26 21:15:08 +00:00
Pirama Arumuga Nainar
783591182e Merge "GccCppStdVersion should not be needed anymore"
am: e12f5e23c2

Change-Id: I5ad9f5f976faa0ba52c87b64bd82275c65e54bf9
2018-09-26 13:32:27 -07:00
Treehugger Robot
e12f5e23c2 Merge "GccCppStdVersion should not be needed anymore" 2018-09-26 20:19:01 +00:00
Dan Albert
f50b6ce9ba Pylint fix.
Test: pylint cc/gen_stub_libs.py
Bug: None
Change-Id: Ifa397b2b69a835d7f61731e4f240fa5971858f4c
2018-09-26 11:26:09 -07:00
Logan Chien
e4d5a6c486 Allow cc_prebuilt version suffix to include svn
This commit allows cc_prebuilt version suffix to include `svn`, e.g.
`libclang.so.8svn`.  The rationale behind this commit is that latest
LLVM/Clang prebuilt binaries use `.8svn` as the version suffix.

Bug: 111579848
Test: header-abi-dumper builds with the latest binaries
Change-Id: I91594c5d8bc57605e2e0facb0a867dc4a4a17fe6
2018-09-26 10:59:56 +08:00
Chih-Hung Hsieh
4bea350243 Merge "Disable performance-noexcept-move-constructor check."
am: 0d565c1afa

Change-Id: If7fc844e8225184e963b8da3dc56f313dcad4264
2018-09-25 14:29:01 -07:00
Pirama Arumuga Nainar
43cfe82174 GccCppStdVersion should not be needed anymore
Test: Build
Change-Id: I2cd16deed269fb40a59754dec94b376383346bf0
2018-09-25 21:27:45 +00:00
Chih-Hung Hsieh
1b5470afe1 Disable performance-noexcept-move-constructor check.
This reduces amount of warnings in default builds,
until we add noexcept to those move constructors.

Bug: 116614593
Test: build with WITH_TIDY=1
Change-Id: Iaa9e9480dbc72a7370ccbe10ed232b87dc8d6184
2018-09-25 20:25:57 +00:00
Richard Fung
82b39d59df Merge "Add support for cortex-a72"
am: 3013361546

Change-Id: I1add4a9a88d4a840d9ab699f3e8d53780f849441
2018-09-25 08:35:18 -07:00
Richard Fung
eb37ed3832 Add support for cortex-a72
Bug: 113346253
Test: lunch cheets_arm64-eng; m
Change-Id: I02dd1cfe75f97767eac7424d472ff643987c276b
2018-09-24 16:33:45 -07:00
Chih-Hung Hsieh
0a4427da81 Use WITH_TIDY_FLAGS env variable.
am: 9e5d8a60e2

Change-Id: I42b0ba1ee10ab4a3290b355c40009081ed101376
2018-09-21 17:40:53 -07:00
Chih-Hung Hsieh
9e5d8a60e2 Use WITH_TIDY_FLAGS env variable.
This variable is a space separated string of clang-tidy flags to be passed
to clang-tidy before any other system required extra flags.
Note that when this flag or local tidy_flags is defined,
the default -header-filter flag is suppressed.

Test: make with WITH_TIDY=1 WITH_TIDY_FLAGS="-extra-arg=-DABCD1=1 -extra-arg=-DABCD2=2"
Bug: 32668284
Change-Id: If7bd31c65404ef7fe6c3499d51f0f209a704efd9
2018-09-21 15:19:24 -07:00
Chih-Hung Hsieh
5e669eff0a Use DEFAULT_TIDY_HEADER_DIRS env variable.
am: 60bd4bf079

Change-Id: I4c34db5d306beb15cf8160aa905c06b8459ea8f6
2018-09-21 12:26:07 -07:00
Chih-Hung Hsieh
60bd4bf079 Use DEFAULT_TIDY_HEADER_DIRS env variable.
This variable is a regular expression to be passed as
additional patterns to the -header-filter flag for clang-tidy.
For example, when make with WITH_TIDY=1 DEFAULT_TIDY_HEADER_DIRS="d1/d2|mydir/*"
for a project in external/xyz, clang-tidy will be called with additional flag
  -header-filter=\"(external/xyz|d1/d2|mydir/*)\"

Test: make with WITH_TIDY=1 DEFAULT_TIDY_HEADER_DIRS="d1/d2|mydir/*"
Bug: 32668284
Change-Id: I6051f4f80bc6dbab882bd81435ccbc772772ac63
2018-09-21 10:34:25 -07:00
Dan Willemsen
d39087a209 Merge "*_OUT_INTERMEDIATE_LIBRARIES has been removed from Make"
am: 105de3443d

Change-Id: I85fcd8da713f6e57672493bb8fdef99056dfc53c
2018-09-19 10:37:44 -07:00
Dan Willemsen
105de3443d Merge "*_OUT_INTERMEDIATE_LIBRARIES has been removed from Make" 2018-09-19 17:19:37 +00:00
Steven Moreland
3ebb53f557 Merge "Add libbinder_ndk to the NDK."
am: f7873ecf6d

Change-Id: Ia97d75689abcef276dfa45bc9caebb022c35fa55
2018-09-18 08:31:05 -07:00
Steven Moreland
f7873ecf6d Merge "Add libbinder_ndk to the NDK." 2018-09-18 15:19:44 +00:00
Pirama Arumuga Nainar
18415bbb52 Merge "Link msvcr110.a after mingwex.a"
am: cc737f6fe0

Change-Id: I490b3a68e8994b6265118002359ff52563c32367
2018-09-17 22:37:18 -07:00
Treehugger Robot
cc737f6fe0 Merge "Link msvcr110.a after mingwex.a" 2018-09-18 05:20:36 +00:00
Pirama Arumuga Nainar
e5d974d67a Link msvcr110.a after mingwex.a
Bug: http://b/115909626

Some executables linked with msvcr110.a before mingwex.a loop on start
up with the following message:
    err:ntdll:RtlpWaitForCriticalSection section 0x7fdcb000 "?" wait
        timed out in thread 0009, blocked by 0000, retrying (60 sec)

https://android-review.googlesource.com/c/758688/ has a reproducer.

Test: The reproducer above works, and verify that few Windows binaries
behave correctly (print help message and such).

Change-Id: I837f421532d86f73713d70b3d93609b50d238af9
2018-09-17 23:33:28 +00:00
Jiyong Park
afe9fa5432 Merge "Add OutputFile to cc.Module"
am: cc2746d1f2

Change-Id: I1c8c59dd6ea327cdaa9b6aca3db9008ef6690200
2018-09-17 13:22:03 -07:00
Treehugger Robot
cc2746d1f2 Merge "Add OutputFile to cc.Module" 2018-09-17 20:03:09 +00:00
Dan Willemsen
2e224cae8e *_OUT_INTERMEDIATE_LIBRARIES has been removed from Make
So LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES is no longer necessary. And just
export the object paths directly to make instead of copying into the
intermediate libraries directory.

Test: m
Change-Id: Iba1523aec642fc81e9bf61da3125f714e91cd557
2018-09-15 10:46:17 -07:00
Colin Cross
db52052a65 Don't pass -pie for Windows binaries
am: 446c666672

Change-Id: Ib25160a25da26811ea34435e2d7dc532b3eaf7c3
2018-09-14 18:23:30 -07:00
Colin Cross
446c666672 Don't pass -pie for Windows binaries
Passing -pie to clang for Windows binaries causes a warning:
clang-7: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

Bug: 115776263
Test: m checkbuild
Change-Id: Ie502a05dac32c192c38953c684dc80d1db24b792
2018-09-14 23:02:31 +00:00
Jiyong Park
c20eee3605 Add OutputFile to cc.Module
APEX needs to know the location of the output file of cc.Module to copy
it to an intermediate directory and package there.

Bug: 112672359
Test: m apex.test
Change-Id: Iaa19b29c2859df96f50716001dbd57df3f596050
2018-09-13 12:45:00 +09:00
Colin Cross
83c49af8c2 Merge "Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules"
am: b1dff80c0e

Change-Id: I8c36a86c4bcfabe542583843794c1bb0329ce1ce
2018-09-11 15:01:30 -07:00
Colin Cross
e3d6836f02 Merge "Enable toc support for Darwin and Windows"
am: d3ab493fa0

Change-Id: I5041fd3a6fc03ddd2f143de275755d7e5efd8a8d
2018-09-11 15:01:14 -07:00
Colin Cross
b60190a4f8 Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules
Export Soong cc modules to Make using a new soong_cc_prebuilt.mk that
bypasses all of prebuilt_internal.mk, dynamic_binary.mk and binary.mk.
This also means that stripping is handled in Soong instead of Make.

Relands If9008c50920779048480f5eeeb0084f26006c998 with fixes for
mac builds.

Bug: 113936524
Test: m checkbuild
Change-Id: I9710ff57f0793f36eb889eabd08bd60a365a88dd
2018-09-10 23:12:12 -07:00
Colin Cross
b496cfd9d2 Enable toc support for Darwin and Windows
Bug: 113936524
Test: m checkbuild
Change-Id: I0f2030ad75daae2cbe44e8cbedad329d33df55f7
2018-09-10 23:12:11 -07:00
Colin Cross
091f645959 Merge "Revert "Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules""
am: cf7d5ab6d6

Change-Id: I27654214955fadaa4e454f5fe09158d76782da1c
2018-09-10 14:44:12 -07:00
Colin Cross
cf7d5ab6d6 Merge "Revert "Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules"" 2018-09-10 21:36:38 +00:00