Browse Source

c6x: fix shared toolchain building, disable multilib dirs in gcc 7.3.0

Waldemar Brodkorb 3 years ago
parent
commit
cd2e2a876c

+ 6 - 1
mk/vars.mk

@@ -76,7 +76,7 @@ endif
 
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-$(ADK_VENDOR)-$(ADK_TARGET_LINUXTYPE)-$(ADK_TARGET_SUFFIX)
 ifeq ($(ADK_TARGET_ARCH_C6X),y)
-GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_LINUXTYPE)
+GNU_TARGET_NAME:=	ti$(ADK_TARGET_CPU_ARCH)-$(ADK_VENDOR)-$(ADK_TARGET_LINUXTYPE)
 endif
 ifeq ($(ADK_TARGET_OS_BAREMETAL),y)
 GNU_TARGET_NAME:=	$(ADK_TARGET_CPU_ARCH)-$(ADK_TARGET_SUFFIX)
@@ -188,6 +188,11 @@ ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
 TARGET_LDFLAGS+=	-mid-shared-library
 endif
 
+ifeq ($(ADK_TARGET_BINFMT_DSBT),y)
+TARGET_CFLAGS+=		-mdsbt
+TARGET_CXXFLAGS+=	-mdsbt
+endif
+
 # security optimization, see http://www.akkadia.org/drepper/dsohowto.pdf
 ifneq ($(ADK_TARGET_USE_LD_RELRO),)
 TARGET_LDFLAGS+=	-Wl,-z,relro

+ 1 - 1
target/c6x/Makefile

@@ -5,7 +5,7 @@ include $(ADK_TOPDIR)/rules.mk
 include $(ADK_TOPDIR)/mk/kernel-build.mk
 include $(ADK_TOPDIR)/mk/image.mk
 
-KERNEL:=$(LINUX_DIR)/arch/c6x/boot/$(ADK_TARGET_KERNEL)
+KERNEL:=$(LINUX_DIR)/$(ADK_TARGET_KERNEL)
 
 # target helper text
 ifeq ($(ADK_TARGET_FS),archive)

+ 3 - 3
target/config/Config.in.libs

@@ -7,7 +7,7 @@ bool "Library support"
 
 config ADK_TARGET_USE_SHARED_LIBS_ONLY
 	bool "Create shared libraries only and link dynamically"
-	depends on !ADK_TARGET_BINFMT_FLAT && !ADK_TARGET_BINFMT_DSBT
+	depends on !ADK_TARGET_BINFMT_FLAT
 
 config ADK_TARGET_USE_STATIC_LIBS_ONLY
 	bool "Create static libraries only and link statically"
@@ -19,10 +19,10 @@ config ADK_TARGET_USE_STATIC_LIBS_ONLY
 
 config ADK_TARGET_USE_SHARED_AND_STATIC_LIBS
 	bool "Create shared and static libraries and link dynamically"
-	depends on !ADK_TARGET_BINFMT_FLAT && !ADK_TARGET_BINFMT_DSBT
+	depends on !ADK_TARGET_BINFMT_FLAT
 
 config ADK_TARGET_USE_STATIC_AND_SHARED_LIBS
 	bool "Create static and shared libraries and link statically"
-	depends on !ADK_TARGET_BINFMT_FLAT && !ADK_TARGET_BINFMT_DSBT
+	depends on !ADK_TARGET_BINFMT_FLAT
 
 endchoice

+ 10 - 0
toolchain/gcc/patches/7.3.0/c6x-disable-multilib.patch

@@ -0,0 +1,10 @@
+diff -Nur gcc-7.3.0.orig/gcc/config/c6x/t-c6x-uclinux gcc-7.3.0/gcc/config/c6x/t-c6x-uclinux
+--- gcc-7.3.0.orig/gcc/config/c6x/t-c6x-uclinux	2011-11-02 16:23:48.424740000 +0100
++++ gcc-7.3.0/gcc/config/c6x/t-c6x-uclinux	2018-06-01 08:14:36.679894633 +0200
+@@ -1,3 +1,3 @@
+-MULTILIB_OSDIRNAMES    = march.c674x=!c674x
+-MULTILIB_OSDIRNAMES   += mbig-endian=!be
+-MULTILIB_OSDIRNAMES   += mbig-endian/march.c674x=!be/c674x
++MULTILIB_OSDIRNAMES    =
++#MULTILIB_OSDIRNAMES   += mbig-endian=!be
++#MULTILIB_OSDIRNAMES   += mbig-endian/march.c674x=!be/c674x