Browse Source

x32: fix toolchain buiding

Waldemar Brodkorb 7 years ago
parent
commit
517bdcccb4
2 changed files with 8 additions and 2 deletions
  1. 6 0
      mk/vars.mk
  2. 2 2
      toolchain/gcc/Makefile

+ 6 - 0
mk/vars.mk

@@ -104,6 +104,12 @@ TARGET_CC:=		clang --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
 TARGET_CXX:=		clang++ --target=${GNU_TARGET_NAME} --sysroot=$(STAGING_TARGET_DIR)
 endif
 
+# for x86_64 x32 ABI we need to extend TARGET_CC/TARGET_CXX
+ifeq ($(ADK_TARGET_ABI_X32),y)
+TARGET_CC+=            $(ADK_TARGET_ABI_CFLAGS)
+TARGET_CXX+=           $(ADK_TARGET_ABI_CFLAGS)
+endif
+
 TARGET_LD:=		${TARGET_COMPILER_PREFIX}ld
 ifneq ($(ADK_TARGET_USE_LTO),)
 TARGET_AR:=		${TARGET_COMPILER_PREFIX}gcc-ar

+ 2 - 2
toolchain/gcc/Makefile

@@ -164,9 +164,9 @@ endif
 
 ifeq ($(ADK_TARGET_ARCH_X86_64),y)
 ifneq ($(ADK_TARGET_ABI_X32),)
-GCC_FINAL_CONFOPTS+=	--with-abi=x32
+GCC_CONFOPTS+=		--with-abi=x32 --enable-multilib
 else
-GCC_FINAL_CONFOPTS+=	--disable-biarch --disable-multilib
+GCC_CONFOPTS+=		--disable-biarch --disable-multilib
 endif
 endif