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

* commit 'afae9fd8ddf679344b456cc3ab339d9f330557a5':
  Fix uses of -fPIC and -fPIE.
This commit is contained in:
Dan Albert 2014-08-07 23:30:36 +00:00 committed by Android Git Automerger
commit 897cd3d494
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 \
@ -221,7 +221,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 \
@ -186,7 +185,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 \
@ -194,7 +193,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 \
@ -198,7 +197,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

@ -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

@ -183,7 +183,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)