Browse Source

fix glibc build of mips32 soft-float toolchain

Waldemar Brodkorb 9 years ago
parent
commit
176ed2d7b2
3 changed files with 11 additions and 3 deletions
  1. 4 2
      target/config/Config.in.target
  2. 1 1
      toolchain/gcc/Makefile
  3. 6 0
      toolchain/glibc/Makefile.inc

+ 4 - 2
target/config/Config.in.target

@@ -24,8 +24,10 @@ config ADK_TARGET_CFLAGS
 	default "-mcpu=v8" if ADK_CPU_SPARC_V8
 	default "-mcpu=ultrasparc -m64" if ADK_CPU_SPARC_V9
 	default "-march=loongson2f -Wa,-mfix-loongson2f-nop" if ADK_CPU_LOONGSON2F
-	default "-march=mips32" if ADK_CPU_MIPS32
-	default "-march=mips32r2" if ADK_CPU_MIPS32R2
+	default "-march=mips32" if ADK_CPU_MIPS32 && ADK_hard_float
+	default "-march=mips32r2" if ADK_CPU_MIPS32R2 && ADK_hard_float
+	default "-march=mips32 -msoft-float" if ADK_CPU_MIPS32 && ADK_soft_float
+	default "-march=mips32r2 -msoft-float" if ADK_CPU_MIPS32R2 && ADK_soft_float
 	default "-march=mips64" if ADK_CPU_MIPS64
 	default "-march=armv8-a" if ADK_CPU_ARMV8
 	default "-march=armv5te -mtune=iwmmxt" if ADK_CPU_XSCALE

+ 1 - 1
toolchain/gcc/Makefile

@@ -44,7 +44,6 @@ GCC_CONFOPTS:=		--prefix=$(TOOLCHAIN_DIR)/usr \
 			--disable-libstdcxx-pch \
 			--disable-ppl-version-check \
 			--disable-cloog-version-check \
-			--disable-target-optspace \
 			--with-system-zlib \
 			--without-ppl \
 			--without-cloog \
@@ -252,6 +251,7 @@ $(GCC_BUILD_DIR_FINAL)/.configured:
 		$(WRKBUILD)/configure \
 			${GCC_CONFOPTS} \
 			${GCC_FINAL_CONFOPTS} \
+			--enable-cxx-flags='-fPIC' \
 			--enable-languages=$(LANGUAGES) \
 			--with-build-sysroot='$${prefix}/${STAGING_HOST2TARGET}' \
 			--with-sysroot='$${prefix}/${STAGING_HOST2TARGET}'

+ 6 - 0
toolchain/glibc/Makefile.inc

@@ -33,6 +33,12 @@ GLIBC_CONFOPTS:=	--build=$(GNU_HOST_NAME) \
 			--with-tls \
 			--enable-kernel="2.6.32" \
 			--enable-add-ons
+ifeq ($(ADK_TARGET_FLOAT),soft)
+GLIBC_CONFOPTS+=	--without-fp
+endif
+ifeq ($(ADK_TARGET_FLOAT),hard)
+GLIBC_CONFOPTS+=	--with-fp
+endif
 TARGET_CFLAGS:=		$(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
 TARGET_LDFLAGS:=	$(filter-out -fstack-protector-all,$(TARGET_LDFLAGS))
 GLIBC_ENV:=             PATH='${TARGET_PATH}' \