From e85c1834248916d7d13891e602461d9be91dda28 Mon Sep 17 00:00:00 2001 From: Pavel Chupin Date: Fri, 16 Aug 2013 18:11:13 +0400 Subject: [PATCH] Add explicit -m32/-melf_i386 for x86 target Required for x86 build with multilib compiler. Change-Id: Iac71cdc3461df6fb48cb2a7b713324ca368e6704 Signed-off-by: Pavel Chupin --- libc/Android.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libc/Android.mk b/libc/Android.mk index cfc124cae..2c1a3a629 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -519,7 +519,8 @@ endif # !arm ifeq ($(TARGET_ARCH),x86) libc_common_cflags += -DSOFTFLOAT - libc_crt_target_cflags := + libc_crt_target_cflags := -m32 + libc_crt_target_ldflags := -melf_i386 ifeq ($(ARCH_X86_HAVE_SSE2),true) libc_crt_target_cflags += -DUSE_SSE2=1 endif @@ -649,7 +650,7 @@ ALL_GENERATED_SOURCES += $(GEN) GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o @mkdir -p $(dir $@) - $(hide) $(TARGET_LD) -r -o $@ $^ + $(hide) $(TARGET_LD) $(libc_crt_target_ldflags) -r -o $@ $^ ALL_GENERATED_SOURCES += $(GEN) GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o @@ -664,7 +665,7 @@ ALL_GENERATED_SOURCES += $(GEN) GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o $(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o @mkdir -p $(dir $@) - $(hide) $(TARGET_LD) -r -o $@ $^ + $(hide) $(TARGET_LD) $(libc_crt_target_ldflags) -r -o $@ $^ ALL_GENERATED_SOURCES += $(GEN) # We rename crtend.o to crtend_android.o to avoid a