Commit Graph

1876 Commits

Author SHA1 Message Date
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
Colin Cross cb9342eabd Revert "Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules"
This reverts commit e2874cd99d.

Reason for revert: broke mac builds
Bug: 113936524

Change-Id: Id0311d6b202b18e80953da632133548d56ed851a
2018-09-10 21:35:34 +00:00
Colin Cross 3a088e42bf Export build/soong/scripts/strip.sh to Make
am: d2e92da626

Change-Id: I5486bd67466812073d122d7aa0a6dbf018fa87b5
2018-09-10 12:46:53 -07:00
Colin Cross 39e8b30068 Use soong_cc_prebuilt.mk instead of prebuilt.mk for Soong cc modules
am: e2874cd99d

Change-Id: Idc3276796b5a8b71d3e70282c0538b7a7c81ac6b
2018-09-10 12:44:46 -07:00
Colin Cross d2e92da626 Export build/soong/scripts/strip.sh to Make
Bug: 113936524
Test: m checkbuild
Change-Id: I2d3d1e579b05117bf377852abedd5fc6d320401f
2018-09-10 11:05:01 -07:00
Colin Cross e2874cd99d 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.

Bug: 113936524
Test: m checkbuild
Change-Id: If9008c50920779048480f5eeeb0084f26006c998
2018-09-10 11:04:01 -07:00
Evgenii Stepanov 44d6881b44 (soong) Add -fsanitize= argument to assembly flags.
am: dbf1d4f884

Change-Id: Ie3e48deef9b255b3b1e2ed12560e899c1b1baf0d
2018-09-07 10:41:30 -07:00
Evgenii Stepanov dbf1d4f884 (soong) Add -fsanitize= argument to assembly flags.
It allows use of sanitizer preprocessor macros (like __has_feature())
in assembly files.

Bug: 112438058
Test: SANITIZE_TARGET=hwaddress
Change-Id: Id3fed5492ab9473cbb13cd6c0485302412e8b1de
2018-09-07 10:23:07 -07:00
Dan Willemsen d877b27eea Merge "Remove GCC support from Make"
am: 2f7e3bb4d0

Change-Id: I32d17dca901bfc7b32f9305fee63f3ebbb58835a
2018-09-06 19:58:11 -07:00
Treehugger Robot 2f7e3bb4d0 Merge "Remove GCC support from Make" 2018-09-07 02:42:27 +00:00
Colin Cross aae66fa8d2 Merge changes Ifd529f88,I2fb4429a,I67ec2e94
am: 37710d3c71

Change-Id: I4e248297e225dc32c98aba008ee6ec74ff2f47a6
2018-09-06 16:31:11 -07:00
Dan Willemsen f640dbcd1f Remove GCC support from Make
We need to keep support in Soong until toolchain_library no longer uses
GCC.

Test: out/build-aosp_arm64.ninja is the same before/after
Test: build_test on downstream branches
Change-Id: Ib78bcd6d5544afc3a3164f65fa72a3f08b2acf29
2018-09-06 22:37:54 +00:00
Colin Cross 6b0afa58fa Merge changes I3648c914,I47dec958,Ia20f8198
am: ca126c70d7

Change-Id: I1b2ce72203aeff7135a025baf68b946372ed5b66
2018-09-06 00:13:14 -07:00
Colin Cross ed064c0b1f Fix logic for adding gnu debuglink to match Make
Only add gnu debuglink on userdebug builds to match Make, and don't
add it when using minidebuginfo, which doesn't support it.

Bug: 113936524
Test: m checkbuild
Change-Id: Ifd529f88d63afa5627172fb6ea612aea77159f40
2018-09-05 16:30:16 -07:00
Colin Cross 9a959cd519 Add Soong support for stripping all symbols
Bug: 113936524
Test: m checkbuild
Change-Id: I2fb4429aee689dc6a99dc973b37575a114e46be6
2018-09-05 16:30:16 -07:00
Colin Cross 88f6fefeb4 Add stripping and toc support to Soong cc_prebuilt modules
Bug: 113936524
Test: m checkbuild
Change-Id: I67ec2e94d349924c3e209939030b204fdaff9c47
2018-09-05 16:30:16 -07:00
Colin Cross 22f3795dca Remove relocation packer
The relocation packer prebuilt is gone, remove the references to it.

Bug: 110715614
Test: m checkbuild
Change-Id: Ia20f8198e4fc206f4995dd5168c811dac7c9df89
2018-09-05 16:30:11 -07:00
Colin Cross 728adf6a81 Don't clear flags in prebuiltLibraryLinker.linkerFlags
am: 1ab10a7310

Change-Id: Ib1890cfc3d84694ac5fca945589efb00be9814d6
2018-09-04 12:33:43 -07:00
Colin Cross 1ab10a7310 Don't clear flags in prebuiltLibraryLinker.linkerFlags
linkerFlags takes the current flags struct, it should return it
unmodified if it has nothing to do, not return an empty one.

Bug: 113837811
Test: m SANITIZE_TARGET=address
Change-Id: I35ec260f49c832a5b50ff77395eda618679e6ef9
2018-09-04 11:02:37 -07:00
Yi Kong ec11aef9cd Merge "Add BuiltinsRuntimeLibrary"
am: e944600978

Change-Id: I009085ecc3b340db8a92154ead624c5059ffdcdc
2018-08-31 17:45:16 -07:00
Yi Kong e944600978 Merge "Add BuiltinsRuntimeLibrary" 2018-09-01 00:09:19 +00:00
Yi Kong 4980e02f43 Merge "Prebuilts shouldn't inherit linker interface"
am: 1662e3c76d

Change-Id: I04f31fc040d5ec8fe3aa2d4db99bfcc3168fdf62
2018-08-31 15:38:53 -07:00
Yi Kong 1662e3c76d Merge "Prebuilts shouldn't inherit linker interface" 2018-08-31 22:25:00 +00:00
Yi Kong 924adc4d17 Add BuiltinsRuntimeLibrary
... and rename SanitizerRuntimeLibrary to LibclangRuntimeLibrary since
some of them are not sanitizers.

Bug: 29275768
Test: m
Change-Id: Id638adea42d22b02438fce26120aa155bea14d42
2018-08-31 14:53:54 -07:00
Logan Chien 105812f5d7 Check ABI stability of all NDK libs
am: f4b79c684a

Change-Id: I04b790128b034373625ec47ecf1b51a929a7063a
2018-08-30 22:49:58 -07:00
Logan Chien f4b79c684a Check ABI stability of all NDK libs
This commit extends ABI stability checks to all NDK shared libs
(including the framework-related ones such as libandroid.so).

Bug: 112404572
Bug: 79576032
Test: make findlsdumps  # (and check the output)
Change-Id: I0147c60ce0c90d187f85b996911d98326a0c37ae
2018-08-31 02:55:28 +00:00
Colin Cross 2ddd61f238 Merge "Skip DepsMutator on disabled modules"
am: 418d261481

Change-Id: Id3f90a67abae7483b1b0697790854aff0a8d5bda
2018-08-30 16:21:52 -07:00
Pirama Arumuga Nainar ecdcb62d22 Use Windows security mitigation features: ASLR, DEP
am: 191f646295

Change-Id: Ie182452ca1ac3a9fb959fd887421763445c646e4
2018-08-30 16:21:36 -07:00
Treehugger Robot 418d261481 Merge "Skip DepsMutator on disabled modules" 2018-08-30 22:56:32 +00:00
Yi Kong 0098166cb4 Prebuilts shouldn't inherit linker interface
Prebuilts doesn't go through linking stage, thus it should not inherit
any dependencies or flags from linker.go.

Test: m checkbuild
Bug: 29275768
Change-Id: I1f1dc5d65c2fc2dd905e8df44e08d5c83b224d0c
2018-08-30 14:33:06 -07:00
Colin Cross 6db4a6a7d9 Skip DepsMutator on disabled modules
Dependencies of disabled modules may not have the right variations
for calling AddVariationDependencies, skip DepsMutator completely
on disabled modules.

Bug: 112707915
Test: m checkbuild
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: I702e591437e5e6eb9f91f3b7eb32bacc4bd5d249
2018-08-30 19:54:37 +00:00
Pirama Arumuga Nainar 191f646295 Use Windows security mitigation features: ASLR, DEP
Bug: https://issuetracker.google.com/36952278
Bug: http://b/113171785

From
https://android-review.googlesource.com/c/platform/system/core/+/737292:

The --dynamicbase linker flag enables use of Address Space Layout
Randomization (ASLR) on Windows Vista and newer. It causes the code
segment / module to be loaded at unpredictable addresses to make
exploits harder to construct.

The --nxcompat linker flag enables use of Data Execution Protection
(DEP) on Windows XP SP2 and newer. It causes the process to be killed if
the process tries to execute code on memory pages not marked executable.
This makes exploits harder to construct because the stack is then not
executable, other data pages aren't, etc.

These bits are already set on AdbWinApi.dll and AdbWinUsbApi.dll.

--high-entropy-va provides improved ASLR.

Credit: Spencer Low for doing the initial work at
https://android-review.googlesource.com/c/platform/system/core/+/737292.

Test: Verify that DLLCharacteristics reported by 'objdump -x' is:
      0x140 for 32-bit and 0x160 for 64-bit.  Also verified trivial use
      cases under Wine.

Change-Id: I1b898cd36c7c627916dae9ce7dfd1c27de1e3c59
2018-08-30 12:54:33 -07:00
Colin Cross 8155b5e83f Enforce dependencies have right architecture
am: 42d48b7b8b

Change-Id: Ia68fc583549e503da719a40c83a37002fe33bca5
2018-08-30 11:25:59 -07:00
Colin Cross 42d48b7b8b Enforce dependencies have right architecture
ctx.AddDependency will succeed if the named dependency only has a
single variant, even if that variant is the wrong architecture.
Use ctx.AddVariationDependency(nil, ...) instead, which requires
that all variations of the calling module match the dependency.

Bug: 112707915
Test: no change to out/soong/build.ninja
Test: using a device dependency in a host java module is an error
Change-Id: I70b661a57d4412eb63b8c9841febfb756e9e025d
2018-08-30 16:31:02 +00:00
Steven Moreland fa287846ea Add libbinder_ndk to the NDK.
Bug: 111445392
Test: atest android.binder.cts.NdkBinderTest
Change-Id: If7e25f6e856524c531c41dacf3e7f798f42cc7a5
2018-08-29 21:45:51 -07:00
Dan Willemsen d83ba979f4 Clean up darwin cc toolchain
am: e97e68a05a

Change-Id: I3adf41a6b8eab2bee60c518fb9465ad70de9d9e5
2018-08-28 21:24:07 -07:00
Dan Willemsen e97e68a05a Clean up darwin cc toolchain
Remove the ability for Soong to build 32-bit darwin code. We've already
disabled this in Make, this is just removing the unused bits in Soong
and simplifing the toolchain config.

Test: m host
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I968c5d98bdf162297d639f7988918dadb7ba6e07
2018-08-28 20:08:50 -07:00
Dan Willemsen 58f6fed8e2 Merge "Support Mac 10.14 SDK"
am: 6dcc81c3c6

Change-Id: I0231c56f893d13be29a571669df7604f91a5873f
2018-08-28 19:04:43 -07:00
Treehugger Robot 6dcc81c3c6 Merge "Support Mac 10.14 SDK" 2018-08-29 01:53:42 +00:00
Evgenii Stepanov 9db38882cf Merge "Pass hwasan extra cflags to make."
am: 9f7cb4e22c

Change-Id: Id3b97cefdaa2212c58565e66dab64b9e8e5a052c
2018-08-28 17:18:10 -07:00
Dan Willemsen 5a050c0183 Support Mac 10.14 SDK
Now that we don't compile 32-bit binaries, this seems to work, at least
in Xcode 10 beta 6.

Test: m checkbuild host
Change-Id: I61a98a3c31b331d6d01cd633f8d949fad86047cb
2018-08-28 16:48:45 -07:00
Evgenii Stepanov a6302337c8 Pass hwasan extra cflags to make.
Bug: 112438058
Test: SANITIZE_TARGET=hwaddress
Change-Id: If57e5f4cf78037992936ce94a98f017676b7e74b
2018-08-28 13:51:05 -07:00
Chih-hung Hsieh 4cef9cbbad Merge "Define PATH_TO_CLANG_TIDY_SHELL for build/make rules."
am: 4b42edbca0

Change-Id: Ie19f560057ef5d3e2ef0671e8af42dd3d1261626
2018-08-28 12:21:36 -07:00
Chih-hung Hsieh 4b42edbca0 Merge "Define PATH_TO_CLANG_TIDY_SHELL for build/make rules." 2018-08-28 18:18:32 +00:00
Jiyong Park 58918f3e69 Merge "link type of recovery variant of a vendor module should not be native:vendor"
am: c842742f5d

Change-Id: I934a5dcb8dfb84d3e1e044ada1d2c2dd25c3fbff
2018-08-28 07:27:46 -07:00
Jiyong Park 5baac54d58 link type of recovery variant of a vendor module should not be native:vendor
This CL fixes a bug that when a module is configured as 'vendor: true' &&
'recovery_available: true', the link type of the recovery variant of the
module is incorrectly set to 'native:vendor'. This was because,
androidmk.go emits 'LOCAL_PROPRIETARY_MODULE := true' whenever
Proprietary property is set to true, regardless of whether it is a
recovery variant or not. This in turn makes LOCAL_USE_VNDK := true for
the module which in turn causes the link type to be 'native:vendor'.

Fixing the bug by resetting the properties like Proprietary, Vendor,
Soc_specific, etc. for the recovery variants.

Bug: 113277544
Test: m -j (test added)
Change-Id: I5d6ae76e46ef8fcd9204d386d0809862a7b0ff7e
2018-08-28 10:03:17 +09:00
Chih-Hung Hsieh b699c43f89 Define PATH_TO_CLANG_TIDY_SHELL for build/make rules.
* PATH_TO_CLANG_TIDY_SHELL is ${config.ClangTidyShellPath},
  wich is "build/soong/scripts/clang-tidy.sh"

Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I27d7be095c998583fa9ad4d705aa1332bd018140
2018-08-27 16:19:59 -07:00
Ryan Prichard f867f36e2f Merge "NDK sysroot: include each license file only once"
am: 09664bd9a5

Change-Id: I4f84c5adb80b0e368c881ffe53cf0f50bf24e9e4
2018-08-24 15:53:23 -07:00
Treehugger Robot 09664bd9a5 Merge "NDK sysroot: include each license file only once" 2018-08-24 22:40:32 +00:00
Ryan Prichard b1c9d40b6f NDK sysroot: include each license file only once
bionic/libc/NOTICE file is 6000 lines long and is referenced by 10
modules in bionic/libc/Android.bp. We're currently including 10 copies of
the license file, which makes it hard to view a "platform prebuilts" CL
in Gerrit.

For example, click "Expand All" on:
https://android-review.googlesource.com/c/platform/prebuilts/ndk/+/730825

Bug: none
Test: m out/soong/ndk.timestamp
Change-Id: I857e70d7d900688532ab988800c98bbd0899cc31
2018-08-24 13:28:04 -07:00
Chih-Hung Hsieh 1cc0227af2 Remove flto dependent flags when -flto is removed.
am: 9e88ba9f22

Change-Id: I174a627fe877f66b81ae889a82eefadff8216dc4
2018-08-24 12:53:01 -07:00
Chih-Hung Hsieh 9e88ba9f22 Remove flto dependent flags when -flto is removed.
* C++ source files could be compiled with "-fwhole-program-vtables"
  in cppflags. We need to filter out those flto dependent flags
  in flags.CppFlags and use flags.toolingCppFlags instead of
  flags.cppFlags.

Test: build with WITH_TIDY=1
Change-Id: Ic2b0f99b95a5f0422f879226e6f6060cab71456a
2018-08-24 18:42:22 +00:00
Chih-hung Hsieh 5761ca65c6 Merge "Add clang-tidy.sh to filter out troublesome flags."
am: a644fbfa2c

Change-Id: I79f64979576431e85d6196110615450da1c4eea3
2018-08-23 15:34:55 -07:00
Chih-Hung Hsieh a7aa958e6e Add clang-tidy.sh to filter out troublesome flags.
* Some flags are accepted by clang but not clang-tidy.
  They could cause the diagnostic-unused-command-line-argument warning.
  Flag -flto messed up the -I flags.
* Add clang-diagnostic-unused-command-line-argument to
  default clang-tidy checks.
* Move CLANG_TIDY_UNKNOWN_CFLAGS to build/make/core/clang/tidy.mk.

Bug: 111850071
Bug: 111885396
Test: build with WITH_TIDY=1
Change-Id: Iabeeb27715acf83ef6aafe3e77206b9a01a0d889
2018-08-22 09:21:45 -07:00
Evgenii Stepanov 72a8984921 Merge "Add "hwaddress" sanitizer."
am: 9b4f9afbaf

Change-Id: I163b6cbcf9c14ee6fd7a55b86f5db642abe52d0a
2018-08-20 17:11:00 -07:00
Treehugger Robot 9b4f9afbaf Merge "Add "hwaddress" sanitizer." 2018-08-20 23:22:35 +00:00
Evgenii Stepanov d97a6e9483 Add "hwaddress" sanitizer.
This is a new sanitizer similar to ASan, but with a few differences
from the build system perspective:
* Only runs on AArch64.
* Supports static binaries.
* Bionic itself will be built with HWASan.
* Does not have any "if a library is sanitized than the binary must
  be, too" requirements unlike ASan. Even better, individual static
  libraries can be freely sanitized or not. We propagate "nosanitize"
  from binaries to static libraries anyway, because otherwise there
  is no good way to disable hwasan on a binary as a whole.

Same a CFI, we export a list of sanitized static libraries to make.
In fact, we export separate lists for vendor and regular libraries,
because it is possible for one to be sanitized without the other
(i.e. there can be mylib.hwasan.vendor w/o mylib.hwasan or vice
versa).

Bug: 112438058, 112709969
Test: manual, part of a bigger patch set

Change-Id: Ie4fdeb522ac03cf9684526882e84dfee3807b6a7
2018-08-16 13:18:47 -07:00
Colin Cross f83e82933e Move autogenerated test config into Soong
am: 303e21f695

Change-Id: Ia2a12f6a398b8273e4c726b95e7e84a4825c7518
2018-08-14 19:34:04 -07:00
Colin Cross 303e21f695 Move autogenerated test config into Soong
Move autogenerating the test config for Soong modules into Soong
for java_test and android_test modules.

Bug: 70770641
Test: m checkbuild
Test: atest CtsUiRenderingTestCases
Change-Id: I02593add0407ef694b91c14cf27411a4f3cc4745
2018-08-14 15:44:08 -07:00
Logan Chien 70c797395f Merge "Support prebuilt shared libs end with versions" am: 0c3b508d2b
am: 31e8907827

Change-Id: Ic37a0c2e5c4c02dd42d13cb3bc413e40cfeb67f8
2018-08-12 19:01:34 -07:00
Logan Chien 0c3b508d2b Merge "Support prebuilt shared libs end with versions" 2018-08-13 01:52:23 +00:00
Hridya Valsaraju 80f85655a0 Add exclude_header_libs for recovery_available:true libs am: 280febfb14
am: 877a4c1fbc

Change-Id: Ie1b482962df94f4746c629d7fe93a8cd535cedb9
2018-08-10 12:30:40 -07:00
Hridya Valsaraju 280febfb14 Add exclude_header_libs for recovery_available:true libs
Bug: 78793464
Test: mmm
libhardware needs to be made available in recovery without
exporting bluetooth and audio headers.

Change-Id: Ib1d1bcda49abccfb9a4768580e1c1d92ead68773
2018-08-10 09:35:47 -07:00
Jiwen 'Steve' Cai e5d9bde094 Add exclude_header_libs for vendor_available:true libs am: 8dbc653dff
am: 76180a8c7d

Change-Id: I455cbcb8e1ad894213fb4047d44d156b730d7fac
2018-08-09 23:06:04 -07:00
Jiwen 'Steve' Cai 8dbc653dff Add exclude_header_libs for vendor_available:true libs
Adding a mechanism to conditionally exclude some header library
dependencies when a lib is built for vendors.

Without this, some libraries cannot be earily marked as vendor_available
if they are depending on header libs can shouldn't be marked as
vendor_available.

By using exclude_header_libs with exclude_srcs (or __ANDROID_VNDK__
macro), we can eliminate the unnecessary dependency for vendors.

Bug: 112338314
Test: build
Change-Id: If12dceb6045099fe828fe33af2ac4428f88499a2
2018-08-09 21:19:32 -07:00
Dan Albert 0d205d4d85 Dedup version-script handling code. am: 61f32128aa
am: 3475e072b6

Change-Id: I95eb9b85c90ef5c19921f1895cbbd57763cc44c7
2018-08-09 11:51:26 -07:00
Logan Chien 031d2b32e3 Support prebuilt shared libs end with versions
This commit changes how `cc/androidmk.go` generates LOCAL_MODULE_STEM,
LOCAL_MODULE_SUFFIX, and LOCAL_BUILT_MODULE_STEM.  Now, `splitFileExt()`
takes a file name and a list of expected file extensions.
`splitFileExt()` searches the first occurrence of expected file
extensions in the file name.  If it can not find any, it will simply
return the last file extension.

Before this commit, `cc/androidmk.go` simply extracts the last file
extension (e.g. `.so`).  However, if the prebuilt shared libs end with
version numbers (e.g. `libc++.so.1`), it will use `$(LOCAL_MODULE).1` as
LOCAL_BUILT_MODULE_STEM and this will lead to missing target ninja
error.

Bug: 111579848
Test: Build a program that links libc++_host (from prebuilts/clang)
Change-Id: Id96726c69705d518ea725bb6abd8ff4527ca0cbc
2018-08-09 10:45:18 +08:00
Dan Albert 61f32128aa Dedup version-script handling code.
This is common to binaries and libraries, so move it from library.link
and binary.link to baseLinker.linkerFlags and baseLinker.linkerDeps.

Test: make checkbuild
Bug: None
Change-Id: I5fb24118e601673ae0713a6adc773a1565749be8
2018-08-08 14:36:34 -07:00
Julien Desprez eee05612fe Merge "Support 'test_config' into soong modules" am: 7a127f97b6
am: 687965c36b

Change-Id: I4cdc3ed50e813c85951372383a707d0dc3e19793
2018-08-08 10:59:39 -07:00
Julien Desprez e146e39fa6 Support 'test_config' into soong modules
Test: make general-tests
Bug: 110982517
Change-Id: Ib2eab2653fdfce6f699b85c9fbc64558b6d40363
2018-08-07 15:51:21 -07:00
Logan Chien 42cf4b8715 Merge "Remove LinuxClangCppflags" am: 7a1d4418d6
am: dc9321b257

Change-Id: I0988dcf773d249db6b636c936bc4b6b05e79f686
2018-07-31 11:00:34 -07:00
Logan Chien dc9321b257 Merge "Remove LinuxClangCppflags"
am: 7a1d4418d6

Change-Id: I5507797e2ff5e7c08b9dfd1d04d15d29c290ac69
2018-07-31 10:56:27 -07:00
Logan Chien 7a1d4418d6 Merge "Remove LinuxClangCppflags" 2018-07-31 17:51:17 +00:00
Logan Chien bef00a2c52 Remove LinuxClangCppflags
This commit removes LinuxClangCppflags.  Adding these `-isystem` flags
results in build failures when we build a module with `libc++_host`.
Furthermore, these headers are not being used anymore.

Bug: 111579848
Test: make checkbuild  # on aosp and internal
Change-Id: Ideca268431d9d60d383e3e5b7bb3f73ece416bd2
2018-07-31 01:45:00 +08:00
Chih-Hung Hsieh bafbeac702 Do not pass -flto dependent flags to clang-tidy. am: ff7cff7268
am: 9e7e09b77a

Change-Id: Ia26281d74e74cb4aa6f111e2273a012e9a266350
2018-07-26 20:23:10 -07:00
Chih-Hung Hsieh 9e7e09b77a Do not pass -flto dependent flags to clang-tidy.
am: ff7cff7268

Change-Id: I0da058960c67b69ecf2df63e5f2b385b82eea80e
2018-07-26 20:19:07 -07:00
Chih-Hung Hsieh ff7cff7268 Do not pass -flto dependent flags to clang-tidy.
Bug: 111885396
Test: run with WITH_TIDY=1
Change-Id: I92468491cdc5894d1197f6c1631e2073c6e7c4fa
2018-07-26 17:43:12 -07:00
Chih-Hung Hsieh d31b3f87dd Merge "Do not pass -flto and -fsanitize flags to clang-tidy." am: 9f65ef8cd9
am: 167d8c77ba

Change-Id: Ibe7416e9ae2b5b1f73dda5862a3c3eebda33bc60
2018-07-26 17:04:54 -07:00
Chih-Hung Hsieh 167d8c77ba Merge "Do not pass -flto and -fsanitize flags to clang-tidy."
am: 9f65ef8cd9

Change-Id: I7edbaaa8cccabe2b2952fa88499bdfbecfecf60a
2018-07-26 16:59:42 -07:00
Chih-Hung Hsieh 5942fe4fd1 Do not pass -flto and -fsanitize flags to clang-tidy.
Some flags stop clang-tidy to search included header files.

Bug: 111885396
Test: run with WITH_TIDY=1
Change-Id: Ie1ac37298793c015286db0f5caa252b67f4db365
2018-07-26 15:00:28 -07:00
Ryan Prichard 07c5952b1d Revert part of "Stop versioning NDK stubs pre-M." am: 37ebbdee6c
am: 81947d241c

Change-Id: I49be6f68894928f09557305d8ddedf5616b9c1e7
2018-07-24 17:14:57 -07:00
Ryan Prichard 81947d241c Revert part of "Stop versioning NDK stubs pre-M."
am: 37ebbdee6c

Change-Id: Icd202a99e39622e9d788763bf819a0d7be5acfad
2018-07-24 17:05:41 -07:00
Dan Albert 6bc5b8320f Stop versioning NDK stubs pre-M.
Test: make ndk # readelf various stubs to check version info
Bug: https://github.com/android-ndk/ndk/issues/622
Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
(cherry picked from commit c229f38e93)
2018-07-24 22:52:57 +00:00
Ryan Prichard 37ebbdee6c Revert part of "Stop versioning NDK stubs pre-M."
This reverts commit e67144e302.

Keep the getApiLevelsMap function and keep using it in
shouldUseVersionScript. It seems useful. (Also, keeping it probably avoids
an AOSP->internal merge conflict...)

Bug: https://github.com/android-ndk/ndk/issues/750
Test: m out/soong/ndk.timestamp, examine dynsym in stubs
Change-Id: Icbb26fc46a9a1dc99f22af195468f08713c4f216
2018-07-24 12:46:35 -07:00
Dan Willemsen 6f952934cb Remove `clang: false` support am: 742a5453c2
am: 4713e25788

Change-Id: Ib39f9ad249a632ac4d8024a5c37a29f096c6ae1f
2018-07-23 19:26:00 -07:00
Dan Willemsen 4713e25788 Remove `clang: false` support
am: 742a5453c2

Change-Id: Idcb738ca7cb39882157f36ca44ef492fe2a8b0a0
2018-07-23 19:20:56 -07:00
Dan Willemsen 742a5453c2 Remove `clang: false` support
Most everything in Soong is using clang (and we're getting very close
for Make as well), so remove the ability to select GCC to build a
module.

We still need to keep the internal functionality around to find libgcc.a
and other toolchain_library modules with GCC.

Test: m blueprint_tools
Change-Id: I5ef3e3836b9ad3e160669ac32aee39698c9b72c3
2018-07-23 17:19:36 -07:00
Dan Willemsen 7c6bbd6c1f Fix `go vet` issues am: 59339a29e1
am: af42826aee

Change-Id: I6e8d7a9d3abb13b035e394f7c0657d49d64f8b5b
2018-07-22 23:28:00 -07:00
Dan Willemsen af42826aee Fix `go vet` issues
am: 59339a29e1

Change-Id: I6c5de64ee36c1dde4e043b36f84d2cf140afac41
2018-07-22 23:23:59 -07:00
Dan Willemsen 59339a29e1 Fix `go vet` issues
Test: go vet ./...
Change-Id: Ifb936ccc5e2b5a2c3fcbbbcb54f680e2973ea1b3
2018-07-22 21:18:45 -07:00
Logan Chien 68fa0cfc5a Merge changes I420a5953,I8e2352f3,I7a6bb905 am: 23be383843
am: 8847412281

Change-Id: I8438e42982d62a68f4dea625e2b9c3f0bd444545
2018-07-18 21:26:21 -07:00
Logan Chien 8847412281 Merge changes I420a5953,I8e2352f3,I7a6bb905
am: 23be383843

Change-Id: Ie35e110f38405cb018a887274c6099456844c454
2018-07-18 21:22:24 -07:00
Treehugger Robot 23be383843 Merge changes I420a5953,I8e2352f3,I7a6bb905
* changes:
  Support text ABI dump file format
  Remove vndkVsNdk()
  Remove isSourceDump from PathForVndkRefAbiDump()
2018-07-19 04:15:30 +00:00
Treehugger Robot cdf399c40a Merge "Stop versioning NDK stubs pre-M." 2018-07-18 01:13:49 +00:00
Dan Albert e67144e302 Stop versioning NDK stubs pre-M.
Test: make ndk # readelf various stubs to check version info
Bug: https://github.com/android-ndk/ndk/issues/622
Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
2018-07-17 23:26:00 +00:00
Dan Albert c229f38e93 Stop versioning NDK stubs pre-M.
Test: make ndk # readelf various stubs to check version info
Bug: https://github.com/android-ndk/ndk/issues/622
Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
2018-07-13 13:25:33 -07:00
Jiyong Park 84e78c4973 Merge "Don't create non-primary arch variant for recovery-only module" am: 9ea9fc3dee
am: 7f413148ed

Change-Id: I7aa7634ee2ece3c39b1dcaebccfedf7d785857f1
2018-07-12 18:44:11 -07:00
Jiyong Park 7f413148ed Merge "Don't create non-primary arch variant for recovery-only module"
am: 9ea9fc3dee

Change-Id: Ibe1274c36c9233ee396d323544c6aa599f635ae5
2018-07-12 17:14:44 -07:00
Jiyong Park 37b252096a Don't create non-primary arch variant for recovery-only module
To save space, only the primary arch variant is installed to the
recovery partition. This has been done in the imageMutator by not
creating recovery variant for the non-primary arch.

However, this caused a problem for recover-only module, i.e., recovery:
true. Such module ends up creating no variant for the non-primary arch.
Since every other modules are at least in one image variant, any
dependency fro such module with no image variant can't be satisfied.

In order to solve the problem, archMutator is modified to create only
the primary arch for recovery-only modules.

Bug: 111321972
Test: m -j (TestRecovery added)
Change-Id: Ie32ae06fb094efcfd8531cdf6071139d292d93ab
2018-07-12 10:49:30 +09:00
Logan Chien 7eefdc4ed2 Support text ABI dump file format
This commit adds an option to read ABI reference dump in text file
format directly from `prebuilts/abi-dumps`.  If both the text file and
the gzip format exist, an error will be emitted.

Bug: 78650426
Test: create libexif.lsdump.gz and it works as usual
Test: create libexif.lsdump (decompressed) and it works
Test: touch both libexif.lsdump.gz and libexif.lsdump and it errors
Change-Id: I420a5953fb80855cb5c07e5a4d347fb6709f0340
2018-07-11 18:37:50 +08:00
Logan Chien 5237bed1c4 Remove vndkVsNdk()
This commmit removes `vndkVsNdk()`, which is essentially
`!inList(ctx.baseModuleName(), llndkLibraries)`.

Test: lunch aosp_arm64_ab-userdebug && make
Change-Id: I8e2352f302df30057997944678f176f4550d3f75
2018-07-11 17:30:39 +08:00
Logan Chien 83c415f955 Remove isSourceDump from PathForVndkRefAbiDump()
This commit removes `isSourceDump` from `PathForVndkRefAbiDump()`
because the binary dump paths are not being used at all.

Test: lunch aosp_arm64_ab-userdebug && make
Change-Id: I7a6bb9053a6b052590fb1152982949fee897df8d
2018-07-11 15:27:36 +08:00
Logan Chien 2fbf1cba9d Merge "Cleanup createVndkSourceAbiDump()" am: f33dca0ada
am: 322ab10d5a

Change-Id: I0e1abe56f73cb0285e14b26ac13217978ff36aeb
2018-07-10 20:23:14 -07:00
Logan Chien 322ab10d5a Merge "Cleanup createVndkSourceAbiDump()"
am: f33dca0ada

Change-Id: I4be5bfa5f3c9affc946942f9dd6915c1f36e0e65
2018-07-10 20:18:54 -07:00
Logan Chien 2f2b890a18 Cleanup createVndkSourceAbiDump()
This commit cleans up `createVndkSourceAbiDump()` and renames it to
`shouldcreateVndkSourceAbiDump()`.

Test: lunch aosp_walleye-userdebug && make
Change-Id: Iff4379e2812c4b5c5baff288b938eed5d92e024f
2018-07-10 15:03:44 +08:00
Jiyong Park 236c6202b5 Merge "Fix: recovery module is disabled on 32-bit targets" am: bdf16ec5b2
am: 0d08b06820

Change-Id: I82f5dad19bdb10083c13441a6ca525ff97478bb1
2018-07-09 18:54:40 -07:00
Jiyong Park 0d08b06820 Merge "Fix: recovery module is disabled on 32-bit targets"
am: bdf16ec5b2

Change-Id: Ice8e0442c79ec3d673f33e8f8a229c1eccaa8b78
2018-07-09 18:45:11 -07:00
Jiyong Park 8d52f86baf Fix: recovery module is disabled on 32-bit targets
Fixed a bug that recovery variant of a module is not created on 32-bit
targets. The bug was happening because the creation of the recovery
variant relied on DevicePrefer32BitExecutables() which returns false
for 32-bit only targets.

Now, recovery variant is checked against the primary architecture of the
device that is returned by DevicePrimaryArchType().

Test: m -j adbd.recovery on aosp_arm and aosp_arm64
adbd is built under recovery/root/system/bin and it is ELF32 and ELF64,
respectively for the targets.
Test: m -j libc.recovery on aosp_arm, aosp_arm64, aosp_sailfish
and the x86+arm target in mater. Only one libc.so is installed
under recovery/root/system/lib (or lib64).

Change-Id: I83a248d81f2c71dcfb0e9d887a75b71338f27b4d
2018-07-08 09:43:10 +09:00
Steven Moreland 77debe2167 Merge "aidl: -ninja -> --ninja" am: 17bef8f034
am: b3fec2c4c2

Change-Id: Ib47a96dc4e91caafccff9ce31a2b29404c4cc3ea
2018-07-06 17:29:18 -07:00
Steven Moreland b3fec2c4c2 Merge "aidl: -ninja -> --ninja"
am: 17bef8f034

Change-Id: I9745a188c77ede18c1a106239cba35abd25fea2c
2018-07-06 17:24:57 -07:00
Steven Moreland b468bca551 aidl: -ninja -> --ninja
Bug: 110967839
Test: AIDL's runtests.sh
Change-Id: I49c0a2526b6d4083c927104a3e66017080000847
2018-07-06 11:36:32 -07:00
Yi Kong c888227e7d Merge "Revert^6 "Move -Wno-enum-compare{,-switch} to external cflags""
am: c415116333

Change-Id: I352ec6a79d3d525c17bde9eceaf3b348b63d6a9a
2018-06-29 17:18:21 -07:00
Pirama Arumuga Nainar 8db11184e6 Merge "Remove unsupported/unused No_pie property"
am: b830e84821

Change-Id: Ief33f0e4bcf5c9323e012e4cefbc8e957eba6a34
2018-06-29 17:06:16 -07:00
Yi Kong c415116333 Merge "Revert^6 "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-30 00:03:55 +00:00
Pirama Arumuga Nainar 19fae4e803 Remove unsupported/unused No_pie property
Bug: http://b/111000882

Doesn't seem to be supported.

Test: AOSP build, TreeHugger
Change-Id: Idaab52caa876102b062b3c21acd42c37328bd328
2018-06-29 14:57:46 -07:00
Yi Kong e1e83e4279 Revert^6 "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit c729b508c3.

Reason for revert: New breakages fixed

Change-Id: I8b5e597fdb2af782d591ddcf5b4e7534273a2e7b
Merged-In: I8b5e597fdb2af782d591ddcf5b4e7534273a2e7b
2018-06-29 20:35:35 +00:00
Roland Levillain cda6b350c6 Merge "Revert^5 "Move -Wno-enum-compare{,-switch} to external cflags""
am: cf96428ef4

Change-Id: I5521b4b7e10da012897018333e1209e00742f3f3
2018-06-29 02:45:53 -07:00
Roland Levillain cf96428ef4 Merge "Revert^5 "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-29 09:37:42 +00:00
Yi Kong c729b508c3 Revert^5 "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit e0050ebda1.

Reason for revert: Breaks build

Change-Id: I01bc218553ae6efb6140b66f035ccb129d3e5028
2018-06-29 08:19:46 +00:00
Yi Kong 71fd304741 Merge "Revert^4 "Move -Wno-enum-compare{,-switch} to external cflags""
am: e758c83bb5

Change-Id: I16b295a98f503685db2bd4ec1a91b52d93f65ab7
2018-06-29 00:03:50 -07:00
Yi Kong e758c83bb5 Merge "Revert^4 "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-29 06:57:27 +00:00
Yi Kong e0050ebda1 Revert^4 "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit 8ad44855e6.

Reason for revert: Breakage fixed, try again

Change-Id: Ia648b9513d2224a5e363b65f44f9b2f838db1d3d
2018-06-28 21:05:34 +00:00
Pirama Arumuga Nainar e4f89be932 Do not set entry-point for Windows
am: 204165320e

Change-Id: I7db0a7134cc7a6ae85b624d58e72794e0dd53bca
2018-06-27 13:26:41 -07:00
Pirama Arumuga Nainar 204165320e Do not set entry-point for Windows
Bug: http://b/62424007

This breaks 64-bit Windows executables.  Probably due to the Clang
migration, the entry-point need not be set even for 32-bit executables.

Test: 32-bit and 64-bit aapt2_tests.exe and ziparchive-tests.exe can
start.  (There are some failed tests, though).

Change-Id: Id3a7d3d2802f6b671332afff4558840bdabddeb5
2018-06-27 11:27:06 -07:00
Pirama Arumuga Nainar b6682c47b8 Merge "Do not enable sanitizers on Windows"
am: d7e5c05eac

Change-Id: I7398e6b08154c5bc7fad0507bd9e1dae8c14da0a
2018-06-26 17:05:30 -07:00
Pirama Arumuga Nainar 83d716c413 Do not enable sanitizers on Windows
Bug: http://b/69933068

Test: m native-host-cross SANITIZE_HOST=address
Change-Id: Ia9ff941fb569b0a2e9c4eef604fd165f94bca31a
2018-06-26 14:18:16 -07:00
Pirama Arumuga Nainar cd53ba1bab Merge changes from topic "mingw-clang"
am: 9d951a10f3

Change-Id: Ie7e0794c98d4b0d317cea9f1d2bf2c02e760b1e5
2018-06-26 12:54:17 -07:00
Pirama Arumuga Nainar 9af0f2d42a Use -static-libgcc for Windows
am: abf1b31a20

Change-Id: Id8eea1c93a97061fa6e50df7c9ba06a9ec62d306
2018-06-26 12:54:01 -07:00
Treehugger Robot 9d951a10f3 Merge changes from topic "mingw-clang"
* changes:
  Use clang for windows host modules
  Use -static-libgcc for Windows
2018-06-26 19:47:53 +00:00
Chih-hung Hsieh 52bd011b72 Merge "Define CLANG_TIDY_UNKNOWN_CFLAGS for build/make."
am: 95894d8ffe

Change-Id: Iac0463e8b7b8603e5d10f84e26aac7cccafc37ec
2018-06-26 10:03:25 -07:00
Pirama Arumuga Nainar 8a852e7694 Use clang for windows host modules
Bug: http://b/69933068

- Remove GCC's intrinsic header path so Clang's headers get included.
- Add '-B' with GCC's binary directory so Clang detects the linker.
- Bug: http://b/109759970 - Pass '--allow-multiple-definition' linker
flag to deal with ld.bfd's inability to handle Clang-generated section
names is fixed.
- Bug: http://b/110800681 - lld cannot link Android's Windows modules
yet

Test: m native-host-cross and run adb_test.exe under wine.

Change-Id: I9be9cfc34a47cbeee04024438dea214305112eaa
2018-06-25 18:36:50 -07:00
Pirama Arumuga Nainar abf1b31a20 Use -static-libgcc for Windows
Bug: http://b/69970955

With the MinGW prebuilts update (http://aosp/709402), executables get a
runtime dependency on libgcc_s_sjlj-1.dll with both gcc and Clang.
Passing -static-libgcc removes this dependency and is a better option
than having to package an extra dll with executables.

Test: Run gcc-built adb_test.exe under wine
Change-Id: I18e5fadb1b8ace510ae684e2d4cfa7fe7d007cff
2018-06-25 18:31:01 -07:00
Chih-Hung Hsieh ad47a27d9c Define CLANG_TIDY_UNKNOWN_CFLAGS for build/make.
Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I6c5b5a0cb3ad3c2756bbae5e7c0234a0dafe5991
2018-06-25 13:48:42 -07:00
Colin Cross e98238b3ab Merge "Use WalkDeps instead of VisitDepsDepthFirst"
am: cbafd0fb48

Change-Id: Ic22ffa9ac8a5e3b5c29cd5e85664acb1afebc04f
2018-06-22 17:14:31 -07:00
Colin Cross 6b75360cbc Use WalkDeps instead of VisitDepsDepthFirst
VisitDepsDepthFirst is almost never correct, as it can't query
dependency tags of multiple dependencies between the same two modules.
Replace VisitDepsDepthFirst with WalkDeps in sanitize.go and
python.go.  Also verify the dependency tag before continuing to
recurse to ensure that they don't recurse through genrules and into
unrelated modules.

Test: m checkbuild
Change-Id: I2f7560126f56b51a40ec39dfbdcc18b5891489f7
2018-06-22 12:44:35 -07:00
Jiyong Park 48bdb37b4a Merge "Recovery partition uses the first architecture only"
am: 87e50a0d14

Change-Id: I2da330f2a4062039f83ecb90800e65595982ad32
2018-06-19 18:20:35 -07:00
Treehugger Robot 87e50a0d14 Merge "Recovery partition uses the first architecture only" 2018-06-20 01:11:10 +00:00
Kostya Kortchinsky 9cba8204b1 Soong support for Scudo
am: d18ae5ce98

Change-Id: I0c0fcf29ccd99575de573a915c7da5d51b14cd45
2018-06-19 13:11:58 -07:00
Kostya Kortchinsky d18ae5ce98 Soong support for Scudo
Scudo is a hardened usermode allocator that is part of LLVM's compiler-rt
project (home of the Sanitizers). clang allows for -fsanitize=scudo as a
possible command line option to link the shared Scudo library to a binary.

This patch add Scudo as a potential sanitize option. Scudo is not compatible
with ASan and TSan and will be disabled if either is enabled.

Bug: 72112048
Test: aosp compiled with m -j
Test: local experiment with scudo: true to ensure that a test target
(tombstoned) could be linked with scudo.

Change-Id: I76bb6c60891d4782f6665a112c4c2bf7c31645da
2018-06-19 09:46:09 -07:00
Jiyong Park 413cc744b8 Recovery partition uses the first architecture only
To save space in the recovery partition, modules installed to the
partition are restricted to be built in the first architecure (i.e.,
32bit for 32bit-only device or when TARGET_PREFER_32_BIT is true, and
64bit otherwise).

Most notably, this change removes the 32-bit variant of the linker
(about 1MB). The linker was installed regardless of whether there is a
32-bit executable or not. Now, the unnecessary linker is not installed
and it is guaranteed that all modules in the partition are built with the
same architecture.

Bug: 79146551
Test: m -j
Test: out/target/product/<name>/recovery/root/system/bin/ has only one
variant of the linker.

Change-Id: I4070a43555bad4cfa8eff5253b09dcd004ea8251
2018-06-19 10:49:21 +09:00
Yi Kong 904ba56bb9 Merge "Remove workaround for cortex-a55/a75"
am: bbabc7b67e

Change-Id: Ic8cbeab81b1c75902c95bd5e2b4e9185a2f8feb6
2018-06-17 02:08:19 -07:00
Yi Kong 9c63363119 Remove workaround for cortex-a55/a75
Test: m checkbuild
Test: boot on a55/a75 device, pass bionic tests
Bug: 110235326
Change-Id: I5ab2102352a6efe1173b3097875e6e779d4a1a09
2018-06-15 23:15:54 +00:00