Commit graph

1795 commits

Author SHA1 Message Date
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
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