toolchain: copy the libc for current FLAT format to the default lib folder in the sysroot
PATCH 1/1 toolchain: copy the libc for current FLAT format to the default lib folder in the sysroot
From: Sonic Zhang <[email protected]>
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.
--- toolchain/toolchain-external/toolchain-external.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
toolchain/toolchain-external/toolchain-external.mk +11 -1
@@ -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
Signature · 1 line
1.7.9.5
PATCH 1/1 toolchain: copy the libc for current FLAT format to the default lib folder in the sysroot
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.
Quoted 25 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
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 <[email protected]>--- toolchain/toolchain-external/toolchain-external.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)toolchain/toolchain-external/toolchain-external.mk +1
-0@@ -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 \
toolchain/toolchain-external/toolchain-external.mk define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS · line 621
Quoted 6 lines
toolchain/toolchain-external/toolchain-external.mk +2
-1@@ -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 ?
toolchain/toolchain-external/toolchain-external.mk define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS · line 622
Quoted 1 line
toolchain/toolchain-external/toolchain-external.mk +1
-0+ 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.
Quoted 17 lines
toolchain/toolchain-external/toolchain-external.mk +7
-1+ $(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