Browse Source

sh4a: add support for toolchain building

Waldemar Brodkorb 8 years ago
parent
commit
edf81f75dd

+ 1 - 1
package/libgcc/Makefile

@@ -32,7 +32,7 @@ INSTALL_STYLE:=		manual
 libgcc-install:
 	$(INSTALL_DIR) ${IDIR_LIBGCC}/$(ADK_TARGET_LIBC_PATH)
 ifeq ($(ADK_TARGET_ARCH_SH),y)
-	${CP} ${STAGING_TARGET_DIR}/lib/!m4/libgcc*.so* ${IDIR_LIBGCC}/$(ADK_TARGET_LIBC_PATH)
+	${CP} ${STAGING_TARGET_DIR}/lib/!m4*/libgcc*.so* ${IDIR_LIBGCC}/$(ADK_TARGET_LIBC_PATH)
 else
 ifeq ($(ADK_TARGET_ARCH_AVR32),)
 ifeq ($(ADK_TARGET_BINFMT_FLAT),)

+ 6 - 10
target/sh/uclibc-ng.config

@@ -15,14 +15,15 @@
 # TARGET_i386 is not set
 # TARGET_i960 is not set
 # TARGET_ia64 is not set
+# TARGET_lm32 is not set
 # TARGET_m68k is not set
 # TARGET_metag is not set
 # TARGET_microblaze is not set
 # TARGET_mips is not set
 # TARGET_nios2 is not set
+# TARGET_or1k is not set
 # TARGET_powerpc is not set
 TARGET_sh=y
-# TARGET_sh64 is not set
 # TARGET_sparc is not set
 # TARGET_v850 is not set
 # TARGET_x86_64 is not set
@@ -37,8 +38,8 @@ FORCE_OPTIONS_FOR_ARCH=y
 # CONFIG_SH2 is not set
 # CONFIG_SH3 is not set
 CONFIG_SH4=y
-ARCH_HAS_BWD_MEMCPY=y
-TARGET_SUBARCH="sh4"
+# CONFIG_SH4A is not set
+TARGET_SUBARCH=""
 
 #
 # Using ELF file format
@@ -55,7 +56,6 @@ UCLIBC_HAS_FPU=y
 DO_C99_MATH=y
 # DO_XSI_MATH is not set
 # UCLIBC_HAS_FENV is not set
-UCLIBC_HAS_LONG_DOUBLE_MATH=y
 KERNEL_HEADERS=""
 HAVE_DOT_CONFIG=y
 
@@ -88,13 +88,11 @@ UCLIBC_HAS_TLS=y
 PTHREADS_DEBUG_SUPPORT=y
 UCLIBC_HAS_SYSLOG=y
 UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
 UCLIBC_HAS_OBSTACK=y
 UCLIBC_DYNAMIC_ATEXIT=y
 COMPAT_ATEXIT=y
+UCLIBC_HAS_UTMPX=y
+UCLIBC_HAS_UTMP=y
 UCLIBC_SUSV2_LEGACY=y
 UCLIBC_SUSV3_LEGACY=y
 # UCLIBC_SUSV3_LEGACY_MACROS is not set
@@ -211,8 +209,6 @@ UCLIBC_HAS_FTW=y
 # UCLIBC_HAS_FTS is not set
 UCLIBC_HAS_GLOB=y
 UCLIBC_HAS_GNU_GLOB=y
-UCLIBC_HAS_UTMP=y
-UCLIBC_HAS_UTMPX=y
 
 #
 # Library Installation Options

+ 1 - 0
target/sh/uclibc.config

@@ -40,6 +40,7 @@ FORCE_OPTIONS_FOR_ARCH=y
 # CONFIG_SH2 is not set
 # CONFIG_SH3 is not set
 CONFIG_SH4=y
+# CONFIG_SH4A is not set
 ARCH_HAS_BWD_MEMCPY=y
 TARGET_SUBARCH="sh4"
 

+ 5 - 0
toolchain/gcc/Makefile

@@ -208,7 +208,12 @@ endif
 	(cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME); \
 		ln -s ../$(STAGING_HOST2TARGET)/lib lib)
 ifeq ($(ADK_TARGET_ARCH_SH),y)
+ifeq ($(ADK_CPU_SH4),y)
 	(cd ${STAGING_TARGET_DIR}/ && ln -sf . m4)
+endif
+ifeq ($(ADK_CPU_SH4A),y)
+	(cd ${STAGING_TARGET_DIR}/ && ln -sf . m4a)
+endif
 endif
 	$(SED) '/k prot/agcc_cv_libc_provides_ssp=yes' $(WRKBUILD)/gcc/configure
 	cd $(GCC_BUILD_DIR_MINIMAL); \

+ 25 - 12
toolchain/uclibc-ng/Makefile

@@ -206,28 +206,41 @@ endif
 
 # sh
 ifeq ($(ADK_TARGET_ARCH_SH),y)
+ifeq ($(ADK_CPU_SH4A),y)
+	$(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4=\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4A\).*/\1=y/' ${WRKBUILD}/.config
+	echo foo
+	cat ${WRKBUILD}/.config
+endif
 ifeq ($(ADK_CPU_SH4),y)
-	$(SED) 's/.*\(CONFIG_SH2A=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH2=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH3=\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(CONFIG_SH4\).*/\1=y/' ${WRKBUILD}/.config
 endif
 ifeq ($(ADK_CPU_SH3),y)
-	$(SED) 's/.*\(CONFIG_SH2A=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH2=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH4=\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(CONFIG_SH3\).*/\1=y/' ${WRKBUILD}/.config
 endif
 ifeq ($(ADK_CPU_SH2),y)
-	$(SED) 's/.*\(CONFIG_SH2A=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH3=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH4=\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(CONFIG_SH2\).*/\1=y/' ${WRKBUILD}/.config
 endif
 ifeq ($(ADK_CPU_SH2A),y)
-	$(SED) 's/.*\(CONFIG_SH2A=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH3=\).*/# \1 is not set/' ${WRKBUILD}/.config
-	$(SED) 's/.*\(CONFIG_SH4=\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH2A\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH3\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4\).*/# \1 is not set/' ${WRKBUILD}/.config
+	$(SED) 's/.*\(CONFIG_SH4A\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(CONFIG_SH2A\).*/\1=y/' ${WRKBUILD}/.config
 endif
 endif