Bläddra i källkod

add fpu settings, fix symlinks

Waldemar Brodkorb 10 år sedan
förälder
incheckning
b357b7bef1

+ 1 - 0
rules.mk

@@ -32,6 +32,7 @@ ADK_TARGET_LIBC:=			$(strip $(subst ",, $(ADK_TARGET_LIBC)))
 ADK_TARGET_LIBC_PATH:=			$(strip $(subst ",, $(ADK_TARGET_LIBC_PATH)))
 ADK_TARGET_ENDIAN:=			$(strip $(subst ",, $(ADK_TARGET_ENDIAN)))
 ADK_TARGET_FLOAT:=			$(strip $(subst ",, $(ADK_TARGET_FLOAT)))
+ADK_TARGET_FPU:=			$(strip $(subst ",, $(ADK_TARGET_FPU)))
 ADK_TARGET_ARM_MODE:=			$(strip $(subst ",, $(ADK_TARGET_ARM_MODE)))
 ADK_TARGET_CPU_ARCH:=			$(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
 ADK_TARGET_CFLAGS:=			$(strip $(subst ",, $(ADK_TARGET_CFLAGS)))

+ 1 - 0
target/arm/sys-available/cubox-i

@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_CUBOX_I
 	select ADK_little
 	select ADK_hard_float
 	select ADK_eabihf
+	select ADK_fpu_neon
 	select ADK_cubox_i
 	select ADK_CPU_CORTEX_A9
 	select ADK_TARGET_WITH_MMC

+ 1 - 0
target/arm/sys-available/qemu-arm

@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_QEMU_ARM
 	select ADK_qemu_arm
 	select ADK_little
 	select ADK_soft_float
+	select ADK_fpu_vfp
 	select ADK_eabi
 	select ADK_HARDWARE_QEMU
 	select ADK_TARGET_KERNEL_ZIMAGE

+ 1 - 0
target/arm/sys-available/qemu-armhf

@@ -5,6 +5,7 @@ config ADK_TARGET_SYSTEM_QEMU_ARMHF
 	select ADK_little
 	select ADK_hard_float
 	select ADK_eabihf
+	select ADK_fpu_vfp
 	select ADK_HARDWARE_QEMU
 	select ADK_TARGET_KERNEL_ZIMAGE
 	help

+ 1 - 0
target/arm/sys-available/raspberry-pi

@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_RASPBERRY_PI
 	select ADK_little
 	select ADK_hard_float
 	select ADK_eabihf
+	select ADK_fpu_vfp
 	select ADK_raspberry_pi
 	select ADK_CPU_ARM1176JZF_S
 	select ADK_TARGET_WITH_MMC

+ 1 - 0
target/arm/sys-available/toolchain-arm

@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_TOOLCHAIN_ARM
 	select ADK_toolchain_arm
 	select ADK_little
 	select ADK_soft_float
+	select ADK_fpu_vfp
 	select ADK_eabi
 	select ADK_TOOLCHAIN
 	select ADK_TARGET_PACKAGE_TGZ

+ 1 - 0
target/arm/sys-available/toolchain-armhf

@@ -4,6 +4,7 @@ config ADK_TARGET_SYSTEM_TOOLCHAIN_ARMHF
 	select ADK_little
 	select ADK_hard_float
 	select ADK_eabihf
+	select ADK_fpu_vfp
 	select ADK_toolchain_armhf
 	select ADK_TOOLCHAIN
 	select ADK_TARGET_PACKAGE_TGZ

+ 11 - 0
target/config/Config.in

@@ -37,6 +37,12 @@ config ADK_soft_float
 config ADK_hard_float
 	boolean
 
+config ADK_fpu_neon
+	boolean
+
+config ADK_fpu_vfp
+	boolean
+
 config ADK_mode_arm
 	boolean
 
@@ -48,6 +54,11 @@ config ADK_TARGET_FLOAT
 	default "hard" if ADK_hard_float
 	default "soft" if ADK_soft_float
 
+config ADK_TARGET_FPU
+	string
+	default "vfp" if ADK_fpu_vfp
+	default "neon" if ADK_fpu_neon
+
 config ADK_TARGET_ARM_MODE
 	depends on ADK_LINUX_ARM
 	string

+ 12 - 16
toolchain/gcc/Makefile

@@ -80,6 +80,9 @@ endif
 ifeq ($(ARCH),arm)
 GCC_CONFOPTS+=		--with-float=$(ADK_TARGET_FLOAT)
 GCC_CONFOPTS+=		--with-mode=$(ADK_TARGET_ARM_MODE)
+ifneq ($(ADK_TARGET_FPU),)
+GCC_CONFOPTS+=		--with-fpu=$(ADK_TARGET_FPU)
+endif
 endif
 
 ifeq ($(ADK_CPU_ARM926EJ_S),y)
@@ -87,11 +90,11 @@ GCC_CONFOPTS+=          --with-arch=armv5te --with-tune=arm1176jzf-s
 endif
 
 ifeq ($(ADK_CPU_ARM1176JZF_S),y)
-GCC_CONFOPTS+=          --with-arch=armv6 --with-tune=arm1176jzf-s --with-fpu=vfp
+GCC_CONFOPTS+=          --with-arch=armv6 --with-tune=arm1176jzf-s
 endif
 
 ifeq ($(ADK_CPU_CORTEX_A9),y)
-GCC_CONFOPTS+=          --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=neon
+GCC_CONFOPTS+=          --with-arch=armv7-a --with-tune=cortex-a9
 endif
 
 ifeq ($(ADK_CPU_SPARC_V9),y)
@@ -120,11 +123,13 @@ GCC_BUILD_DIR_FINAL:=	$(WRKBUILD)-final
 $(GCC_BUILD_DIR_MINIMAL)/.configured:
 	mkdir -p $(GCC_BUILD_DIR_MINIMAL)
 	# these symlinks are very important, do not remove
-	rm -rf $(TOOLCHAIN_DIR)/$(GNU_TARGET_NAME)/sys-include
-	ln -sf ${STAGING_TARGET_DIR}/usr/include \
-		$(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/sys-include
+	rm -rf $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/sys-include
+	mkdir -p $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)
+	(cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME); \
+		ln -s ../$(STAGING_HOST2TARGET)/usr/include sys-include)
 	rm -rf ${TOOLCHAIN_DIR}/usr/$(GNU_TARGET_NAME)/lib
-	ln -sf ${STAGING_TARGET_DIR}/lib $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib
+	(cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME); \
+		ln -s ../$(STAGING_HOST2TARGET)/lib lib)
 ifeq ($(ADK_LINUX_SH),y)
 	(cd ${STAGING_TARGET_DIR}/ && ln -sf . m4 && ln -sf . m4-nofpu)
 endif
@@ -202,16 +207,7 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 		done;
 	(cd $(TOOLCHAIN_DIR)/usr/bin && \
 		ln -sf $(GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-gcc-${PKG_VERSION})
-	@-test -d $(STAGING_TARGET_DIR)/lib32 && \
-		cd $(STAGING_TARGET_DIR)/lib32 && \
-		ln -sf libstdc++.so.6.0.18 libstdc++.so && \
-		ln -sf libstdc++.so.6.0.18 libstdc++.so.6
-	@-test -d $(STAGING_TARGET_DIR)/libx32 && \
-		cd $(STAGING_TARGET_DIR)/libx32 && \
-		ln -sf libstdc++.so.6.0.18 libstdc++.so && \
-		ln -sf libstdc++.so.6.0.18 libstdc++.so.6
-	@-test -d $(STAGING_TARGET_DIR)/lib64 && \
-		cd $(STAGING_TARGET_DIR)/lib64 && \
+	cd $(STAGING_TARGET_DIR)/lib && \
 		ln -sf libstdc++.so.6.0.18 libstdc++.so && \
 		ln -sf libstdc++.so.6.0.18 libstdc++.so.6
 	# cleanup unneeded docs