am 897cd3d4: am afae9fd8: Merge "Fix uses of -fPIC and -fPIE."

* commit '897cd3d494272b8a6a12f0fb6d02bfe7426a309c':
  Fix uses of -fPIC and -fPIE.
This commit is contained in:
Dan Albert 2014-08-08 00:23:55 +00:00 committed by Android Git Automerger
commit d423e5fbdb
8 changed files with 14 additions and 11 deletions

View File

@ -113,6 +113,12 @@ my_cxx := $(LOCAL_CXX)
my_c_includes := $(LOCAL_C_INCLUDES)
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_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))

View File

@ -95,7 +95,7 @@ endif
android_config_h := $(call select-android-config-h,linux-arm)
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
-msoft-float -fpic -fPIE \
-msoft-float \
-ffunction-sections \
-fdata-sections \
-funwind-tables \
@ -218,7 +218,7 @@ $(hide) $(PRIVATE_CXX) \
endef
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,--gc-sections \
-Wl,-z,nocopyreloc \

View File

@ -73,7 +73,6 @@ TARGET_GLOBAL_CFLAGS += \
android_config_h := $(call select-android-config-h,linux-arm64)
TARGET_GLOBAL_CFLAGS += \
-fpic -fPIE \
-fstack-protector \
-ffunction-sections \
-fdata-sections \
@ -185,7 +184,7 @@ $(hide) $(PRIVATE_CXX) \
endef
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,--gc-sections \
-Wl,-z,nocopyreloc \

View File

@ -84,7 +84,6 @@ android_config_h := $(call select-android-config-h,linux-mips)
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
$(TARGET_mips_CFLAGS) \
-U__unix -U__unix__ -Umips \
-fpic -fPIE\
-ffunction-sections \
-fdata-sections \
-funwind-tables \
@ -191,7 +190,7 @@ $(hide) $(PRIVATE_CXX) \
endef
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,--gc-sections \
-Wl,-z,nocopyreloc \

View File

@ -84,7 +84,6 @@ android_config_h := $(call select-android-config-h,linux-mips64)
TARGET_GLOBAL_CFLAGS += \
$(TARGET_mips_CFLAGS) \
-U__unix -U__unix__ -Umips \
-fpic -fPIE\
-ffunction-sections \
-fdata-sections \
-funwind-tables \
@ -195,7 +194,7 @@ $(hide) $(PRIVATE_CXX) \
endef
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,--gc-sections \
-Wl,-z,nocopyreloc \

View File

@ -177,7 +177,7 @@ $(hide) $(PRIVATE_CXX) \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
-nostdlib -Bdynamic \
-Wl,-z,nocopyreloc \
-fPIE -pie \
-pie \
$(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
-Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \

View File

@ -180,7 +180,7 @@ $(hide) $(PRIVATE_CXX) \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
-nostdlib -Bdynamic \
-Wl,-z,nocopyreloc \
-fPIE -pie \
-pie \
$(PRIVATE_TARGET_GLOBAL_LD_DIRS) \
-Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \

View File

@ -1413,7 +1413,7 @@ endef
ifdef BUILD_HOST_static
HOST_FPIE_FLAGS :=
else
HOST_FPIE_FLAGS := -fPIE -pie
HOST_FPIE_FLAGS := -pie
endif
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)