diff options
author | Colin Cross <ccross@android.com> | 2017-11-02 22:55:19 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-11-03 11:34:45 -0700 |
commit | 133dbe7bb0879a01af45895fb42e8bf58cf8e0f8 (patch) | |
tree | 07f640aae2dbd7ed0c07dcba325edc5ee8552dd7 | |
parent | 7278afc5a83894aa7883fc10a9e71c22a7c3f3fc (diff) | |
download | build_soong-133dbe7bb0879a01af45895fb42e8bf58cf8e0f8.tar.gz build_soong-133dbe7bb0879a01af45895fb42e8bf58cf8e0f8.tar.bz2 build_soong-133dbe7bb0879a01af45895fb42e8bf58cf8e0f8.zip |
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
-rw-r--r-- | cc/config/arm64_device.go | 8 | ||||
-rw-r--r-- | cc/config/arm_device.go | 8 | ||||
-rw-r--r-- | cc/config/global.go | 11 | ||||
-rw-r--r-- | cc/config/mips64_device.go | 8 | ||||
-rw-r--r-- | cc/config/mips_device.go | 8 | ||||
-rw-r--r-- | cc/config/x86_64_device.go | 8 | ||||
-rw-r--r-- | cc/config/x86_device.go | 8 |
7 files changed, 10 insertions, 49 deletions
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go index e8b47975..bdcbd05e 100644 --- a/cc/config/arm64_device.go +++ b/cc/config/arm64_device.go @@ -23,15 +23,8 @@ import ( var ( arm64Cflags = []string{ - "-fstack-protector-strong", - "-ffunction-sections", "-fdata-sections", - "-funwind-tables", - "-Wa,--noexecstack", - "-Werror=format-security", - "-D_FORTIFY_SOURCE=2", "-fno-short-enums", - "-fno-canonical-system-headers", // Help catch common 32/64-bit errors. "-Werror=implicit-function-declaration", @@ -39,7 +32,6 @@ var ( "-fno-strict-volatile-bitfields", // TARGET_RELEASE_CFLAGS - "-Wstrict-aliasing=2", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers", diff --git a/cc/config/arm_device.go b/cc/config/arm_device.go index 8e890ff4..3411e074 100644 --- a/cc/config/arm_device.go +++ b/cc/config/arm_device.go @@ -28,21 +28,13 @@ var ( } armCflags = []string{ - "-ffunction-sections", "-fdata-sections", - "-funwind-tables", - "-fstack-protector-strong", - "-Wa,--noexecstack", - "-Werror=format-security", - "-D_FORTIFY_SOURCE=2", "-fno-short-enums", - "-fno-canonical-system-headers", "-fno-builtin-sin", "-fno-strict-volatile-bitfields", // TARGET_RELEASE_CFLAGS - "-Wstrict-aliasing=2", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers", diff --git a/cc/config/global.go b/cc/config/global.go index 5587eae8..4a2f6065 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -54,12 +54,21 @@ var ( deviceGlobalCflags = []string{ "-fdiagnostics-color", - // TARGET_ERROR_FLAGS + "-fno-canonical-system-headers", + "-ffunction-sections", + "-funwind-tables", + "-fstack-protector-strong", + "-Wa,--noexecstack", + "-D_FORTIFY_SOURCE=2", + + "-Wstrict-aliasing=2", + "-Werror=return-type", "-Werror=non-virtual-dtor", "-Werror=address", "-Werror=sequence-point", "-Werror=date-time", + "-Werror=format-security", } hostGlobalCflags = []string{} diff --git a/cc/config/mips64_device.go b/cc/config/mips64_device.go index 7da693f3..9dd11652 100644 --- a/cc/config/mips64_device.go +++ b/cc/config/mips64_device.go @@ -25,20 +25,12 @@ var ( "-fomit-frame-pointer", "-funswitch-loops", "-Umips", - "-ffunction-sections", "-fdata-sections", - "-funwind-tables", - "-fstack-protector-strong", - "-Wa,--noexecstack", - "-Werror=format-security", - "-D_FORTIFY_SOURCE=2", - "-fno-canonical-system-headers", // Help catch common 32/64-bit errors. "-Werror=implicit-function-declaration", // TARGET_RELEASE_CFLAGS - "-Wstrict-aliasing=2", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers", diff --git a/cc/config/mips_device.go b/cc/config/mips_device.go index f8470bf6..840702ac 100644 --- a/cc/config/mips_device.go +++ b/cc/config/mips_device.go @@ -25,17 +25,9 @@ var ( "-fomit-frame-pointer", "-funswitch-loops", "-Umips", - "-ffunction-sections", "-fdata-sections", - "-funwind-tables", - "-fstack-protector-strong", - "-Wa,--noexecstack", - "-Werror=format-security", - "-D_FORTIFY_SOURCE=2", - "-fno-canonical-system-headers", // TARGET_RELEASE_CFLAGS - "-Wstrict-aliasing=2", "-fgcse-after-reload", "-frerun-cse-after-loop", "-frename-registers", diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go index 8d7a404f..eeb4d2f0 100644 --- a/cc/config/x86_64_device.go +++ b/cc/config/x86_64_device.go @@ -22,18 +22,10 @@ import ( var ( x86_64Cflags = []string{ - "-Wa,--noexecstack", - "-Werror=format-security", - "-D_FORTIFY_SOURCE=2", - "-Wstrict-aliasing=2", - "-ffunction-sections", "-finline-functions", "-finline-limit=300", "-fno-short-enums", "-funswitch-loops", - "-funwind-tables", - "-fstack-protector-strong", - "-fno-canonical-system-headers", // Help catch common 32/64-bit errors. "-Werror=implicit-function-declaration", diff --git a/cc/config/x86_device.go b/cc/config/x86_device.go index 59f8de73..be36de97 100644 --- a/cc/config/x86_device.go +++ b/cc/config/x86_device.go @@ -22,18 +22,10 @@ import ( var ( x86Cflags = []string{ - "-Wa,--noexecstack", - "-Werror=format-security", - "-D_FORTIFY_SOURCE=2", - "-Wstrict-aliasing=2", - "-ffunction-sections", "-finline-functions", "-finline-limit=300", "-fno-short-enums", "-funswitch-loops", - "-funwind-tables", - "-fstack-protector-strong", - "-fno-canonical-system-headers", } x86ClangCflags = append(x86Cflags, []string{ |