Commit graph

50 commits

Author SHA1 Message Date
Yi Kong
c9f6db50d3 Move -Wno-null-pointer-arithmetic to external only
Test: m checkbuild
Bug: 72331524
Change-Id: I9c49a8cef547f6c840001fd203a0abecaeef44d5
Merged-In: I9c49a8cef547f6c840001fd203a0abecaeef44d5
(cherry picked from commit 3e88cb0399)
2018-12-13 18:36:19 -08:00
Yi Kong
4603b9f411 Remove unneeded -Wno-expansion-to-defined flag
Test: m checkbuild
Bug: 29823425
Change-Id: I8c9c7cc92757af20d3a3bbcebeb6360d1df91530
2018-12-10 04:55:51 -08:00
Yi Kong
02c0ad48ba Remove unneeded -Wno-deprecated-register flag
Test: m checkbuild
Change-Id: I030a66b8a484673caf3a96a844dc26954e08071a
2018-12-09 04:41:38 +00:00
Yi Kong
4a7400be79 Revert "Revert "Remove unneeded -Wno-constant-logical-operand flag""
This reverts commit f993e7797d.

Build breakage fixed.

Test: m checkbuild
2018-12-07 22:00:57 +00:00
Yi Kong
d218df1b2f Remove unneeded -Wno-dangling-field flag
Test: m checkbuild
Change-Id: I4867fb80ffa901d4fef96b315cd114e6f9b82476
2018-12-06 16:43:55 -08:00
Chih-Hung Hsieh
1017b37654 Undo workaround of flag filtering.
* Now header-abi-dumper does not complain about -fno-sanitize=implicit-integer-sign-change

Bug: 119558057
Test: make checkbuild
Change-Id: I80be08dd5aa184498bdbb83b42b877dbec152165
2018-12-06 12:12:41 -08:00
Martin Stjernholm
f993e7797d Revert "Remove unneeded -Wno-constant-logical-operand flag"
This reverts commit 4f0ce757aa.

Reason for revert: Breaks several targets in internal git_master, e.g. http://ab/5165971.

Test: Build failing library
Change-Id: I02a5ade05a76b24020586c55a4e8f441ca7708a9
2018-12-06 12:17:40 +00:00
Yi Kong
4f0ce757aa Remove unneeded -Wno-constant-logical-operand flag
Test: m checkbuild
Change-Id: If1ec62b6d88b8260c9ec39e0d63a379e7ae573e9
2018-12-06 00:18:05 +00:00
Chih-Hung Hsieh
3567e62f97 Switch to clang-r346389.
* Add -fno-sanitize=implicit-integer-sign-change when
  there is any integer related sanitizer, and this check
  is not explicitly specified.
  Android core does not boot with this new sanitizer yet.
* Filter out -fno-sanitize=implicit-integer-sign-change
  from tooling flags.

Bug: 119329758
Bug: 119557795
Test: make checkbuild, boot, go/clang-r346389-testing
Change-Id: I709de569cb73d070fc4958e2b4387f4041bc5438
2018-12-04 19:50:45 +00:00
Yi Kong
734a07c66d Revert "Revert "Remove unnecessary warning suppression""
This reverts commit afedf3bdc9.

Build failure fixed.

Change-Id: I46e7e222c2b5bfa5b1846f3fe87444afb70f1b31
2018-12-04 00:42:27 +00:00
Vishnu Nair
afedf3bdc9 Revert "Remove unnecessary warning suppression"
This reverts commit ee53a98e31.

Reason for revert: build break

Change-Id: I065b702d6eaa2e72d47a2b7a404fdd7fe51661c3
2018-11-30 21:01:30 +00:00
Yi Kong
ee53a98e31 Remove unnecessary warning suppression
All instances of no-self-assign-overloaded warning have been fixed,
remove the suppression flag.

Test: m checkbuild
Change-Id: I70d9d6f721b36ebb5c3974893f79a09e4b1d1f4d
2018-11-09 23:09:19 +00:00
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
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
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
Logan Chien
aceb86e345 Merge "Remove flags from ClangLibToolingUnknownCflags"
am: 0b6bcd4014

Change-Id: I7f7e9e80052e748c1d92f46fee4552c1b4a45a2b
2018-10-17 03:08:54 -07: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
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
Stephen Hines
f4fe6300e6 Merge "Switch to clang-r339409."
am: ee15f2a7c7

Change-Id: Ic7de9d629900ce71315029a82f32a89a11c730be
2018-10-01 09:20:41 -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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Dan Willemsen
253cab89ee Fix absolute paths in clang debug output
As of the latest clang python wrapper, clang is being executed with an
absolute path. That means that clang-provided headers are written with
absolute paths in the debug info, making the builds non-reproducible
(especially with ccache).

So keep our current PWD=/proc/self/pwd -fdebug-prefix-map=/proc/self/cwd=,
but add a new -fdebug-prefix-map=$PWD/= to rewrite these absolute paths.

Bug: 36463318
Test: m -j libc adb; grep for path names
Test: spot check objdump -W before/after, see only expected diffs.
Change-Id: Ic2cdfca051d3c38b753fd5c1fcbeaca8bafc29ae
2017-03-27 16:58:43 -07:00
Elliott Hughes
5a0401ab9c Consistently use -std=gnu99 for gcc as well as clang.
This matters for C files that are also built for Windows. Previously they'd
be compiled with -std=gnu99 for the host but [effectively] -std=gnu89 for
Windows.

Bug: http://b/32019064
Test: builds, and can build libcrypto_utils without a manual -std= line
Change-Id: I9c5cc7832220b5c3d6a007ff10d076e26fd8c75d
2016-10-13 14:41:31 +00:00
Colin Cross
b98c8b0595 Move toolchain and global variables into separate package
Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
2016-08-01 13:37:01 -07:00
Renamed from cc/clang.go (Browse further)