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
This commit is contained in:
@@ -23,15 +23,8 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
arm64Cflags = []string{
|
arm64Cflags = []string{
|
||||||
"-fstack-protector-strong",
|
|
||||||
"-ffunction-sections",
|
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-funwind-tables",
|
|
||||||
"-Wa,--noexecstack",
|
|
||||||
"-Werror=format-security",
|
|
||||||
"-D_FORTIFY_SOURCE=2",
|
|
||||||
"-fno-short-enums",
|
"-fno-short-enums",
|
||||||
"-fno-canonical-system-headers",
|
|
||||||
|
|
||||||
// Help catch common 32/64-bit errors.
|
// Help catch common 32/64-bit errors.
|
||||||
"-Werror=implicit-function-declaration",
|
"-Werror=implicit-function-declaration",
|
||||||
@@ -39,7 +32,6 @@ var (
|
|||||||
"-fno-strict-volatile-bitfields",
|
"-fno-strict-volatile-bitfields",
|
||||||
|
|
||||||
// TARGET_RELEASE_CFLAGS
|
// TARGET_RELEASE_CFLAGS
|
||||||
"-Wstrict-aliasing=2",
|
|
||||||
"-fgcse-after-reload",
|
"-fgcse-after-reload",
|
||||||
"-frerun-cse-after-loop",
|
"-frerun-cse-after-loop",
|
||||||
"-frename-registers",
|
"-frename-registers",
|
||||||
|
@@ -28,21 +28,13 @@ var (
|
|||||||
}
|
}
|
||||||
|
|
||||||
armCflags = []string{
|
armCflags = []string{
|
||||||
"-ffunction-sections",
|
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-funwind-tables",
|
|
||||||
"-fstack-protector-strong",
|
|
||||||
"-Wa,--noexecstack",
|
|
||||||
"-Werror=format-security",
|
|
||||||
"-D_FORTIFY_SOURCE=2",
|
|
||||||
"-fno-short-enums",
|
"-fno-short-enums",
|
||||||
"-fno-canonical-system-headers",
|
|
||||||
|
|
||||||
"-fno-builtin-sin",
|
"-fno-builtin-sin",
|
||||||
"-fno-strict-volatile-bitfields",
|
"-fno-strict-volatile-bitfields",
|
||||||
|
|
||||||
// TARGET_RELEASE_CFLAGS
|
// TARGET_RELEASE_CFLAGS
|
||||||
"-Wstrict-aliasing=2",
|
|
||||||
"-fgcse-after-reload",
|
"-fgcse-after-reload",
|
||||||
"-frerun-cse-after-loop",
|
"-frerun-cse-after-loop",
|
||||||
"-frename-registers",
|
"-frename-registers",
|
||||||
|
@@ -54,12 +54,21 @@ var (
|
|||||||
deviceGlobalCflags = []string{
|
deviceGlobalCflags = []string{
|
||||||
"-fdiagnostics-color",
|
"-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=return-type",
|
||||||
"-Werror=non-virtual-dtor",
|
"-Werror=non-virtual-dtor",
|
||||||
"-Werror=address",
|
"-Werror=address",
|
||||||
"-Werror=sequence-point",
|
"-Werror=sequence-point",
|
||||||
"-Werror=date-time",
|
"-Werror=date-time",
|
||||||
|
"-Werror=format-security",
|
||||||
}
|
}
|
||||||
|
|
||||||
hostGlobalCflags = []string{}
|
hostGlobalCflags = []string{}
|
||||||
|
@@ -25,20 +25,12 @@ var (
|
|||||||
"-fomit-frame-pointer",
|
"-fomit-frame-pointer",
|
||||||
"-funswitch-loops",
|
"-funswitch-loops",
|
||||||
"-Umips",
|
"-Umips",
|
||||||
"-ffunction-sections",
|
|
||||||
"-fdata-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.
|
// Help catch common 32/64-bit errors.
|
||||||
"-Werror=implicit-function-declaration",
|
"-Werror=implicit-function-declaration",
|
||||||
|
|
||||||
// TARGET_RELEASE_CFLAGS
|
// TARGET_RELEASE_CFLAGS
|
||||||
"-Wstrict-aliasing=2",
|
|
||||||
"-fgcse-after-reload",
|
"-fgcse-after-reload",
|
||||||
"-frerun-cse-after-loop",
|
"-frerun-cse-after-loop",
|
||||||
"-frename-registers",
|
"-frename-registers",
|
||||||
|
@@ -25,17 +25,9 @@ var (
|
|||||||
"-fomit-frame-pointer",
|
"-fomit-frame-pointer",
|
||||||
"-funswitch-loops",
|
"-funswitch-loops",
|
||||||
"-Umips",
|
"-Umips",
|
||||||
"-ffunction-sections",
|
|
||||||
"-fdata-sections",
|
"-fdata-sections",
|
||||||
"-funwind-tables",
|
|
||||||
"-fstack-protector-strong",
|
|
||||||
"-Wa,--noexecstack",
|
|
||||||
"-Werror=format-security",
|
|
||||||
"-D_FORTIFY_SOURCE=2",
|
|
||||||
"-fno-canonical-system-headers",
|
|
||||||
|
|
||||||
// TARGET_RELEASE_CFLAGS
|
// TARGET_RELEASE_CFLAGS
|
||||||
"-Wstrict-aliasing=2",
|
|
||||||
"-fgcse-after-reload",
|
"-fgcse-after-reload",
|
||||||
"-frerun-cse-after-loop",
|
"-frerun-cse-after-loop",
|
||||||
"-frename-registers",
|
"-frename-registers",
|
||||||
|
@@ -22,18 +22,10 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
x86_64Cflags = []string{
|
x86_64Cflags = []string{
|
||||||
"-Wa,--noexecstack",
|
|
||||||
"-Werror=format-security",
|
|
||||||
"-D_FORTIFY_SOURCE=2",
|
|
||||||
"-Wstrict-aliasing=2",
|
|
||||||
"-ffunction-sections",
|
|
||||||
"-finline-functions",
|
"-finline-functions",
|
||||||
"-finline-limit=300",
|
"-finline-limit=300",
|
||||||
"-fno-short-enums",
|
"-fno-short-enums",
|
||||||
"-funswitch-loops",
|
"-funswitch-loops",
|
||||||
"-funwind-tables",
|
|
||||||
"-fstack-protector-strong",
|
|
||||||
"-fno-canonical-system-headers",
|
|
||||||
|
|
||||||
// Help catch common 32/64-bit errors.
|
// Help catch common 32/64-bit errors.
|
||||||
"-Werror=implicit-function-declaration",
|
"-Werror=implicit-function-declaration",
|
||||||
|
@@ -22,18 +22,10 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
x86Cflags = []string{
|
x86Cflags = []string{
|
||||||
"-Wa,--noexecstack",
|
|
||||||
"-Werror=format-security",
|
|
||||||
"-D_FORTIFY_SOURCE=2",
|
|
||||||
"-Wstrict-aliasing=2",
|
|
||||||
"-ffunction-sections",
|
|
||||||
"-finline-functions",
|
"-finline-functions",
|
||||||
"-finline-limit=300",
|
"-finline-limit=300",
|
||||||
"-fno-short-enums",
|
"-fno-short-enums",
|
||||||
"-funswitch-loops",
|
"-funswitch-loops",
|
||||||
"-funwind-tables",
|
|
||||||
"-fstack-protector-strong",
|
|
||||||
"-fno-canonical-system-headers",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
x86ClangCflags = append(x86Cflags, []string{
|
x86ClangCflags = append(x86Cflags, []string{
|
||||||
|
Reference in New Issue
Block a user