Disable canonical prefixes of system headers
GCC know a few pre-defined paths (relative to its location) to search for headers, libraries, program, etc. By default GCC prefixes its own path(argv[0]) and calls realpath() which result in absolute path with all symlink, . and .. removed. It's usually good to have canonicalised paths, but absolute paths in *.d file can cause unnecessary relinking when stale entries in ccache cache hit Add -no-canonical-prefixes (gcc>=4.6) and -fno-canonical-system-headers (gcc>4.6) to disable realpath() on prefixed paths Change-Id: I58d739e61fb013015fb05a9c98b2132b307f915a
This commit is contained in:
parent
afe444a564
commit
48f239c94f
|
@ -31,7 +31,8 @@ CLANG_CONFIG_UNKNOWN_CFLAGS := \
|
|||
-funswitch-loops \
|
||||
-Wno-psabi \
|
||||
-Wno-unused-but-set-variable \
|
||||
-Wno-unused-but-set-parameter
|
||||
-Wno-unused-but-set-parameter \
|
||||
-fno-canonical-system-headers
|
||||
|
||||
# Clang flags for all host rules
|
||||
CLANG_CONFIG_HOST_EXTRA_ASFLAGS :=
|
||||
|
|
|
@ -52,7 +52,8 @@ HOST_GLOBAL_LDFLAGS += -static
|
|||
endif # BUILD_HOST_static
|
||||
|
||||
HOST_GLOBAL_CFLAGS += -fPIC \
|
||||
-include $(call select-android-config-h,linux-x86)
|
||||
-no-canonical-prefixes \
|
||||
-include $(call select-android-config-h,linux-x86)
|
||||
|
||||
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
|
||||
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
||||
|
|
|
@ -103,6 +103,8 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
|||
-Werror=format-security \
|
||||
-D_FORTIFY_SOURCE=2 \
|
||||
-fno-short-enums \
|
||||
-no-canonical-prefixes \
|
||||
-fno-canonical-system-headers \
|
||||
$(arch_variant_cflags) \
|
||||
-include $(android_config_h) \
|
||||
-I $(dir $(android_config_h))
|
||||
|
|
|
@ -87,6 +87,8 @@ TARGET_GLOBAL_CFLAGS += \
|
|||
-Werror=format-security \
|
||||
-D_FORTIFY_SOURCE=2 \
|
||||
-fno-short-enums \
|
||||
-no-canonical-prefixes \
|
||||
-fno-canonical-system-headers \
|
||||
$(arch_variant_cflags) \
|
||||
-include $(android_config_h) \
|
||||
-I $(dir $(android_config_h))
|
||||
|
|
|
@ -90,6 +90,8 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
|||
-Wa,--noexecstack \
|
||||
-Werror=format-security \
|
||||
-D_FORTIFY_SOURCE=2 \
|
||||
-no-canonical-prefixes \
|
||||
-fno-canonical-system-headers \
|
||||
$(arch_variant_cflags) \
|
||||
-include $(android_config_h) \
|
||||
-I $(dir $(android_config_h))
|
||||
|
|
|
@ -95,6 +95,8 @@ TARGET_GLOBAL_CFLAGS += \
|
|||
-Wa,--noexecstack \
|
||||
-Werror=format-security \
|
||||
-D_FORTIFY_SOURCE=2 \
|
||||
-no-canonical-prefixes \
|
||||
-fno-canonical-system-headers \
|
||||
$(arch_variant_cflags) \
|
||||
-include $(android_config_h) \
|
||||
-I $(dir $(android_config_h))
|
||||
|
|
|
@ -122,6 +122,8 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
|||
-fstack-protector \
|
||||
-m32 \
|
||||
-msse2 \
|
||||
-no-canonical-prefixes \
|
||||
-fno-canonical-system-headers \
|
||||
-include $(android_config_h) \
|
||||
-I $(dir $(android_config_h))
|
||||
|
||||
|
|
|
@ -120,7 +120,9 @@ TARGET_GLOBAL_CFLAGS += \
|
|||
-funswitch-loops \
|
||||
-funwind-tables \
|
||||
-fstack-protector \
|
||||
-m64
|
||||
-m64 \
|
||||
-no-canonical-prefixes \
|
||||
-fno-canonical-system-headers
|
||||
|
||||
# Help catch common 32/64-bit errors.
|
||||
TARGET_GLOBAL_CFLAGS += \
|
||||
|
|
Loading…
Reference in New Issue