[Buildroot] [PATCH] toolchain: copy the libc for current FLAT format to the default lib folder in the sysroot

Subsystems: the rest

2 messages, 2 authors, 2016-07-03 · open the first message on its own page

[Buildroot] [PATCH] toolchain: copy the libc for current FLAT format to the default lib folder in the sysroot

From: Sonic Zhang <hidden>
Date: 2015-12-30 07:33:35

From: Sonic Zhang <redacted>

The libc for the shared flat and share flat with sep data formats are put into
different subfolders in the Blackfin toolchain lib path. In order to link the
application with proper libc, copy the libc for current FLAT format to the
default lib folder in the sysroot.

Signed-off-by: Sonic Zhang <redacted>
---
 toolchain/toolchain-external/toolchain-external.mk |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 8a9ea88..97f0919 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -599,6 +599,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS
 	fi
 endef
 
+
 define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
 	$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
 	if test -z "$${SYSROOT_DIR}" ; then \
@@ -616,7 +617,16 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
 	fi ; \
 	ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
 	$(call MESSAGE,"Copying external toolchain sysroot to staging...") ; \
-	$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
+	$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR}) ; \
+	echo "PATH=" $(STAGING_DIR)/usr/$${ARCH_LIB_DIR} ; \
+	if test "$(BR2_BINFMT_FLAT_SHARED)" = "y"; then \
+		$(call MESSAGE,"Move the Blackfin share flat lib into the sysroot...") ; \
+		cp -af $(STAGING_DIR)/usr/$${ARCH_LIB_DIR}/mid-shared-library/* $(STAGING_DIR)/usr/$${ARCH_LIB_DIR} ; \
+	fi ; \
+	if test "$(BR2_BINFMT_FLAT_SEP_DATA)" = "y"; then \
+		$(call MESSAGE,"Move the Blackfin share flat lib with separate data in the sysroot...") ; \
+		cp -af $(STAGING_DIR)/usr/$${ARCH_LIB_DIR}/msep-data/* $(STAGING_DIR)/usr/$${ARCH_LIB_DIR} ; \
+	fi
 endef
 
 # Special installation target used on the Blackfin architecture when
-- 
1.7.9.5

[Buildroot] [PATCH] toolchain: copy the libc for current FLAT format to the default lib folder in the sysroot

From: Maxime Hadjinlian <hidden>
Date: 2016-07-03 09:57:15

Hi Sonic, all

Thank you for your patches, see my comments below, in the meantime,
your patch has been marked as Changes Requested, feel free to answere
here and resend your patches.

On Wed, Dec 30, 2015 at 8:33 AM, Sonic Zhang [off-list ref] wrote:
quoted hunk
From: Sonic Zhang <redacted>

The libc for the shared flat and share flat with sep data formats are put into
different subfolders in the Blackfin toolchain lib path. In order to link the
application with proper libc, copy the libc for current FLAT format to the
default lib folder in the sysroot.

Signed-off-by: Sonic Zhang <redacted>
---
 toolchain/toolchain-external/toolchain-external.mk |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 8a9ea88..97f0919 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -599,6 +599,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS
        fi
 endef

+
 define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
        $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
        if test -z "$${SYSROOT_DIR}" ; then \
@@ -616,7 +617,16 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
        fi ; \
        ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \
        $(call MESSAGE,"Copying external toolchain sysroot to staging...") ; \
-       $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
+       $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR}) ; \
+       echo "PATH=" $(STAGING_DIR)/usr/$${ARCH_LIB_DIR} ; \
What is the purpose of this echo ?
+       if test "$(BR2_BINFMT_FLAT_SHARED)" = "y"; then \
This test is wrong, the FLAT binary format is also used by ARM without
MMU, MK68 or any platform without an MMU, so you can't link this
format with Blackfin.
Look at the hooks in toolchain-external.mk as it's a specific Blackfin
external toolchain, it would better to implement it that way.
+               $(call MESSAGE,"Move the Blackfin share flat lib into the sysroot...") ; \
+               cp -af $(STAGING_DIR)/usr/$${ARCH_LIB_DIR}/mid-shared-library/* $(STAGING_DIR)/usr/$${ARCH_LIB_DIR} ; \
+       fi ; \
+       if test "$(BR2_BINFMT_FLAT_SEP_DATA)" = "y"; then \
+               $(call MESSAGE,"Move the Blackfin share flat lib with separate data in the sysroot...") ; \
+               cp -af $(STAGING_DIR)/usr/$${ARCH_LIB_DIR}/msep-data/* $(STAGING_DIR)/usr/$${ARCH_LIB_DIR} ; \
+       fi
 endef

 # Special installation target used on the Blackfin architecture when
--
1.7.9.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help