am afae9fd8
: Merge "Fix uses of -fPIC and -fPIE."
* commit 'afae9fd8ddf679344b456cc3ab339d9f330557a5': Fix uses of -fPIC and -fPIE.
This commit is contained in:
commit
897cd3d494
8 changed files with 14 additions and 11 deletions
|
@ -113,6 +113,12 @@ my_cxx := $(LOCAL_CXX)
|
||||||
my_c_includes := $(LOCAL_C_INCLUDES)
|
my_c_includes := $(LOCAL_C_INCLUDES)
|
||||||
my_generated_sources := $(LOCAL_GENERATED_SOURCES)
|
my_generated_sources := $(LOCAL_GENERATED_SOURCES)
|
||||||
|
|
||||||
|
ifeq ($(LOCAL_MODULE_CLASS),EXECUTABLES)
|
||||||
|
my_cflags += -fpie
|
||||||
|
else
|
||||||
|
my_cflags += -fPIC
|
||||||
|
endif
|
||||||
|
|
||||||
my_src_files += $(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SRC_FILES_$(my_32_64_bit_suffix))
|
my_src_files += $(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SRC_FILES_$(my_32_64_bit_suffix))
|
||||||
my_shared_libraries += $(LOCAL_SHARED_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SHARED_LIBRARIES_$(my_32_64_bit_suffix))
|
my_shared_libraries += $(LOCAL_SHARED_LIBRARIES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_SHARED_LIBRARIES_$(my_32_64_bit_suffix))
|
||||||
my_cflags += $(LOCAL_CFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CFLAGS_$(my_32_64_bit_suffix))
|
my_cflags += $(LOCAL_CFLAGS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) $(LOCAL_CFLAGS_$(my_32_64_bit_suffix))
|
||||||
|
|
|
@ -95,7 +95,7 @@ endif
|
||||||
android_config_h := $(call select-android-config-h,linux-arm)
|
android_config_h := $(call select-android-config-h,linux-arm)
|
||||||
|
|
||||||
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
||||||
-msoft-float -fpic -fPIE \
|
-msoft-float \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
-funwind-tables \
|
-funwind-tables \
|
||||||
|
@ -221,7 +221,7 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
|
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
|
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \
|
||||||
-Wl,-dynamic-linker,/system/bin/linker \
|
-Wl,-dynamic-linker,/system/bin/linker \
|
||||||
-Wl,--gc-sections \
|
-Wl,--gc-sections \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
|
|
|
@ -73,7 +73,6 @@ TARGET_GLOBAL_CFLAGS += \
|
||||||
android_config_h := $(call select-android-config-h,linux-arm64)
|
android_config_h := $(call select-android-config-h,linux-arm64)
|
||||||
|
|
||||||
TARGET_GLOBAL_CFLAGS += \
|
TARGET_GLOBAL_CFLAGS += \
|
||||||
-fpic -fPIE \
|
|
||||||
-fstack-protector \
|
-fstack-protector \
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
|
@ -186,7 +185,7 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define transform-o-to-executable-inner
|
define transform-o-to-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
|
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \
|
||||||
-Wl,-dynamic-linker,/system/bin/linker64 \
|
-Wl,-dynamic-linker,/system/bin/linker64 \
|
||||||
-Wl,--gc-sections \
|
-Wl,--gc-sections \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
|
|
|
@ -84,7 +84,6 @@ android_config_h := $(call select-android-config-h,linux-mips)
|
||||||
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
|
||||||
$(TARGET_mips_CFLAGS) \
|
$(TARGET_mips_CFLAGS) \
|
||||||
-U__unix -U__unix__ -Umips \
|
-U__unix -U__unix__ -Umips \
|
||||||
-fpic -fPIE\
|
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
-funwind-tables \
|
-funwind-tables \
|
||||||
|
@ -194,7 +193,7 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
|
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
|
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \
|
||||||
-Wl,-dynamic-linker,/system/bin/linker \
|
-Wl,-dynamic-linker,/system/bin/linker \
|
||||||
-Wl,--gc-sections \
|
-Wl,--gc-sections \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
|
|
|
@ -84,7 +84,6 @@ android_config_h := $(call select-android-config-h,linux-mips64)
|
||||||
TARGET_GLOBAL_CFLAGS += \
|
TARGET_GLOBAL_CFLAGS += \
|
||||||
$(TARGET_mips_CFLAGS) \
|
$(TARGET_mips_CFLAGS) \
|
||||||
-U__unix -U__unix__ -Umips \
|
-U__unix -U__unix__ -Umips \
|
||||||
-fpic -fPIE\
|
|
||||||
-ffunction-sections \
|
-ffunction-sections \
|
||||||
-fdata-sections \
|
-fdata-sections \
|
||||||
-funwind-tables \
|
-funwind-tables \
|
||||||
|
@ -198,7 +197,7 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define transform-o-to-executable-inner
|
define transform-o-to-executable-inner
|
||||||
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
|
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -pie \
|
||||||
-Wl,-dynamic-linker,/system/bin/linker64 \
|
-Wl,-dynamic-linker,/system/bin/linker64 \
|
||||||
-Wl,--gc-sections \
|
-Wl,--gc-sections \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
|
|
|
@ -180,7 +180,7 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
|
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
|
||||||
-nostdlib -Bdynamic \
|
-nostdlib -Bdynamic \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
-fPIE -pie \
|
-pie \
|
||||||
$(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
|
$(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
|
||||||
-Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \
|
-Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \
|
||||||
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \
|
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \
|
||||||
|
|
|
@ -183,7 +183,7 @@ $(hide) $(PRIVATE_CXX) \
|
||||||
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
|
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
|
||||||
-nostdlib -Bdynamic \
|
-nostdlib -Bdynamic \
|
||||||
-Wl,-z,nocopyreloc \
|
-Wl,-z,nocopyreloc \
|
||||||
-fPIE -pie \
|
-pie \
|
||||||
$(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
|
$(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
|
||||||
-Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \
|
-Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \
|
||||||
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \
|
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \
|
||||||
|
|
|
@ -1413,7 +1413,7 @@ endef
|
||||||
ifdef BUILD_HOST_static
|
ifdef BUILD_HOST_static
|
||||||
HOST_FPIE_FLAGS :=
|
HOST_FPIE_FLAGS :=
|
||||||
else
|
else
|
||||||
HOST_FPIE_FLAGS := -fPIE -pie
|
HOST_FPIE_FLAGS := -pie
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
|
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
|
||||||
|
|
Loading…
Reference in a new issue