Commit graph

512 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
ecdcb62d22 Use Windows security mitigation features: ASLR, DEP
am: 191f646295

Change-Id: Ie182452ca1ac3a9fb959fd887421763445c646e4
2018-08-30 16:21:36 -07: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
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
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
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
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
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
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
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
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
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
Yi Kong
c415116333 Merge "Revert^6 "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-30 00:03:55 +00: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
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
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
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
Martijn Coenen
2de6cdcecb Merge "Revert "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags""""
am: 4de27d7e4f

Change-Id: Ia8ffa6818e19128e1a4c058a64c8b503435136d3
2018-06-13 00:51:05 -07:00
Martijn Coenen
4de27d7e4f Merge "Revert "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags"""" 2018-06-13 07:37:56 +00:00
Martijn Coenen
8ad44855e6 Revert "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags"""
This reverts commit cc4bbdccd3.

Reason for revert: breaks builds

Change-Id: Ia8908eb372ce46b23aea73283baf37add4477312
2018-06-13 07:36:05 +00:00
Yi Kong
0ca4f2e1d2 Merge "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags"""
am: 6da4f7d747

Change-Id: Ia388e92f279eac5a07dafbd241d879c280e0d156
2018-06-12 19:19:10 -07:00
Yi Kong
6da4f7d747 Merge "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags""" 2018-06-13 02:10:12 +00:00
Yi Kong
cc4bbdccd3 Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags""
This reverts commit 2f71a6adcd.

Change-Id: I09abb194b25813b8b1e4470b22171121cc3f8c11
2018-06-12 22:59:16 +00:00
Yi Kong
40a43808a4 Merge "Revert "Move -Wno-enum-compare{,-switch} to external cflags""
am: 04f0140479

Change-Id: Iff0ddb70ac23f8d4b6b97ce9a6c0f9ba11876a4c
2018-06-12 01:28:13 -07:00
Treehugger Robot
04f0140479 Merge "Revert "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-12 06:44:00 +00:00
Yi Kong
2f71a6adcd Revert "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit 96d221f914.

Reason for revert: build breakage for sdk target

Change-Id: I933df62738c08b48d8ae4ea951b2cb4837616c78
2018-06-12 04:51:49 +00:00
Yi Kong
d60cb4a7cc Merge "Move -Wno-enum-compare{,-switch} to external cflags"
am: 276e82ef2a

Change-Id: If341e9b12017430d0b54a6f35db9f57598217ee4
2018-06-11 20:51:20 -07:00
Chih-Hung Hsieh
c970278167 Merge "Add lld --no-rosegment flag to work with unwinder."
am: 01c66c199e

Change-Id: If38e1b593b1332982ac57e8d00c6d638c7126126
2018-06-11 20:50:44 -07:00
Yi Kong
276e82ef2a Merge "Move -Wno-enum-compare{,-switch} to external cflags" 2018-06-12 02:58:15 +00:00
Chih-Hung Hsieh
b18814e7a4 Add lld --no-rosegment flag to work with unwinder.
Bug: 109657296
Test: make checkbuild and boot
Change-Id: If8eda7ced31f5d4abb357935e9292b81936af6be
2018-06-11 15:07:34 -07:00
Yi Kong
96d221f914 Move -Wno-enum-compare{,-switch} to external cflags
Test: m checkbuild
Bug: 72330874
Change-Id: I8aaa020f5efafa8746b2c5ae29cea1a313a28045
2018-06-11 14:54:35 -07:00
Yi Kong
b9e2a10093 Merge "Revert "Revert "Add external projects only CFlags option""" am: 8d29e1e024
am: 2090540f19

Change-Id: I8d1872552155864a7fa175c9fc1b25031ed8bc76
2018-06-06 23:57:25 -07:00
Yi Kong
cc80f8d64f Revert "Revert "Add external projects only CFlags option""
This reverts commit a9ccbb7b87.

Test: m
Change-Id: I92d7b7707f73ef3af5824d3e8cb6da0465b5e07d
2018-06-06 16:41:26 -07:00
Kevin Rocard
0a5fee786f Revert "Add external projects only CFlags option"
This reverts commit 6a350878d8.

Reason for revert: Breakage of many AOSP targets

Change-Id: I917e6daa04ac02ecb98c7bb1816f9bdaf46429f5
2018-06-05 16:47:31 -07:00
Kevin Rocard
a9ccbb7b87 Revert "Add external projects only CFlags option"
This reverts commit 6a350878d8.

Reason for revert: Breakage of many AOSP targets

Change-Id: I917e6daa04ac02ecb98c7bb1816f9bdaf46429f5
2018-06-05 21:43:46 +00:00
Yi Kong
328ec9e7ee Add external projects only CFlags option am: 6a350878d8
am: 92e4e46184

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

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

TODO: Move more -Wno-* flags to ClangExtraExternalCflags

Test: m checkbuild
Change-Id: If3dee491616a1e7ba6223c2f522d100e10c5ee76
2018-06-05 19:32:02 +00:00
Christopher Ferris
1a6e5c0c15 Remove cortex-a53 linker workaround for new cpus.
Bug: 78133793

Test: Built target with cortex-a53 and verified that the flag is still
Test: there.
Test: Build target with cortex-a55/cortex-a75 and verified that the flag
Test: is not there.
Test: Built and booted on a taimen, ran bionic unit tests.
Change-Id: Ibd7f497ecf46e5781cd0265463b0782babdf062a
Merged-In: Ibd7f497ecf46e5781cd0265463b0782babdf062a
(cherry picked from commit a98d721485)
2018-05-21 12:57:51 -07:00
Christopher Ferris
6290b64f3d Remove cortex-a53 linker workaround for new cpus.
am: 79dff70b46

Change-Id: Ib6e6b334611973c524c850ce8133fe0885f7f0a3
2018-05-15 15:03:24 -07:00
Christopher Ferris
79dff70b46 Remove cortex-a53 linker workaround for new cpus.
Bug: 78133793

Test: Built target with cortex-a53 and verified that the flag is still
Test: there.
Test: Build target with cortex-a55/cortex-a75 and verified that the flag
Test: is not there.
Test: Built and booted on a taimen, ran bionic unit tests.
Change-Id: Ibd7f497ecf46e5781cd0265463b0782babdf062a
2018-05-15 11:23:01 -07:00
Christopher Ferris
01dd3fb504 Add support for cortex-a55/cortex-a75.
Bug: 78133793

Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
2018-05-11 11:23:00 -07:00
Christopher Ferris
0026c37438 Merge "Add support for cortex-a55/cortex-a75." am: 9623892890
am: c6752f63e3

Change-Id: Icd948d532b0896ffc290942fc3382184ae085d19
2018-05-11 11:13:13 -07:00
Christopher Ferris
ba14a8f4bb Add support for cortex-a55/cortex-a75.
Bug: 78133793
Bug: 78242072

Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
Merged-In: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
2018-05-11 00:43:39 +00:00
Pirama Arumuga Nainar
d86bd3fb0a Merge "Update clang to r328903" am: 470969df19
am: 182b37783e

Change-Id: I7f5208efac7aa04450dfce6e85515f74baf48037
2018-05-03 08:08:11 -07:00
Pirama Arumuga Nainar
d7feb380c1 Update clang to r328903
Bug: http://b/77532044

* b/77967848 - Disable -Wc++98-compat-extra-semi

Test: Test various targets in AOSP and internal branches.  For Googlers,
go/clang-r328903-testing

Change-Id: If08dafb9ad993fb686dfd6eeb5e2d61a9c99bd0b
2018-04-30 15:18:05 -07:00
Pirama Arumuga Nainar
29a41f9398 Merge "Revert "Support coverage instrumentation for Linux host"" am: 0d12ebce88
am: 7d42d70b0a

Change-Id: I819ebdc7e934015e07c18d4752e6e9abb43c2070
2018-04-23 17:26:45 -07:00
Pirama Arumuga Nainar
0b882f0394 Revert "Support coverage instrumentation for Linux host"
This reverts commit 358056c058.

Reason for revert: Breaks build_test target in some branches.

Change-Id: I604561033038d4ff15b74caf7b81ff5c8dd9632f
2018-04-23 22:44:39 +00:00
Pirama Arumuga Nainar
d2e0e46fc1 Support coverage instrumentation for Linux host am: 358056c058
am: ba4d455e87

Change-Id: Iac4bf787b15a68c7071dc1917f06d7f462da17c9
2018-04-23 14:08:18 -07:00
Pirama Arumuga Nainar
358056c058 Support coverage instrumentation for Linux host
Bug: http://b/77792074

- Add the libclang_rt.profile runtime libraries directly to the compile
command (for both host and target) instead of relying on the Clang
driver.
- Move the coverage mutator to PreDepsMutators so the mutation has
already happened when runtime libraries are added during dependence
computation.
- Factor out cc/config/toolchain to identify libclang_rt.profile modules
for the x86 and x86_64 host.

Test: make NATIVE_COVERAGE=true produces coverage-enabled host binaries.
Change-Id: I1ebc8cffdf11622bfc18199a57674672888b3a5f
2018-04-23 10:34:37 -07:00
Chih-hung Hsieh
c02a47647b Merge "Define clang lld flags for hosts." am: 94853de469
am: 473af9f5c7

Change-Id: Ie8ee2a49eeb55b4a2997055fed7d2602854cf425
2018-04-19 10:15:45 -07:00
Chih-Hung Hsieh
3101a969aa Define clang lld flags for hosts.
* Add -fuse-ld=lld to hostGlobalLldflags.
* Set up *ClangLldflags variables for hosts.
  They are the same as *ClangLdflags, but could be changed in the future.

Bug: 73768157
Test: make checkbuild
Change-Id: I3d61504ab7262d472bbf933df7c1a9bef62519e1
2018-04-17 16:01:08 -07:00
Dan Willemsen
bf4f0a0965 Switch PackageContext functions to take a ctx
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
Merged-In: I8cb524b09a84d0b8357d7c3501c71270af411e17
(cherry picked from commit 54daaf0371)
2018-04-16 19:27:14 -07:00
Chih-Hung Hsieh
505b2c69ac Add USE_CLANG_LLD and use_clang_lld. am: 02b4da53a7
am: 98fda157fb

Change-Id: I3fc25e6332ae02dc4736e1f77b6de52822968d80
2018-04-13 12:44:15 -07:00
Chih-Hung Hsieh
02b4da53a7 Add USE_CLANG_LLD and use_clang_lld.
* USE_CLANG_LLD is unedefined in current builds.
* When USE_CLANG_LLD is defined to 'true' or '1',
  use clang's lld instead of ld or ld.gold.
* When lld is enabled:
  * ld-only flags are not passed to 'lld'.
  * location_packer is disabled.
  * Use new lld's --pack-dyn-relocs=android.
* When lld does not work:
  * In Android.mk files use LOCAL_USE_CLANG_LLD := false.
  * In Android.bp files use use_clang_lld: false.
* Only arm, arm64, x86, and x86_64_devices have LLD flags;
  all other hosts and targets do not call lld yet.

Bug: 73768157
Test: make checkbuild and boot
Change-Id: I06b8a1e868a600997a7e70fe05c299d751d23d5f
2018-04-12 14:37:35 -07:00
Yi Kong
c410909550 [DO NOT MERGE] Switch to clang-4691093
Test: Build/boot marlin, sailfish, x86/arm/arm64 emulators
Bug: 68397894
Change-Id: Ic255b0b578838786f2bf54b53831f151187eaab0
2018-04-02 14:34:24 -07:00
Chih-hung Hsieh
cc866d6f32 Merge "Switch to clang 7.0" am: 055fa01693
am: 538ee81f0d

Change-Id: I33fe0f8e56bb554a1539dc624da42e836cf16c79
2018-03-27 18:57:25 +00:00
Chih-Hung Hsieh
3ede294729 Switch to clang 7.0
* Suppress more noisy new warnings at global level.
* Add -no-pie to partial link .o files, with -r.
* Revert workaround of b/72706604, no need of
  -Wl,-plugin-opt,-emulated-tls
* Filter out clang 7.0 unknown flag "-Wno-extended-offsetof"

Bug: 72706604
Bug: 72412006
Test: make checkbuild
Change-Id: I7ff45465c4bd771991f42b40f68dc35586045656
2018-03-26 18:04:47 -07:00
Rahul Chaudhry
eae3a62827 Merge "Revert "Disable relocation_packer and migrate to SHT_RELR sections."" am: fd5059ff10
am: c9e08d397c

Change-Id: I845618811532032f7d9193e954ecf750041f2aa6
2018-03-24 06:52:47 +00:00
Rahul Chaudhry
ccf4f83887 Revert "Disable relocation_packer and migrate to SHT_RELR sections."
This reverts commit fa00dfda13.

Reason for revert: New Build Breakages in git_pi-dev-plus-aosp-without-vendor/aosp_walleye-userdebug and git_pi-dev-plus-aosp/aosp_crosshatch-userdebug

Change-Id: Iec9e695cccc3f206df67f0c01cfd4c2c3023dcec
2018-03-23 19:02:56 +00:00
Rahul Chaudhry
b007f56ba8 Merge "Disable relocation_packer and migrate to SHT_RELR sections." am: 71bfb262b9
am: 6ad7e6a605

Change-Id: Ic0c3e14c3e1b3e91f45572134e45b9f865180d07
2018-03-23 17:53:05 +00:00
Rahul Chaudhry
fa00dfda13 Disable relocation_packer and migrate to SHT_RELR sections.
Proposal for adding SHT_RELR sections in the generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg

Comparison with relocation_packer for aosp_marlin-userdebug:
$ du -B1 -s */out/target/product/marlin/system
 996958208      base/out/target/product/marlin/system
1008340992      no_pack/out/target/product/marlin/system
 997801984      sht_relr/out/target/product/marlin/system

base contains a build with current settings.
no_pack contains a build with relocation_packer disabled.
sht_relr contains a build with SHT_RELR sections enabled.

relocation_packer was saving 11,382,784 bytes (no_pack - base).
SHT_RELR sections are saving 10,539,008 bytes (no_pack - sht_relr).

Bug: None
Test: Built aosp_marlin-userdebug image, boots on device.
Test: Built aosp_x86_64-userdebug image, boots in emulator.
Change-Id: I448dc95baa4976b68ce2659b80498539426775f9
2018-03-22 15:17:34 -07:00
Ivan Lozano
954f430e97 Add minimal-runtime support for integer overflows.
Adds Soong support for -fsanitze-minimal-runtime when using
the integer overflow sanitizers. This makes the crashes due to these
sanitizers less mysterious.

Bug: 64091660
Test: Compiled and checked the generated compiler commands
Test: Checked program that overflows for the abort reason

Change-Id: Ieeceaf6c35c8371592952d3b8b977aefc11601c5
Merged-In: Ieeceaf6c35c8371592952d3b8b977aefc11601c5
(cherry picked from commit 30c5db2f47)
2018-03-21 10:04:53 -07:00
Chih-Hung Hsieh
63eb06037a Merge "Use armv7a-linux-androideabi for arm device triple." am: 4d693a7a27
am: ada684f304

Change-Id: I6055f1e39c3bb843b30199c8a0a58bf048203b46
2018-03-19 21:08:49 +00:00
Chih-Hung Hsieh
1e7d1bf1c7 Use armv7a-linux-androideabi for arm device triple.
* This is a workaround of llvm LTO bug.
* Keep using current NDK include directory path.
  NDKTriple is default ClangTriple but kept as GccTriple for arm device.

Bug: 72619014
Test: make checkbuild
Change-Id: I5dc63c99760325c60bc2da98fd6a3125cef7267d
2018-03-19 11:19:06 -07:00
Dan Willemsen
74edf2fdbe Switch PackageContext functions to take a ctx am: 54daaf0371
am: f34acc112e

Change-Id: I11d13250bbe1b40179b764799ca607b2bacc607b
2018-03-14 00:33:31 +00:00
Dan Willemsen
54daaf0371 Switch PackageContext functions to take a ctx
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
2018-03-12 15:48:26 -07:00
Dan Willemsen
0944244d42 Merge "Revert "Fix absolute paths in clang debug output"" am: 19e62e5ebf
am: 6efd825af7

Change-Id: I3c7bd0f5f22289b926ea4d1c841c4f1c79e71cd0
2018-03-09 21:16:04 +00:00
Dan Willemsen
8054f0a9d2 Revert "Fix absolute paths in clang debug output"
This reverts commit 253cab89ee. It is no
longer necessary.

Bug: 36463318
Bug: 72408185
Test: compare output directories after `m libc`
Test: compare treehugger output files
Change-Id: Ib5d7bbc13fa6f547e658247559153c61387e3604
2018-03-08 17:10:54 -08:00
Stephen Hines
c5a4f3be45 Switch back to clang-4639204.
Bug: http://b/68397894
Test: build/run sailfish.
Change-Id: I4ca7336cacf78d64b5e91d5bd93dedce9b13d91b
2018-03-08 13:36:22 -08:00
Ivan Lozano
7476f9e866 Merge "Add minimal-runtime support for integer overflows." am: f7463f8dd2
am: 6f5690555e

Change-Id: I01755237517bd1c1a49672267ff80db1bce2b5ff
2018-03-08 20:45:14 +00:00
Stephen Hines
e477406b83 Switch back to clang-4639204. am: 5e33119d5e
am: eaf1bdb885

Change-Id: Ic1b02d387f9aabd98947154c881323fad800c4f8
2018-03-08 17:35:37 +00:00
Stephen Hines
5e33119d5e Switch back to clang-4639204.
Bug: http://b/68397894
Test: build/run sailfish.
2018-03-08 01:28:34 -08:00
Stephen Hines
84a250b37d Revert "Switch to clang-4639204." am: a6d69b06f8
am: f2813cb6e7

Change-Id: If7e0ab54436ee5469c23936586d5b4a769520180
2018-03-08 07:02:23 +00:00
Stephen Hines
a6d69b06f8 Revert "Switch to clang-4639204."
This reverts commit d4bc55624a.

Reason for revert: PGO + LTO is broken with the new toolchain.

Change-Id: I5b84d933746a8facd536167c2b040fb08302790b
2018-03-08 06:24:11 +00:00
Ivan Lozano
30c5db2f47 Add minimal-runtime support for integer overflows.
Adds Soong support for -fsanitze-minimal-runtime when using
the integer overflow sanitizers. This makes the crashes due to these
sanitizers less mysterious.

Bug: 64091660
Test: Compiled and checked the generated compiler commands
Test: Checked program that overflows for the abort reason

Change-Id: Ieeceaf6c35c8371592952d3b8b977aefc11601c5
2018-03-07 18:41:20 -08:00
Stephen Hines
2939920557 Switch to clang-4639204. am: d4bc55624a
am: eb52ecdc1e

Change-Id: Ie52953095354418dc0bbd19be8ce93be7b4d648d
2018-03-08 02:37:10 +00:00
Stephen Hines
d4bc55624a Switch to clang-4639204.
Bug: http://b/68397894
Test: build/run sailfish.
Change-Id: I980cf8458651317b33197253d0b870e66e936d05
2018-03-07 15:36:24 -08:00
Pirama Arumuga Nainar
28f56ee5d6 Switch to clang-4630689
Bug: http://b/73127367
Bug: http://b/68659946

These new prebuilts have fixes for the bugs mentioned above.

Test: Build and verify that issues in both bugs above are fixed.
Change-Id: I410a43b70920d509118f8e6fdb012ef6b078d657
Merged-In: I410a43b70920d509118f8e6fdb012ef6b078d657
(cherry picked from commit 4a825ee14a)
2018-03-06 16:45:36 +00:00
Pirama Arumuga Nainar
0f10a9fc11 Merge "Switch to clang-4630689" am: f975865a12
am: 6ae7efd478

Change-Id: I05fbb8de14876a1f0cb09aa64f1f270b8334c9ce
2018-03-05 18:20:11 +00:00
Pirama Arumuga Nainar
4a825ee14a Switch to clang-4630689
Bug: http://b/73127367
Bug: http://b/68659946

These new prebuilts have fixes for the bugs mentioned above.

Test: Build and verify that issues in both bugs above are fixed.
Change-Id: I410a43b70920d509118f8e6fdb012ef6b078d657
2018-03-02 13:38:42 -08:00
Colin Cross
aa008b4cb2 Merge "Use android.InList for inList" am: e35ad13004 am: 20b350b433
am: 3ef40fd3e4

Change-Id: Iaf540c0d55cbbf9780fcf2721f0a67de43902948
2018-02-22 04:20:12 +00:00
Colin Cross
0d0ba59ec3 Use android.InList for inList
Remove duplicate implementations of inList.

Test: m checkbuild
Change-Id: I6943b95f6d47e6722b9ff1ab61ab14c429fe33a0
2018-02-21 11:02:16 -08:00
Dan Albert
a3cd089ffa Merge "Disable a warning that libc++'s headers trip." am: 1d29875829 am: b4e2a566f9
am: b0edf20ac0

Change-Id: I56b5554e466026ac3191bca4254f4d26adced0dc
2018-02-09 18:54:20 +00:00
Dan Albert
f2ceea7f1f Disable a warning that libc++'s headers trip.
Test: make checkbuild
Bug: None
Change-Id: I117bd9ef3f4f3c8792f4b6692d7b70ad69b6922d
2018-02-07 17:24:42 -08:00
Stephen Hines
6ba52d4d56 Merge "Silence warnings rather than keeping them in the logs." am: 8646e2ea55 am: 2180672eaf
am: b5f52fbecf

Change-Id: Idcf4c18f283d98fe91dc58c944a2af999754b657
2018-02-07 01:52:35 +00:00
Stephen Hines
a42e0a0eca Silence warnings rather than keeping them in the logs.
We can simply revert this patch to work on these warnings independently.

Bug: http://b/72331526
Bug: http://b/72331524
Bug: http://b/72330874
Test: Build

Change-Id: I9cec51578a1c6de33fb6f832c758b9916c61b735
2018-02-06 14:51:08 -08:00
Stephen Hines
ecdf4a5996 Merge "Switch to clang-4579689." am: fa54e751d9 am: 3bcedd91cf
am: b6b386bf91

Change-Id: Ide6a047fae76ba61b5a755ca74a927c1128a1c91
2018-02-06 19:10:36 +00:00
Yi Kong
599a6032fc Switch to clang-4579689.
Bug: 68397894
Test: http://go/clang-4523590-testing
Change-Id: Ief806250572fe2cc5f39b4c47ff74863acbbb26d
2018-02-01 10:23:32 -08:00
Stephen Hines
828484cc95 Prebuilt sanitizer libraries should always come from linux-x86. am: 755fe07256 am: 11a27f61e3
am: af0d71c83b

Change-Id: I462fc0542755c59b542c921dee3194dc8b048045
2018-01-25 15:00:05 +00:00
Stephen Hines
755fe07256 Prebuilt sanitizer libraries should always come from linux-x86.
Bug: http://b/68397894
Test: Build on darwin with new toolchain.
Change-Id: I4d81efdc84d0b6f07482206430252ea63a4b081b
2018-01-24 19:58:36 -08:00
Dan Albert
458d87e6af Merge "Update NdkMaxPrebuiltVersionInt." am: 4fe7c6aee8 am: c0004669b6
am: 772f79e491

Change-Id: I90cae688be3891dbf6c655667bb8b33a4e04c22e
2018-01-20 00:00:39 +00:00
Dan Albert
c715eda106 Update NdkMaxPrebuiltVersionInt.
We have newer NDK prebuilts now.

Test: make checkbuild
Bug: None
Change-Id: I00ba5d1638832bc0feff46599afbaa201294fdad
2018-01-18 13:25:41 -08:00
Dan Willemsen
4955cd5610 Merge "Remove armv5te" am: 7d3e0709a5 am: c13dcf49aa
am: 36a5e07c00

Change-Id: Ia4d9eb34bc7217fc82082413acba9802db887c41
2018-01-12 06:01:41 +00:00
Dan Willemsen
e401a8315e Remove armv5te
This architecture only existed for unbundled use, but even the NDK is
removing support in their r17 release, so just remove support for it.

Test: build/soong/build_test.bash -only-soong
Change-Id: I4bd23babf567128d2d242cbdee3311abb198dd7c
2018-01-08 15:48:25 -08:00
Chih-hung Hsieh
baec7175c8 Merge "Add default -Werror to hardware/qcom projects" am: c355edc09b am: 8fbfe37e9c
am: 0492a8aeff

Change-Id: I31f077acf2ff8eb0d739796479f7600fdb504539
2018-01-05 23:46:00 +00:00
Chih-Hung Hsieh
775edde1f8 Add default -Werror to hardware/qcom projects
Bug: 66996870
Test: normal build
Change-Id: Ic8b6a5ea808fbd0f377c7bac002a9b03bf8236be
2018-01-04 20:12:01 +00:00
Chih-Hung Hsieh
6e1f32d777 Merge "Add default -Werror to hardware/libhardware/modules" am: 750e6fab06 am: c7a4d098ae
am: 2644fe6ce2

Change-Id: Ibafeab9fe4cb64d001c21a155c0561c88ec96f58
2017-12-20 00:19:31 +00:00
Chih-Hung Hsieh
41fe048372 Add default -Werror to hardware/libhardware/modules
Bug: 66996870
Test: normal build
Change-Id: I0e38533b0fa2970524ac98eca25b2c2fd472fc31
2017-12-15 18:08:36 -08:00
Chih-Hung Hsieh
0d8bf27847 Add default -Werror to tools/adt/idea am: 77abc230f6 am: bf72465fd3
am: ee170208dc

Change-Id: I62707c7407a082958311a009add3f1b306838145
2017-12-15 23:48:25 +00:00
Chih-Hung Hsieh
dcccdab2e4 Add default -Werror to external/skia. am: 1ef5ed54ee am: 943a85a871
am: 3f9aa6f69f

Change-Id: I7135333910a92fa9cc6b0df797e4433cfeaa060c
2017-12-15 23:47:03 +00:00
Chih-Hung Hsieh
77abc230f6 Add default -Werror to tools/adt/idea
Bug: 66996870
Test: normal build
Change-Id: Id5493eacf546d3246f501ca70bac26312837947e
2017-12-15 23:37:11 +00:00
Chih-Hung Hsieh
1ef5ed54ee Add default -Werror to external/skia.
Test: normal build
Change-Id: If66639a9000865e14c1ad5288b8642dfe5583f56
2017-12-15 23:34:33 +00:00
Chih-hung Hsieh
62e99477c7 Merge "Add default -Werror to frameworks/av/drm/mediacas" am: cc64cfd81f am: 1bae56fe92
am: b3f81fd304

Change-Id: Ib7e28e86b26706415313fe1cbad607bbd453f8b2
2017-12-15 23:23:47 +00:00
Chih-Hung Hsieh
c2996ff701 Add default -Werror to frameworks/av/drm/mediacas
Bug: 66996870
Test: normal build
Change-Id: I7af738fd1543c6c44279bbc13b02b0273e9d6533
2017-12-15 18:26:44 +00:00
Chih-Hung Hsieh
9b8820bf92 Add default -Werror to libstagefright/codecs. am: 086ad294cc am: 9463b83701
am: c9d2d073a4

Change-Id: I846c52062c3ee8f5830f5d6f018a90f3e0b1f7e3
2017-12-14 00:22:36 +00:00
Chih-Hung Hsieh
086ad294cc Add default -Werror to libstagefright/codecs.
Bug: 66996870
Test: normal build
Change-Id: I16c1d3b4b7ab3679b12dd0d94e5d130e33a27009
2017-12-13 15:59:53 -08:00
Chih-Hung Hsieh
65c0b89d16 Add default -Werror to libese/third_party/NXPNFC_P61_JCOP_Kit am: 38ed2ab5f1 am: 4d2591634a
am: 406db94a21

Change-Id: Ied0f5f02386115f7d6402eb5ed1e67e40d5e331f
2017-12-13 23:27:50 +00:00
Chih-Hung Hsieh
38ed2ab5f1 Add default -Werror to libese/third_party/NXPNFC_P61_JCOP_Kit
Test: normal build
Change-Id: Ie20280898ac6bce8cff6caf91b93be20ef313488
2017-12-13 22:26:30 +00:00
Chih-Hung Hsieh
c9a68953d7 Add default -Werror to libeffects and mediaextractor. am: 7434c565ff am: e8160f5c32
am: 498d8fb8a5

Change-Id: Ie9fc77a4e5e3d4b818713bf344c0e0b13b74a849
2017-12-13 06:18:29 +00:00
Chih-Hung Hsieh
1ad0ea10c0 Add default -Werror to frameworks/webview/chromium. am: 7dd8778e48 am: f7d656492a
am: ab74c609f8

Change-Id: Id392f8fef205b8b386e74f985beca4797b131c0c
2017-12-13 03:06:38 +00:00
Chih-hung Hsieh
d1ebc4dd1b Merge "Add default -Werror to libbufferhub" am: e41f450a35 am: 61d52fbadf
am: dc0633de75

Change-Id: Iaa43111c3462b0b3215851cd3e901b7a96b49d2a
2017-12-13 03:05:00 +00:00
Chih-Hung Hsieh
7434c565ff Add default -Werror to libeffects and mediaextractor.
bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ic0522ede6c62382c1c36f11ababcd389f7bcffd5
2017-12-12 18:13:02 -08:00
Chih-Hung Hsieh
7dd8778e48 Add default -Werror to frameworks/webview/chromium.
Bug: 66996870
Test: normal build
Change-Id: Ifb3a44dd073dd7f028295e102bd561feaf98cf26
2017-12-12 17:57:57 -08:00
Chih-Hung Hsieh
1bb807bb45 Add default -Werror to libbufferhub
bug: 66996870
Test: normal build
Change-Id: I1a5d17a2752972f91fd7196128c10dddedca177d
2017-12-12 14:33:18 -08:00
Chih-hung Hsieh
0bdcb21f2e Merge "Add default -Werror to sdk/emulator/mksdcard." am: 6f822b8b93 am: a6e2d7d6c3
am: 821ae0fcbf

Change-Id: Iaeefa36bde5d45d4ef6ba9ad537e573f6dd3a3fd
2017-12-12 07:48:38 +00:00
Chih-hung Hsieh
c39b72656b Merge "Add default -Werror to frameworks/ml/nn." am: a3818107e8 am: d0857b30f7
am: ea1d5420f6

Change-Id: Ida83b351cfd7b3eb7593919ab7bb1589f44677d9
2017-12-12 02:40:05 +00:00
Chih-Hung Hsieh
a227ea38f0 Add default -Werror to sdk/emulator/mksdcard.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I6499be53a2539143ad6785c1513fe4bd5d3a9910
2017-12-12 01:45:01 +00:00
Chih-Hung Hsieh
65b76252cc Add default -Werror to system/vold/tests. am: 75f2e70dff am: 167803be63
am: 474373d399

Change-Id: I0583b8832291dce6caa2ec14527d82e467132d78
2017-12-11 23:37:22 +00:00
Chih-hung Hsieh
24f7a8e71d Merge "Add default -Werror to cts." am: 44c235d4d7 am: b95ec525bf
am: 716133f307

Change-Id: If2773262684c0243b0ef58d449d43129e9ddaa81
2017-12-11 23:34:22 +00:00
Chih-Hung Hsieh
8fd29d3bb8 Add default -Werror to frameworks/ml/nn.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I6c7fb32b0abaf9b1dc03292daf7c584b1648eeeb
2017-12-11 23:24:46 +00:00
Chih-Hung Hsieh
75f2e70dff Add default -Werror to system/vold/tests.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I730943ace4aa329459d6280d1c2be601f7383343
2017-12-11 23:21:57 +00:00
Chih-hung Hsieh
29499fcf68 Merge "Remove 6 directories from WarningAllowed*Projects." am: 4b9bb14dd2 am: fcf1e5795d
am: 611a50668f

Change-Id: If75baf84695522fefce8a4fde7e1a265575e6c02
2017-12-08 01:07:45 +00:00
Chih-Hung Hsieh
2c07fc68fd Add default -Werror to cts.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I4900286f75c4f0ee17967085ed7012ddbe6024c9
2017-12-07 11:22:00 -08:00
Chih-Hung Hsieh
b47ac038e8 Remove 6 directories from WarningAllowed*Projects.
Test: normal build
Change-Id: I44381a2a7994d9f74329b0516d2bb303b5866a66
2017-12-07 00:12:35 +00:00
Chih-Hung Hsieh
674f089a0a Allow warnings in libbufferhub. am: 809d3f8f63 am: 875e78c85e
am: 8cd2aee922

Change-Id: I18a67fb72e9f0f246718715c9b44ca9093b581b1
2017-12-06 02:29:51 +00:00
Chih-Hung Hsieh
809d3f8f63 Allow warnings in libbufferhub.
* This directory still has warnings.

Test: normal build
Change-Id: Ie322ebf38d828d63e9115308b8e71769fc2a452a
2017-12-05 16:51:22 -08:00
Chih-Hung Hsieh
f589d4e673 Reduce WarningAllowedProjects. am: 8ca48361ef am: 02c11fa130
am: 88b3e5ca83

Change-Id: Id4335e08e99c61ae7b64de9be31de95db6adccfa
2017-12-05 23:13:40 +00:00
Chih-Hung Hsieh
8ca48361ef Reduce WarningAllowedProjects.
* Warnings were fixed or suppressed in these projects.

Test: normal build
Change-Id: I24ef1b59d6c5ccd50979b7d792764de9d6da7e30
2017-12-05 09:12:35 -08:00
Dan Willemsen
0622caeff0 Merge "Add base variables for windows clang" am: d0704cf7fa am: 1ef719f19c
am: 07ec9e246e

Change-Id: Ia30f7f5cd450005e0cf0b1b8ee6fff7ef2906634
2017-12-01 03:01:52 +00:00
Dan Willemsen
01f388c343 Add base variables for windows clang
This just copies most of what exists for clang on Linux, but doesn't
actually turn on clang support.

Bug: 69933068
Test: m nothing; compare ninja files
Change-Id: I2cf203026e7ced32004a91d7f3baf4a6415085eb
2017-11-30 15:42:53 -08:00
Chih-Hung Hsieh
90aee69ac6 Merge "Reduce WarningAllowedProjects." am: c92168f08d am: 9741b57ad8
am: 3365041fae

Change-Id: Ia26ecbbcf1a68c1648fce9f416eb11b508e328b0
2017-11-30 01:03:30 +00:00
Chih-Hung Hsieh
0082636a14 Reduce WarningAllowedProjects.
* Warnings were fixed or suppressed in these projects.

Test: normal build
Change-Id: I5eec81704472c1675adf5fa784112c025f3c0222
2017-11-29 13:52:26 -08:00
Colin Cross
22e8960a6d Wrap PackageContext and SingletonContext am: 0875c52de7 am: a0a0b7fd90
am: a0b69a22a9

Change-Id: I638dc4c80e2bd8a805bb92a23b5991b932bc0ab4
2017-11-29 05:25:41 +00:00
Colin Cross
0875c52de7 Wrap PackageContext and SingletonContext
Wrap blueprint.PackageContext so that the *Func methods can provide
an android.Config instead of an interface{}.  The modified signatures
means that every method in ModuleContext and SingletonContext
that takes a blueprint.PackageContext now needs to be wrapped to
take an android.PackageContext.

SingletonContext wasn't previously wrapped at all, but as long
as it is, wrap everything like ModuleContext does.  This requires
updating every Singleton to use the android-specific methods.

Test: builds, all Soong tests pass
Change-Id: I4f22085ebca7def6c5cde49e8210b59d994ba625
2017-11-29 05:04:30 +00:00
Pirama Arumuga Nainar
032939e376 Merge "Use -mcpu=cortex-a53 for devices with Kryo" am: 49b14daf03 am: 34fcefe690
am: 9a1483bfe6

Change-Id: Ie03c8344b712bf70cdac7c07bcda3c721fc58cb8
2017-11-21 22:19:39 +00:00
Treehugger Robot
49b14daf03 Merge "Use -mcpu=cortex-a53 for devices with Kryo" 2017-11-21 22:05:44 +00:00
Chih-hung Hsieh
a48f9209eb Merge "Add default -Wall -Werror or -Wall." am: 488131912f am: 20cfee85b4
am: fc49581152

Change-Id: I4c1bbd4645a3a3dd378ebc890a9a5f0b5cab57bd
2017-11-21 21:30:57 +00:00
Pirama Arumuga Nainar
c17b275ed3 Use -mcpu=cortex-a53 for devices with Kryo
Bug: http://b/69481735

While Clang supports -mcpu=kryo, the GNU assembler doesn't.  Use
Cortex-a53 instead, which is close to Kryo.  The current alternative of
using Krait causes problems when also using armv8, which is not
available in Krait.

Test: Build marlin with internal CL 3248394 cherry-picked.
Change-Id: I571739e6ab4f1b37fafb304ecad2865c9394e04f
2017-11-21 09:35:42 -08:00
Chih-Hung Hsieh
64a38dcb18 Add default -Wall -Werror or -Wall.
* When -Wno-error and -Werror are not used:
  add -Wall to the front of cflags
  if the project is in the WarningAllowedProjects,
  otherwise add -Wall -Werror.
* Add -Wall -Werror to ndk_library build targets.
* Collect names of modules with -Wno-error or without -Werror,
  and pass them to makefile variables:
      SOONG_MODULES_USING_WNO_ERROR
      SOONG_MODULES_ADDED_WERROR
      SOONG_MODULES_ADDED_WALL
* Generate ANDROID_WARNING_ALLOWED_PROJECTS for old makefiles.

Bug: 66996870
Test: normal build
Change-Id: I31385e12b80ca946c7395a5a184ef259b029aac6
2017-11-20 18:28:26 -08:00
Colin Cross
e2a1c906f3 Merge "Revert "Set -fomit-frame-pointer for all devices"" am: ea7b201536 am: 8a4e6952f6
am: 1d58fbc8d9

Change-Id: I392bdf00fe21d43c08385e948aa593f600907b27
2017-11-18 02:19:20 +00:00
Treehugger Robot
ea7b201536 Merge "Revert "Set -fomit-frame-pointer for all devices"" 2017-11-18 02:13:08 +00:00
Colin Cross
bc2c7c26e1 Revert "Set -fomit-frame-pointer for all devices"
This reverts commit 20823f95e6.

Reason for revert: caused a minor performance regression in some benchmarks.

Bug: 69470341
Test: builds
Change-Id: I1a852b5d7a2aa1d08ecb54617898f814cddd7600
2017-11-18 00:11:21 +00:00
Colin Cross
09f673cc5a Add license headers to all go and shell files am: d00350c61b am: 12a6e4705e
am: f168cbcf20

Change-Id: I068e1a8c332e9f0fbc39887890a897aff14d4e27
2017-11-17 23:14:42 +00:00
Colin Cross
d00350c61b Add license headers to all go and shell files
Test: none
Change-Id: I75c443e05f2b1e17fcb6823182717d2e6f5df7c4
2017-11-17 23:05:26 +00:00
Colin Cross
5ed07bf6ec Set -fomit-frame-pointer for all devices am: 20823f95e6 am: c7155993ee
am: 255924d2a2

Change-Id: I74da5f76ff30b53c294aa7dd2cd66b27180ce222
2017-11-15 21:56:05 +00:00
Colin Cross
20823f95e6 Set -fomit-frame-pointer for all devices
-fomit-frame-pointer was only being set for arm and mips.  Since
we always use unwind tables and not frame pointers to unwind, and
since ART generated code does not use frame pointers, just turn
off frame pointers everywhere to gain an extra register.

Bug: 68951394
Test: m checkbuild
Change-Id: I9237d486a0c0215cdafd96d66712082df0eba785
2017-11-15 18:52:42 +00:00
Colin Cross
49ab9666ba Merge changes Iae2bda98,I68e64888,I75af16e7 am: d03553cf13 am: f053a45ad9
am: 59ec9ffe3c

Change-Id: I441f23f7de21754306ec7f387153ed81fb183021
2017-11-15 02:00:03 +00:00
Colin Cross
b37620f870 Remove gcc-specific optimizations
These flags were added for gcc, but are always stripped out when
compiling for clang.  Since gcc is barely used, removed them.

Bug: 68855788
Bug: 68947919
Test: m checkbuild
Change-Id: Iae2bda9808dd9499848ce145ccdf71c4c490b80e
2017-11-14 17:43:33 +00:00
Colin Cross
ea3141d06d Move some flags to affect all devices
Move -fdata-sections and -fno-short-enums to global device flags.
-fdata-sections was not previously set on x86[_64], -fno-short-enums
was not previously set on mips[64].

Bug: 68855788
Test: m checkbuild
Change-Id: I68e64888d5414fc022366eb2b6c5cd92c28a5542
2017-11-14 17:43:24 +00:00
Pirama Arumuga Nainar
eaffec54ba Merge "Re-enable -Wunknown-warning-option" am: cc178b3e78 am: e25bbfdc04
am: e5d53e9cdf

Change-Id: Id4b71f0e0372987102e689653de9fefac21721d5
2017-11-14 11:22:38 +00:00
Colin Cross
26f14509d1 Move -fvisibility-inlines-hidden to global device cppflags
It was previously set on arm[64] and mips[64], this will cause it
to be set for x86[_64] too.

Bug: 68855788
Test: m checkbuild
Change-Id: I75af16e7d259963ad633cc664929144332bb435d
2017-11-13 15:18:19 -08:00
Pirama Arumuga Nainar
4c0e1bf4e0 Re-enable -Wunknown-warning-option
Bug: http://b/68236396

This warning only needs to be enabled for frameworks/base/core/jni.

Test: Build the topic
Change-Id: I9f6aab2045f135d691696f9fd461c895a5aadb38
2017-11-10 13:54:47 -08:00
Isaac Chen
e36b180f54 Generic 32-bit armv8 built as generic armv7 fix am: 2bce8edf34 am: 8fb28462e3
am: 8f5d5282e0

Change-Id: I2bf4294ae75c3f00a41bf6f0cc762bd4671ee88d
2017-11-08 04:34:28 +00:00
Isaac Chen
2bce8edf34 Generic 32-bit armv8 built as generic armv7 fix
When the following lines are specified in the BoardConfig.mk

TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := generic

The resulted binaries won't be built using 32-bit armv8-a integer
division instructions. Instead, division routines are used because
the build system will set a compiler option "-march=armv7-a", and
hence overwiting the previous "-march=armv8-a", when
TARGET_2ND_CPU_VARIANT is set to generic (or unset).

Bug: 67446726
Test: lunch aosp_arm64; make -j; emulator # boot to home screen
      Also verify -march=armv7-a is not specified in the compiler
      command line and the resulted binary actually uses integer
      division instructions.

Change-Id: I430687aa5a658d2ec9f325a66d849b4c8898c7d5
2017-11-08 04:17:35 +00:00
Colin Cross
ee40f04b3c Merge changes Ie8ecb6c9,Ia9befd7c am: a632e9f4d2 am: 0ced97e7f1
am: 354b878e31

Change-Id: I8e548d8508bf5d0816f772f00103344df0ed1eb7
2017-11-06 23:25:50 +00:00
Colin Cross
39d450b374 Move -fno-canonical-system-headers to global cflags
-fno-canonical-system-headers is required for gcc to use relative
paths to system headers in deps files, and is stripped out for
clang.  Move it to the global flags so it affects windows gcc builds.

Bug: 68719465
Test: m checkbuild
Test: prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja -t deps | grep -E '^[[:space:]]*/' | sort | uniq
Change-Id: Ia9befd7cf8cfd714241e636fb786c319aecc79fe
2017-11-06 12:56:34 -08:00
Colin Cross
3d2da75029 Merge changes from topic "crt_cflags" am: 5c9cf6eb84 am: 3568303af8
am: b916e0f4f9

Change-Id: I4871e64c0b3e611c0c72321218f15a2080a3742e
2017-11-06 19:07:43 +00:00
Colin Cross
0f1f679f5e Move -fomit-frame-pointer to armCflags
-fomit-frame-pointer was specified twice, once for arm and once for
thumb.  Move it to the shared cflags.

Bug: 68855788
Test: m checkbuild
Change-Id: Iab1299c247808f1a2542b468084600b7c32996e8
2017-11-03 22:28:12 -07:00
Colin Cross
324a457440 Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version

Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 22:28:03 -07:00
Colin Cross
0e37bc78d4 Remove -Wl,--gc-sections from target flags
-Wl,--gc-sections is already added by library.go and binary.go for
anything that uses bionic.

Bug: 68855788
Test: m checkbuild
Change-Id: I229199045ef8595d69c07fcf1aa6bbdc0b753fe3
2017-11-03 11:34:45 -07:00
Colin Cross
133dbe7bb0 Consolidate cflags that are set on all devices
Move cflags that are set on all devices to deviceGlobalCflags:
-fno-canonical-system-headers
-ffunction-sections
-funwind-tables
-fstack-protector-strong
-Wa,--noexecstack
-D_FORTIFY_SOURCE=2
-Wstrict-aliasing=2
-Werror=format-security

Bug: 68855788
Test: m checkbuild
Change-Id: Iefec689fdd2749013d0cc003b3abec674a85fb74
2017-11-03 11:34:45 -07:00
Colin Cross
7278afc5a8 Consolidate global cflags
Move all the flags that are used everywhere (or should be used
everywhere) into cc/config/global.go:
-no-canonical-prefixes
-fno-exceptions
-Wno-multichar
-O2
-g
-fno-strict-aliasing

Also remove flags that are already in noOverrideGlobalCflags:
-Werror=pointer-to-int-cast
-Werror=int-to-pointer-cast

x86 and x86_64 were specifying -fstrict-aliasing, but that was
being overriden later by -fno-strict-aliasing, so remove it.
ARM devices still override -fno-strict-aliasing to -fstrict-aliasing
when using ARM (vs. Thumb) instruction set.

Bug: 68855788
Test: m checkbuild
Change-Id: Ia2b5891bdefb60f974ad92b4b84a8548c2dcc7dc
2017-11-03 11:34:45 -07:00
Vishwath Mohan
4f34146713 Revert "Revert "Build system changes for CFI (Soong)"" am: b743e9c16a am: 39375fe131
am: 2f85998479

Change-Id: I66198384659259f34b79458d9d85b2861a310288
2017-11-01 23:17:00 +00:00
Vishwath Mohan
b743e9c16a Revert "Revert "Build system changes for CFI (Soong)""
This reverts commit 33c252c2f1.

I have a fix to the crashes that this CL set was causing, and have
uploaded it as a patchset to this revert.

This also contains a partial fix that was initially submitted
separately as
https://android-review.googlesource.com/#/c/platform/build/soong/+/524295/

Bug: 30227045
Test: ./art/test/testrunner/run_build_test_target.py -j110 art-asan #no
build errors
Test: m -j50 ASAN_OPTIONS=detect_leaks=0 SANITIZE_HOST=address # no
build errors

Change-Id: I3e53549fa03413d35d9a952f04de1e7629e1f06d
2017-11-01 12:50:01 -07:00
Orion Hodson
4e628dd1ba Revert "Build system changes for CFI (Soong)" am: 33c252c2f1 am: db9c663d66
am: c39c56f06b

Change-Id: If348f5e9091bd7ae80fca87d1761594f9c6bfbb5
2017-11-01 00:53:23 +00:00
Orion Hodson
33c252c2f1 Revert "Build system changes for CFI (Soong)"
This reverts commit d4b484b070.

Rationale: second in group of commits that left aosp_x86_64 not
building. (See https://android-build.googleplex.com/builds/
submitted/4426589/aosp_x86_64-eng/latest/logs/build_error.log)

Bug: 30227045
Test: builds
Change-Id: I38ab5284c614d6ee68e7359219bd75c7d50131be
2017-10-31 21:01:00 +00:00
Vishwath Mohan
89037dddd2 Merge "Build system changes for CFI (Soong)" am: 9ee01976fe am: 33af0d78bf
am: 7a8a392974

Change-Id: I6b560262ac999f461ace5fc62bd8ab0d5c890723
2017-10-31 02:04:42 +00:00
Vishwath Mohan
9ee01976fe Merge "Build system changes for CFI (Soong)" 2017-10-31 01:42:16 +00:00
Stephen Hines
62110067b7 Switch to clang-4393122. am: 0ed7d24f7a am: bc7ab77eb9
am: a3b8634ce3

Change-Id: I537685aa802ea64842b3416f25f7520b3f5a06d8
2017-10-30 20:06:47 +00:00
Stephen Hines
0ed7d24f7a Switch to clang-4393122.
Bug: http://b/62580008
Bug: http://b/68236239
Bug: http://b/68236396
Test: https://goto.google.com/clang-4393122-testing
Change-Id: Ib6bcf93e356172aad2a762b730a6f93916a5d845
2017-10-30 16:00:44 +00:00
Vishwath Mohan
d4b484b070 Build system changes for CFI (Soong)
This CL makes multiples changes in preparation for platform-wide CFI.

(a) Adds a second -version-script=... to the command line
when building components that use a version script. This ensures that
__cfi_check is also exported, and allows CFI to be enabled for these
components.

(b) Adds both topdown and bottom up mutators for CFI to help propagate
dependencies correctly for components that may need CFI disabled.

(c) Fixes an issue with the mutators to correctly apply settings to
both generated variants

(d) Fixes issues when components have more than a single visibility
flag.

Bug: 30227045
Test: SANITIZE_TARGET=cfi m -j40 # dependencies are correctly built
                                 # with/without CFI

Change-Id: I44793cc03bcbcdaa957cc49c7240b87d7c9db327
2017-10-30 01:42:31 -07:00
Jayant Chowdhary
cc793be92b Merge "Make clang libTooling tools ignore all lto flags." am: bdb04acd57 am: 4b26316680
am: a744ff6711

Change-Id: I9ba560a610d5341b10e9dece263e97e175082ab9
2017-10-27 21:01:39 +00:00
Jayant Chowdhary
20f5d137ed Make clang libTooling tools ignore all lto flags.
LLVM r275480 does not recognize flto flags, suppress the option in clang
libTooling tools for now.

Bug: 62839002

Test: mma

Change-Id: Ia9d80b46320e551a93dbff780405d8ff8ad73f35
2017-10-27 11:29:52 -07:00
Goran Jakovljevic
9a6ceb55c2 Merge "MIPS: Remove -U__unix and -U__unix__ from cflags" am: 16b9ce4dff am: d58c6031ed am: 8fc41212e2
am: 1796fabc88

Change-Id: If492fb50c308d2bb8bb8ce45478fbc02e9d1001c
2017-10-18 18:42:04 +00:00
Goran Jakovljevic
68a321d92f MIPS: Remove -U__unix and -U__unix__ from cflags
Leave '__unix' and '__unix__' defined on mips/mips64, like arm.
This is needed to avoid a warning in external/libcxx project.

Test: successful build and boot aosp_mips-eng
Test: successful build and boot aosp_mips64-eng

Change-Id: I8f0e17bdbeffd5078c19aa7506564b8e79a9c945
2017-10-18 16:37:21 +02:00
Elliott Hughes
a92ecc9b36 Merge "Unified sysroot: arch-X/include directories are gone." am: 4d219e801d am: 3808a8c1a6 am: 394944459a
am: d5b4607533

Change-Id: Ibe8e592e76a0ad9203c57aa572e0e31407e4d308
2017-10-15 04:19:53 +00:00
Elliott Hughes
4d219e801d Merge "Unified sysroot: arch-X/include directories are gone." 2017-10-13 17:35:41 +00:00
Elliott Hughes
de28deb460 Unified sysroot: arch-X/include directories are gone.
Bug: N/A
Test: builds
Change-Id: I98fc6a1a3c0be1c90b1deb35b54f36ab16a202ac
2017-10-12 09:07:53 -07:00
TreeHugger Robot
ba874a0328 Merge "Fixup location for jni.h automatic header include." 2017-10-09 22:51:19 +00:00
Steven Moreland
3afa3cd574 Fixup location for jni.h automatic header include.
include_deprecated -> include_jni

include_jni only includes jni.h. Other dependencies which
are provided as part of libnativehelper can be included
by using libnativehelper or by using them with in their
proper location (e.x. nativehelper/JNIHelp.h).

Bug: 63762847
Test: modules find their headers
Change-Id: I8674d2feed08bd80c1fc7b54e3ee38b9ee3484b2
2017-10-09 16:35:08 +00:00
Treehugger Robot
c7ba6a2e46 Merge "Use correct flags for host-side assembly" 2017-10-06 11:48:24 +00:00
Greg Hartman
09302bee38 Use correct flags for host-side assembly
BUG: 67434336
Test: Built libjpeg-turbo, confirmed flags
Change-Id: I54c1cc968d0a08d3a221ef4c46f2572269420c6a
2017-10-05 13:08:28 -07:00
Pirama Arumuga Nainar
49b53d5c7c Explicitly link the profile runtime during PGO
Bug: http://b/65598278

The profile runtime depends on libgcc for some symbols (only under some
circumstances - armv5, ndk r14, static executables).  Since Android
build passes -nostdlib and adds libgcc manually, the profile runtime
gets passed to the linker later than libgcc.

Instead, explicitly add the profile runtime to the linker command (and
pass one other flag added by the clang driver to the link).

Test: Build a library with profile instrumentation that otherwise fails
instrumented build.

Change-Id: I24b34cebd2c3bb6a540f8f4c465ace1be4eb90f3
Signed-off-by: Pirama Arumuga Nainar <pirama@google.com>
2017-10-04 22:25:19 -07:00
Dan Willemsen
bd42549743 Don't use the platform copy of libz
We'll always provide our own.

Test: m nothing
Change-Id: I4749c0fc3ec0922e975fc5f60976bee964ed3d5e
2017-09-27 15:35:29 -07:00
Nathan Harold
01abb0948b Add 10.13 Mac SDK to whitelist
Add the latest Mac SDK to the version
whitelist.

Test: compilation
Change-Id: I86fcbf2bb100a0af6a2cfea62f524a17ba1a67b9
2017-09-24 01:51:26 -07:00
Dan Willemsen
38394b962f Fix ToolchainClangCflags for host bionic
Move these flags from the normal flags to the toolchain flags, since we
want them to always apply.

Test: Add #ifdef __ANDROID__ to crtbegin.c, check to see if it's set for host bionic
Change-Id: I382dd229e3e4a889bc916f6f8e1248c7debb8fad
2017-09-20 13:16:13 -07:00
Dan Willemsen
b18cf7a5a0 Add windows libraries used by mdnsresponder
Test: Check for presence in prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8
Change-Id: Iaa0b56ca8ff94ebcd925238f211d9bd5d52a4a0c
2017-09-09 13:06:25 -07:00
Dan Willemsen
4f1c3d4116 Add support for Windows Message Compiler
We've only got one user of this currently, but since it needs the
location of the toolchain, and different flags based on 32 vs 64-bit,
it's easier just to add support than to get this into a genrule.

Test: Convert external/mdnsresponder to Soong, build
Change-Id: I6c19a82bc14f6ab556f6cc5f37164862ba5f9083
2017-09-09 13:06:25 -07:00
Isaac Chen
a2a582413e Revert "Revert "Build support for 32-bit armv8-a""
This reverts commit 80b27e4e20.

Fixed CTS build issue by adding -march=armv7-a in cts/tests/tests/os/jni/Android.mk since the library built here needs/uses instruction (swp) obsolete in ARMv8.

Bug: 64964151
Test: lunch aosp_arm64-userdebug; make -j cts
      lunch aosp_x86-userdebug; make -j cts
      lunch aosp_sailfish-userdebug; make -j cts
      lunch aosp_bullhead-userdebug; make -j cts

Change-Id: I6ccafce043e101c769ad370a81ffa0eb62719b5e
2017-08-23 10:57:17 +00:00
Tobias Thierer
80b27e4e20 Revert "Build support for 32-bit armv8-a"
This reverts commit 9c02066b13.

Reason for revert: Broke the build for some targets (including marlin and angler).

$ make cts
build/core/combo/TARGET_linux-arm.mk:43: kryo is armv8-a.
build/core/combo/TARGET_linux-arm.mk:45: TARGET_2ND_ARCH_VARIANT, armv7-a-neon, ignored! Use armv8-a instead.
[...]
cts/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp:88:20: error: instruction requires: armv7 or earlier
    asm volatile ( "swp r0, r0, [%0]" : "+r"(ptr) : : "r0" );
                   ^
<inline asm>:1:2: note: instantiated into assembly here
        swp r0, r0, [r1]
        ^

Change-Id: I3fa7ca74d88aedf6574855e988d35e341f6e5067
2017-08-21 15:03:26 +00:00
Isaac Chen
9c02066b13 Build support for 32-bit armv8-a
Add armv8-a as a valid/supported 32-bit arm architecture variant. If
some known armv8-a core, like cortex-a53, cortex-a73, etc. is specified
as TARGET(_2ND)_CPU_VARIANT, the associated TARGET(_2ND)_ARCH_VARIANT
will be treated as if armv8-a is specified.

Bug: 62895439
Test: "bionic-unit-tests-static --gtest_filter=*strlen*" on Nexus 4
      (armv7-krait), emulator (armv7), and sailfish (armv8-kryo).
      The test binary for the first 2 is built with armv7-a as its
      TARGET_ARCH_VARIANT; The test binary for the last is built with
      armv8-a as its TARGET_2ND_ARCH_VARIANT.
      TARGET(_2ND)_CPU_VARIANTs of both binaries are set to "generic".

Change-Id: I53bee2974346cf485b2da54cf7aad010b0425910
2017-08-18 19:46:38 +08:00
Stephen Crane
ba090d16c2 Add LTO support to soong
Enabling the lto property for a module builds that module and all static
dependencies with LTO.

LTO (link-time optimization) allows the compiler to optimize and
generate code for the entire module at link time, rather than
per-compilation unit. LTO is required for Clang CFI and other
whole-program optimization techniques. LTO also allows cross-compilation
unit optimizations that should result in faster and smaller code, at the
expense of additional compilation time.

Test: make -j12 libc with lto: true for libc

Change-Id: Ib8baefedf60e02701d44673a7c473e0845730101
2017-08-15 12:54:12 -07:00
Stephen Crane
b3c2154f2a Pass correct emulation string to gold
Gold recognizes a different set of emulation strings to specify targets
than the bfd linker accepts. Clang only passes bfd emulations to the
linker, so we need to override these with the versions accepted by gold
when using gold.

Gold normally picks up the correct target from the first ELF input file
if it cannot parse the emulation parameter. However when using LTO, all
objects may be bitcode files, which causes gold to rely on the passed
--oformat or -m parameter to determine the proper target. If gold cannot
parse the emulation string passed by clang, it fails to link.

Test: build LTO version of libc

Change-Id: I38e78bb912fd3cc5fb7b4a762284f50ddd4f3998
2017-08-15 12:54:12 -07:00
Jiyong Park
d5b18a55bb List of VNDK-related libs are exported to make
LL-NDK, VNDK-core, VNDK-SP libraries are exported to make as
SOONG_LLNDK_LIBRARIES, SOONG_VNDK_CORE_LIBRARIES, and
SOONG_VNDK_SAMEPROCESS_LIBRARIES. This can be used to auto-generate
ld.config.txt from a template.

Bug: 64013660
Test: BOARD_VNDK_VERSION=current m -j successful
Test: check out/soong/make_vars*.mk and look for SOONG_*_LIBRARIES

Merged-In: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
Change-Id: I0f4c5d05d9cd28c3fc9fdcca6ce0e6eaeaacbe8d
2017-08-10 14:15:39 +09:00
Junmo Park
8ea4959279 Add support for Exynos-M1
Change-Id: Ie57507a5d0ea9101db603ff3538c51853083a314
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-24 07:14:55 +09:00
Junmo Park
d86c902470 Add support for Exynos-M2.
Change-Id: I646f303b460556a9b36a44574f25dd992d42906c
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-22 09:16:31 +09:00
Steven Moreland
3cf6306f96 Move default libnativehelper include to mock dir.
Also export the corresponding variable to make.

libnativehelper's include_deprecated contains all of the
headers that are currently used by libraries without
the "nativehelper/" prefix.

The current count of this is this:
      2 ScopedLocalFrame.h
      4 JniInvocation.h
      4 ScopedBytes.h
      5 AsynchronousCloseMonitor.h
      6 toStringArray.h
      7 ScopedStringChars.h
     38 JniConstants.h
     41 ScopedPrimitiveArray.h
     79 ScopedUtfChars.h
     80 UniquePtr.h
    100 ScopedLocalRef.h
    467 JNIHelp.h

Now we can remove each file from the global header include
on a file by file basis.

Bug: 63762847
Test: libs find their headers

Change-Id: Iffc0c1ceb55cc59dc4a70c75d7c0b9ce8397b2cf
2017-07-18 14:44:33 -07:00
Ivan Lozano
0c3a1efae4 Add integer_overflow sanitization build option.
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and
unsigned integer overflow sanitization globally. This implements the
Soong side of the build option.

An additional build option is provided to control whether or not to run
in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the
same way that SANITIZE_TARGET does and currently only supports
'integer_overflow' as an option.

A default sanitizer blacklist is added to avoid applying sanitization
to functions that are likely to exhibit benign overflows.

Bug: 30969751
Test: Building with and without the new flags, device boot-up, tested
various permutations of controlling the new flags from build files.

Change-Id: Ibc8a8615d3132f1a23faaf1cb4861f24c5ef734a
2017-07-07 09:52:23 -07:00
Lazar Trsic
397866653e Revert "[mips] Disable compact branch generation"
With the latest Clang we do not have issue with beqc instruction,
so allow generation of compact branches for mips.

This reverts commit 3d6a38d601.

Change-Id: I6dbb5d1fce08bd714cc9a0318d50de5765cff038
2017-06-28 11:22:58 +02:00
Jayant Chowdhary
9677e8c6ad Black-list for clang LibTooling Cflags.
Add a list of flags which are not understood by clang LibTooling tools
and filter them out of the Cflags the tools are invoked with.

Test: In frameworks/av, make libmedia vendor_available (this invokes
header-abi-dumper on this module), mm -j64.

Bug: 62447349

Change-Id: I46f017212b89f4331145c999103d0ed44da0abaf
2017-06-19 19:43:03 -07:00
Yi Kong
dadff1b8d2 Switch to clang-4053586
Bug: 37423073
Test: Build on multiple devices
Change-Id: I4d1b328129faac28e3b38c3c7640f8c91a3f8ff2
2017-06-04 12:02:08 -07:00
Leo Li
e748f5d912 Export clang default settings.
Test: Refactor no tests.

Change-Id: Ib920962e8a42ef67c4eb1517e9274ff1120d15a0
(cherry picked from commit 8756b37432)
2017-06-03 22:44:18 +00:00
Elliott Hughes
98418a0e33 Add bionic's scsi headers to the include path.
Bug: N/A (hit while upgrading strace to 4.17)
Test: builds
Change-Id: Ia98daf9563a788588827d43c17573896e4ec6f5a
2017-05-25 17:16:10 -07:00
Treehugger Robot
6b8eb63fc2 Merge "Fix mips32r2-fp-xburst build" 2017-05-22 22:54:11 +00:00
Jake Weinstein
5916657a96 soong: use optimal FPU on Cortex-A15
* Cortex-A15 supports VFPv4 instructions

Test: make otapackage
Test: Built angler with 32 bit variant set to cortex-a15.
Test: Boot this version of the angler, ran bionic unit tests.
Change-Id: I94f00c9486ece201aa2c230308b9f90b0209dc4a
2017-05-17 14:11:33 -07:00
Treehugger Robot
04b830f133 Merge "Revert "Revert "Ensure environment dependencies are correct""" 2017-05-16 00:25:09 +00:00
Treehugger Robot
bdb02bd334 Merge "Clarify paths.go somewhat" 2017-05-16 00:20:29 +00:00
Dan Willemsen
6606872bf6 Revert "Revert "Ensure environment dependencies are correct""
This reverts commit 4068a5db6c.

Now the Mac xcode-select and xcrun goes through Config.HostSystemTool,
which will grab $PATH through Config.Getenv

Test: m -j (on mac)
Change-Id: I2632c4fdb2ec961e59944cf02ff165e0fd3c869d
2017-05-15 15:22:45 -07:00
Christopher Ferris
6df46f5d93 Add cortex-a73 support.
Also, update flags for cortex-a53.

Bug: 37647380

Test: Built target with cortex-a73 for both 32 bit/64 bit.
Test: Built target with cortex-a53.cortex-a57 for both 32 bit/64 bit.
Test: Ran bionic unit tests, ran art target tests.

(cherry picked from commit 1d9aa26d44)

Change-Id: I3325f60add7f424f8cca53c22919fc481ef5e787
2017-05-15 12:44:58 -07:00
Jeff Gaston
734e3809ad Clarify paths.go somewhat
Bug: 35562758
Test: make

Change-Id: I4cf05ffdd0962186f490467829e3576b4e269c47
2017-05-15 11:31:48 -07:00
Jayant Chowdhary
6e8115acb1 Work-around for crt objects with sdk: current
Test: convert libcups from Android.mk->Android.bp, mm -j64.

Change-Id: I4fddcfa5806d0ce27a229c37a078b0d93e9082a8
2017-05-09 14:38:10 -07:00
Colin Cross
8ff9ef4c30 Declare dependency on sanitizer runtime libraries
Moving the last users of a sanitizer runtime library to soong was
causing the runtime library to stop getting installed.  Declare
the dependency so make keeps installing it.

Test: builds
Change-Id: Ieeb9ad5c04ac8df0d1a74239da393dac5cab2b03
2017-05-08 15:57:05 -07:00
Goran Jakovljevic
31e9947020 Fix mips32r2-fp-xburst build
Remove -Wa,-mmxu option because clang doesn't support it.

Test: successful build of mips32r2-fp-xburst arch variant
Change-Id: I0c3da5dee0bb3acb44e75991b4763b061acc86e1
2017-05-08 10:08:40 +02:00
Colin Cross
2a252bef50 Support .rs and .fs files in cc_* module srcs lists
Translate .rs and .fs files to .cpp files using llvm-rs-cc.

Test: builds
Change-Id: I242cea0d09c9985730a512cec7705c3f1479f4ed
2017-05-05 18:22:30 -07:00
Josh Gao
06ec87082f Merge "Globally enable libcxx's thread safety annotations." 2017-05-04 23:47:32 +00:00
Colin Cross
307d145ed5 Remove -isystem frameworks/av/include
Remove the last -isystem for global include directory (besides
bionic).

Bug: 31751828
Test: builds
Change-Id: I8f38332de8f0cffd5c56b9b5ebeacbaaf3a4faea
Merged-In: I8f38332de8f0cffd5c56b9b5ebeacbaaf3a4faea
(cherry picked from commit d13a457a45)
2017-05-03 23:56:47 +00:00
Colin Cross
432c2860a0 Add msa mips features
References to an MSA architecture feature were added in
I3cadc29434dbd5fdb3aa780198414e90f9572ec5, but never added
to the build system.

Test: builds
Change-Id: I178813824a21475e013f7e8209d9473466ab821c
2017-05-01 16:43:41 -07:00
Josh Gao
e0b933b74d Globally enable libcxx's thread safety annotations.
Add -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS to clang extra cppflags
to make libcxx always emit thread safety annotations. Note that this
won't generate additional warnings on projects that don't already use
-Wthread-safety.

Test: treehugger
Change-Id: I517a96571d77be119510c981bc2cbaddb41dee95
2017-04-27 18:13:21 -07:00
Colin Cross
0906f17f7e Add arm neon and mips dspr2 arch features
Current modules must use armv7_a_neon to specify source files that
compile only with neon.  If a future arch variant also supports neon,
all these modules will fall back to non-neon.  Support a neon arch
feature that modules can use instead.  Similarly, support dspr2 for
mips.

arm_device.go was also mixing armv7-a-neon with armv7_a_neon.  Use
armv7-a-neon consistently, and fix the - to _ when creating the
property structs.

Test: m -j checkbuild
Change-Id: I24d3764280ab3bcbb9a73c0934edc9b99fc7f6a0
2017-04-27 12:21:24 -07:00