Commit graph

378 commits

Author SHA1 Message Date
Nikita Iashchenko
7a782203b9 Revert "C++17: switch the default."
This reverts commit c35fc0e130.

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

Change-Id: I70447a05ae5b2afa7efc7ab21c0432e651cab1ba
2018-11-30 11:15:16 +00:00
Elliott Hughes
c35fc0e130 C++17: switch the default.
Bug: http://b/111067277
Test: builds
Change-Id: I5065b03218772bf8cf8173f3d9808b3f0a484dc5
2018-11-28 21:45:23 -08:00
Elliott Hughes
37976122aa Bump "experimental" C++ to C++2a.
C++17 is so last year.

Test: treehugger
Change-Id: Ifd5e6d4a4837fe037837c49c31ee2fe1499e2d79
2018-11-28 14:16:39 -08:00
Treehugger Robot
4855c4f460 Merge "Add to support armv8-2a on 2nd arch. variant" 2018-11-14 00:51:53 +00:00
Pirama Arumuga Nainar
538be1f81c Switch to clang-r344140b
Bug: http://b/119270185

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

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

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

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

Reason for revert: The originating bug is now fixed.

Test: make checkbuild
Change-Id: Iabcfbeed5977336fc27fb1ccbad269c1fa81ef6e
2018-11-12 21:09:28 +00:00
Peter Collingbourne
abde584fd1 Stop passing the gold plugin path to llvm-ar.
llvm-ar takes a --plugin argument but it is ignored for compatibility,
so passing it has no effect.

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

Change no longer needed with the new LLVM toolchain update.

Bug: 112907825
Bug: 111759196
Change-Id: Ife3ce47a602dd850ac84bb51abc70c0ca157776e
2018-11-08 21:07:08 +00:00
Yi Kong
53ed59ef35 Update clang to r344140
Bug: 111759196
Test: Test various targets in AOSP and internal branches.
      For Googlers, go/clang-r344140-testing
Change-Id: I70fc5a2824de698d78c95ce2acd42eff9c5ebe15
2018-11-01 23:13:25 +00:00
Chih-hung Hsieh
c29e55d439 Merge "DO NOT MERGE, Make default -Wimplicit-fallthrough as error." 2018-11-01 17:51:41 +00:00
Alex Light
d6bb90dc0d Merge "Remove -fno-emulated-tls from linux_bionic" 2018-11-01 16:15:35 +00:00
Alex Light
a08ae8487c Remove -fno-emulated-tls from linux_bionic
This was preventing tools using 'thread_local' from compiling and is
not needed. Bionic fully implements TLS.

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

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

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

Change-Id: I83e28741e6b3cdf09566447d2658ce48594f2074
2018-10-25 13:40:28 -07:00
Peter Collingbourne
98d8580c3a Prevent clang from using the x18 register on arm64.
This is achieved via the compiler flag -ffixed-x18 for non-LTO builds
and the linker flag -plugin-opt -mattr=+reserve-x18 for LTO builds.

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

Bug: 112907825
Bug: 111759196
Change-Id: I05473ddbb98319d87d442425b4d715647eae3a38
2018-10-24 23:40:49 +00:00
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
Stephen Hines
f4fe6300e6 Merge "Switch to clang-r339409."
am: ee15f2a7c7

Change-Id: Ic7de9d629900ce71315029a82f32a89a11c730be
2018-10-01 09:20:41 -07:00