Browse Source

m68k: remove gcc wrapper

We don't need the gcc wrapper when some object files
removed from libgcc.a. Idea from uClinux-toolchain build script.

Fix some issues with shared flat, still no bootup.

For msep-data DOPIC is used, for one-region flat DOPIC
must be disabled. So both tested and working.
Waldemar Brodkorb 8 years ago
parent
commit
a5d2b1c8ab

+ 4 - 8
mk/vars.mk

@@ -96,14 +96,6 @@ endif
 
 # target tools
 TARGET_CC:=		${TARGET_COMPILER_PREFIX}gcc
-
-# use a gcc wrapper for coldfire uclinux support
-ifeq ($(ADK_TARGET_UCLINUX),y)
-ifeq ($(ADK_TARGET_ARCH_M68K),y)
-TARGET_CC:=		adk-uclinux-gcc
-endif
-endif
-
 TARGET_CXX:=		${TARGET_COMPILER_PREFIX}g++
 TARGET_LD:=		${TARGET_COMPILER_PREFIX}ld
 ifneq ($(ADK_TARGET_USE_LTO),)
@@ -175,6 +167,10 @@ TARGET_CFLAGS+=		-msep-data
 TARGET_CXXFLAGS+=	-msep-data
 endif
 
+ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
+TARGET_LDFLAGS+=	-mid-shared-library
+endif
+
 ifeq ($(ADK_TARGET_LIB_MUSL),y)
 # use -static-libgcc by default only for musl
 TARGET_CFLAGS+=		-static-libgcc

+ 6 - 1
target/linux/config/Config.in.kernel

@@ -209,7 +209,12 @@ config ADK_KERNEL_BINFMT_ELF_FDPIC
 
 config ADK_KERNEL_BINFMT_FLAT
 	bool
-	default y if ADK_TARGET_BINFMT_FLAT
+	default y if ADK_TARGET_BINFMT_FLAT_ONE
+	default y if ADK_TARGET_BINFMT_FLAT_SEP_DATA
+
+config ADK_KERNEL_BINFMT_SHARED_FLAT
+	bool
+	default y if ADK_TARGET_BINFMT_FLAT_SHARED
 
 config ADK_KERNEL_MMU
 	bool

+ 3 - 6
toolchain/gcc/Makefile

@@ -276,12 +276,6 @@ endif
 	(cd $(TOOLCHAIN_DIR)/usr/bin && \
 		ln -sf $(GNU_TARGET_NAME)-gcc $(GNU_TARGET_NAME)-cc \
 	)
-ifeq ($(ADK_TARGET_ARCH_M68K),y)
-	# create gcc wrapper for uClinux/m68k
-	echo "#!/bin/sh" > $(TOOLCHAIN_DIR)/usr/bin/adk-uclinux-gcc
-	echo "exec ${GNU_TARGET_NAME}-gcc \"\$$@\" -specs $(ADK_TOPDIR)/toolchain/gcc/m68k-uclinux-gcc.specs" >> $(TOOLCHAIN_DIR)/usr/bin/adk-uclinux-gcc
-	chmod a+x $(TOOLCHAIN_DIR)/usr/bin/adk-uclinux-gcc
-endif
 	touch $@
 
 $(WRKBUILD)/.compiled:
@@ -322,6 +316,9 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 	touch $@
 
 $(WRKBUILD)/.final:
+ifeq ($(ADK_TARGET_CPU_CF),y)
+	find $(STAGING_TARGET_DIR) -name libgcc.a -print | while read t; do $(GNU_TARGET_NAME)-ar dv "$t" _ctors.o; done
+endif
 	# remove any libiberty.a, breaking package/binutils later
 	-rm $(STAGING_TARGET_DIR)/usr/lib/libiberty.a
 	# cleanup unneeded docs

File diff suppressed because it is too large
+ 0 - 79
toolchain/gcc/m68k-uclinux-gcc.specs


+ 6 - 0
toolchain/uclibc-ng/Makefile

@@ -69,18 +69,22 @@ ifeq ($(ADK_TARGET_BINFMT_FDPIC),y)
 endif
 ifeq ($(ADK_TARGET_BINFMT_FLAT),y)
 ifeq ($(ADK_TARGET_BINFMT_FLAT_ONE),y)
+	echo '# UCLIBC_FORMAT_FLAT is not set' >> ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT\).*/\1=y/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
 endif
 ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
+	echo '# UCLIBC_FORMAT_FLAT_SEP_DATA is not set' >> ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/\1=y/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
 endif
 ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
+	echo '# UCLIBC_FORMAT_SHARED_FLAT is not set' >> ${WRKBUILD}/.config
+	echo '# HAVE_NO_SHARED is not set' >> ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_SHARED_FLAT\).*/\1=y/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT \).*/# \1 is not set/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_FORMAT_FLAT_SEP_DATA\).*/# \1 is not set/' ${WRKBUILD}/.config
@@ -240,9 +244,11 @@ endif
 
 ifeq ($(ADK_TARGET_ARCH_M68K),y)
 ifeq ($(ADK_TARGET_WITHOUT_MMU),y)
+ifeq ($(ADK_TARGET_BINFMT_FLAT_ONE)$(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y)
 	$(SED) 's/.*\(DOPIC\).*/# \1 is not set/' ${WRKBUILD}/.config
 endif
 endif
+endif
 
 # mips64 abi
 ifeq ($(ADK_TARGET_ARCH_MIPS64),y)

Some files were not shown because too many files changed in this diff