Browse Source

rework float support

ARM, MIPS and PPC have support for soft or hard float configuration
of toolchain and system. Generalize the support for this in OpenADK.
Waldemar Brodkorb 9 years ago
parent
commit
4345869df8

+ 1 - 0
Config.in

@@ -25,6 +25,7 @@ source "target/config/Config.in.kernel"
 source "target/config/Config.in.arch"
 source "target/config/Config.in.system"
 source "target/config/Config.in.endian"
+source "target/config/Config.in.float"
 source "target/config/Config.in.arm"
 source "target/config/Config.in.cris"
 source "target/config/Config.in.mips"

+ 0 - 21
target/config/Config.in.arm.default

@@ -1,33 +1,12 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
-config ADK_soft_float
-	bool
-
-config ADK_hard_float
-	bool
-
 config ADK_fpu_neon
 	bool
 
 config ADK_fpu_vfp
 	bool
 
-config ADK_TARGET_ARM_HARD_FLOAT
-	bool
-        select ADK_hard_float
-	default y if ADK_TARGET_ABI_EABIHF
-
-config ADK_TARGET_ARM_SOFT_FLOAT
-	bool
-        select ADK_soft_float
-	default y if ADK_TARGET_ABI_EABI
-
-config ADK_TARGET_FLOAT
-	string
-	default "hard" if ADK_hard_float
-	default "soft" if ADK_soft_float
-
 config ADK_TARGET_FPU
 	string
 	default "vfp" if ADK_fpu_vfp

+ 5 - 0
target/config/Config.in.float

@@ -0,0 +1,5 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+source target/config/Config.in.float.choice
+source target/config/Config.in.float.default

+ 18 - 0
target/config/Config.in.float.choice

@@ -0,0 +1,18 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+choice ADK_TARGET_FLOAT
+prompt "Float configuration"
+depends on ADK_TARGET_ARCH_ARM || \
+	   ADK_TARGET_ARCH_MIPS || \
+	   ADK_TARGET_ARCH_PPC
+
+config ADK_TARGET_HARD_FLOAT
+	bool "hard-float"
+	select ADK_hard_float
+
+config ADK_TARGET_SOFT_FLOAT
+	bool "soft-float"
+	select ADK_soft_float
+
+endchoice

+ 14 - 0
target/config/Config.in.float.default

@@ -0,0 +1,14 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+config ADK_soft_float
+	bool
+
+config ADK_hard_float
+	bool
+
+config ADK_TARGET_FLOAT
+	string
+	default "hard" if ADK_hard_float
+	default "soft" if ADK_soft_float
+

+ 0 - 14
target/config/Config.in.mips.choice

@@ -14,17 +14,3 @@ config ADK_CPU_MIPS_MIPS32R2
         select ADK_CPU_MIPS32R2
 
 endchoice
-
-choice ADK_TARGET_MIPS_FLOAT
-prompt "Float configuration"
-depends on ADK_TARGET_ARCH_MIPS
-
-config ADK_TARGET_MIPS_HARD_FLOAT
-	bool "hard-float"
-	select ADK_hard_float
-
-config ADK_TARGET_MIPS_SOFT_FLOAT
-	bool "soft-float"
-	select ADK_soft_float
-
-endchoice

+ 0 - 10
target/config/Config.in.mips.default

@@ -1,13 +1,3 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
-config ADK_soft_float
-	bool
-
-config ADK_hard_float
-	bool
-
-config ADK_TARGET_FLOAT
-	string
-	default "hard" if ADK_hard_float
-	default "soft" if ADK_soft_float

+ 20 - 20
toolchain/gcc/Makefile

@@ -69,6 +69,26 @@ GCC_FINAL_CONFOPTS+=	--enable-shared='libstdc++,libgcc'
 endif
 endif
 
+ifeq ($(ADK_TOOLCHAIN_WITH_SSP),y)
+GCC_FINAL_CONFOPTS+=	--enable-libssp
+else
+GCC_FINAL_CONFOPTS+=	--disable-libssp
+endif
+
+ifeq ($(ADK_TOOLCHAIN_WITH_LTO),y)
+GCC_CONFOPTS+=		--enable-lto
+else
+GCC_CONFOPTS+=		--disable-lto
+endif
+
+#
+# architecture specific
+#
+
+ifneq ($(ADK_TARGET_ARCH_ARM)$(ADK_TARGET_ARCH_MIPS)$(ADK_TARGET_ARCH_PPC),)
+GCC_CONFOPTS+=		--with-float=$(ADK_TARGET_FLOAT)
+endif
+
 ifeq ($(ADK_TARGET_ARCH_M68K)$(ADK_TARGET_ARCH_SH)$(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_ARCH_X86),)
 GCC_FINAL_CONFOPTS+=	--disable-biarch --disable-multilib
 endif
@@ -99,31 +119,11 @@ GCC_FINAL_CONFOPTS+=	--disable-biarch --disable-multilib
 endif
 endif
 
-ifeq ($(ADK_TOOLCHAIN_WITH_SSP),y)
-GCC_FINAL_CONFOPTS+=	--enable-libssp
-else
-GCC_FINAL_CONFOPTS+=	--disable-libssp
-endif
-
-ifeq ($(ADK_TOOLCHAIN_WITH_LTO),y)
-GCC_CONFOPTS+=		--enable-lto
-else
-GCC_CONFOPTS+=		--disable-lto
-endif
-
 ifeq ($(ADK_TARGET_ARCH_PPC),y)
 GCC_CONFOPTS+=		--with-long-double-64 --enable-secureplt
-ifneq ($(ADK_TARGET_CPU_WITH_FPU),y)
-GCC_CONFOPTS+=		--with-float=soft
-endif
-endif
-
-ifeq ($(ADK_TARGET_ARCH_MIPS),y)
-GCC_CONFOPTS+=		--with-float=$(ADK_TARGET_FLOAT)
 endif
 
 ifeq ($(ADK_TARGET_ARCH_ARM),y)
-GCC_CONFOPTS+=		--with-float=$(ADK_TARGET_FLOAT)
 ifneq ($(ADK_TARGET_FPU),)
 GCC_CONFOPTS+=		--with-fpu=$(ADK_TARGET_FPU)
 endif

+ 21 - 26
toolchain/uclibc-ng/Makefile

@@ -30,6 +30,14 @@ else
 	$(SED) 's/.*\(ARCH_LITTLE_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(ARCH_WANTS_LITTLE_ENDIAN\).*/# \1 is not set/' ${WRKBUILD}/.config
 endif
+ifeq ($(ADK_TARGET_SOFT_FLOAT),y)
+	$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/#\1=y/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_HARD_FLOAT),y)
+	$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
+endif
 ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/\1=y/' ${WRKBUILD}/.config
 endif
@@ -67,32 +75,29 @@ ifeq ($(ADK_TARGET_USE_SSP),y)
 	echo "UCLIBC_BUILD_SSP=y" >> ${WRKBUILD}/.config
 endif
 
+#
 # architecture specific options
+#
+
 # arm
 ifeq ($(ADK_TARGET_ARCH_ARM),y)
-ifeq ($(ADK_TARGET_ABI_EABI),y)
-	$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/#\1=y/' ${WRKBUILD}/.config
-
-endif
-ifeq ($(ADK_TARGET_ABI_EABIHF),y)
-	$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
-endif
 ifeq ($(ADK_TARGET_ARCH_ARM_WITH_THUMB),y)
 	$(SED) 's/.*\(COMPILE_IN_THUMB_MODE\).*/\1=y/' ${WRKBUILD}/.config
 endif
 endif
-# mips/mips64
-ifeq ($(ADK_TARGET_ARCH_MIPS64),y)
-	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS64\).*/\1=y/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32\).*/# \1 is not set/' ${WRKBUILD}/.config
-endif
+
+# mips
 ifeq ($(ADK_TARGET_ARCH_MIPS),y)
-	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32\).*/\1=y/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS64\).*/# \1 is not set/' ${WRKBUILD}/.config
+ifeq ($(ADK_CPU_MIPS32R2),y)
+	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32 \).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32R2\).*/\1=y/' ${WRKBUILD}/.config
 endif
+endif
+
+# mips64
 ifeq ($(ADK_TARGET_ARCH_MIPS64),y)
+	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS64\).*/\1=y/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_MIPS_ISA_MIPS32\).*/# \1 is not set/' ${WRKBUILD}/.config
 ifeq ($(ADK_n64),y)
 	$(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/\1=y/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(CONFIG_MIPS_O32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
@@ -108,16 +113,6 @@ ifeq ($(ADK_o32),y)
 	$(SED) 's/.*\(CONFIG_MIPS_N32_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(CONFIG_MIPS_N64_ABI\).*/# \1 is not set/' ${WRKBUILD}/.config
 endif
-endif
-# powerpc
-ifeq ($(ADK_TARGET_ARCH_PPC),y)
-ifeq ($(ADK_TARGET_CPU_WITH_FPU),y)
-	$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/\1=y/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/# \1 is not set/' ${WRKBUILD}/.config
-else
-	$(SED) 's/.*\(UCLIBC_HAS_FPU\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(UCLIBC_HAS_SOFT_FLOAT\).*/#\1=y/' ${WRKBUILD}/.config
-endif
 endif
 	echo N|PATH='$(HOST_PATH)' $(MAKE) ${UCLIBC_MAKEOPTS} -C $(WRKBUILD) \
 		PREFIX=$(STAGING_TARGET_DIR) \