toolchain: Add support for Sourcery Codebench Standard
v3 cover toolchain: Add support for Sourcery Codebench Standard
The purpose of this series is to provide support for Sourcery Codebench Standard (licenced) edition in Buildroot.
Since these toolchain can't be downloaded, we need to use the custom toolchain backend to import them into Buildroot.
In Toolchain menu, select:
Toolchain type (External toolchain)
Toolchain (Custom toolchain)
Toolchain origin (Pre-installed toolchain)
Then set all toolchain settings (kernel headers, libc, rpc, c++ etc...)
I'm using the Sourcery Codebench 2014.05 for IA32 GNU/Linux, here is the settings:
(i686-pc-linux-gnu) Toolchain prefix
External toolchain kernel headers series (3.13.x) External toolchain C library (glibc/eglibc)
[*] Toolchain has RPC support
[*] Toolchain has C++ support?
(-pipe -msgxx-glibc) Target Optimizations
The "-msgxx-glibc" flag in "Target Optimizations" is mandatory otherwise the toolchain won't work.
Thanks to Yann E. Morin and Thomas Petazzoni for the help and review on this topic.
v3: Rework the end of string detection (Yann E. Morin)
Handle a second argument in toolchain_print_sysroot Detect if the main sysroot is the same as arch sysroot, then return the main_sysroot
v2: Rework entirely this serie to take into account comments received on v1.
http://lists.busybox.net/pipermail/buildroot/2014-October/108641.html
Romain Naour (3):
toolchain-external: Detect empty or invalid sysroot
toolchain-helpers: factorise the arch sysroot symlink creation
toolchain-external: calculation of the symlink to the arch sysroot
toolchain/helpers.mk | 70 +++++++++++++++++++--- toolchain/toolchain-external/toolchain-external.mk | 28 ++++++--- 2 files changed, 82 insertions(+), 16 deletions(-)
Signature · 1 line
1.9.3
PATCH v3 1/3 toolchain-external: Detect empty or invalid sysroot
With the Sourcery Codebench standard edition, the sysroot returned point to a non existant directory if no CFLAGS are specified.
Here are the results of -print-sysroot gcc option:
$ ./i686-pc-linux-gnu-gcc -print-sysroot Full/path/to/i686-pc-linux-gnu/libc/system32 (doesn't exist)
$ ./i686-pc-linux-gnu-gcc -m64 -print-sysroot Full/path/to/i686-pc-linux-gnu/libc/system64 (doesn't exist)
$ ./i686-pc-linux-gnu-gcc -msgxx-glibc -print-sysroot Full/path/to/i686-pc-linux-gnu/libc/sgxx-glibc (exist)
The problem is that in the "libc" directory there is only the sub-directory "sgxx-glibc". Therefore all hearders files and libraries are only available in arch specific sysroot.
When using the -print-file-name gcc option, the result is quite buggy and it is not empty.
$ ./i686-pc-linux-gnu-gcc -print-file-name=libc.a libc.a
So the toolchain check fail because $PWD/libc.a is used as SYSROOT_DIR since the toolchain-external backend does not always use CFLAGS.
This patch change the SYSROOT_DIR/ARCH_SYSROOT_DIR detection logic so that if SYSROOT_DIR is empty/bogus, then the same value as ARCH_SYSROOT_DIR is used.
This ensures that both SYSROOT_DIR and ARCH_SYSROOT_DIR point to valid directories (which would the same in the case of this toolchain, which brings us back to the non-multilib toolchain case).
If toolchain_find_sysroot() was used without flags, then flags are added to allow the fallback to arch sysroot. In normal cases the same behavior as before is expected.
If toolchain_find_sysroot() was used with flags, then it's replaced by toolchain_find_arch_sysroot() with the same flags.
---
v3: no change
v2: new patch
--- toolchain/toolchain-external/toolchain-external.mk | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-)
toolchain/toolchain-external/toolchain-external.mk +20 -8
@@ -432,9 +432,9 @@ define toolchain_find_libc_a $$(readlink -f $$(LANG=C $(1) -print-file-name=libc.a)) endef -# Returns the sysroot location for the given compiler + flags -define toolchain_find_sysroot -$$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:(usr/)?lib(32|64)?/([^/]*/)?libc\.a::') +# Returns the arch sysroot location for the given compiler + flags +define toolchain_find_arch_sysroot +$$(echo -n $(call toolchain_find_libc_a,$(1) $(2)) | sed -r -e 's:(usr/)?lib(32|64)?/([^/]*/)?libc\.a::') endef # Returns the lib subdirectory for the given compiler + flags (i.e
@@ -443,6 +443,18 @@ define toolchain_find_libdir $$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64)?)/([^/]*/)?libc.a:\2:') endef +# Returns the main sysroot location for the given compiler + flags +# First, try to find the sysroot without flags. +# If the sysroot path is empty/bogus then use the arch sysroot instead. +define toolchain_find_sysroot +$$(main_sysroot="$(call toolchain_find_arch_sysroot,$(1))"; \ +if ! test -d $${main_sysroot}; then \ + echo -n $(call toolchain_find_arch_sysroot,$(1), $(2)) ; \ +else \ + echo -n $${main_sysroot}; \ +fi) +endef + # Checks for an already installed toolchain: check the toolchain # location, check that it supports sysroot, and then verify that it # matches the configuration provided in Buildroot: ABI, C++ support,
@@ -450,13 +462,13 @@ endef define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC)) $(Q)$(call check_unusable_toolchain,$(TOOLCHAIN_EXTERNAL_CC)) - $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \ fi ; \ $(call check_kernel_headers_version,\ - $(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC)),\ + $(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS)),\ $(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \ if test "$(BR2_arm)" = "y" ; then \ $(call check_arm_abi,\
@@ -539,12 +551,12 @@ endif # to the target filesystem. define TOOLCHAIN_EXTERNAL_INSTALL_CORE - $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \ fi ; \ - ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ + ARCH_SYSROOT_DIR="$(call toolchain_find_arch_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ SUPPORT_LIB_DIR="" ; \ if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
@@ -590,7 +602,7 @@ ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) define TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC $(Q)$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \ FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \ - FDPIC_SYSROOT_DIR="$(call toolchain_find_sysroot,$${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ + FDPIC_SYSROOT_DIR="$(call toolchain_find_arch_sysroot,$${FDPIC_EXTERNAL_CC}, $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ FDPIC_LIB_DIR="$(call toolchain_find_libdir,$${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ FDPIC_SUPPORT_LIB_DIR="" ; \ if test `find $${FDPIC_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
Signature · 1 line
1.9.3
PATCH v3 1/3 toolchain-external: Detect empty or invalid sysroot
Romain, All,
On 2014-11-14 00:03 +0100, Romain Naour spake thusly:
Quoted 2 lines
With the Sourcery Codebench standard edition, the sysroot returned point to a non existant directory if no CFLAGS are specified.
I finally get to review this. Sorry for the long delay... :-(
[--SNIP--]
toolchain/toolchain-external/toolchain-external.mk
Quoted 13 lines
Signed-off-by Romain Naour <[email protected]>---
v3: no change
v2: new patch--- toolchain/toolchain-external/toolchain-external.mk | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-)toolchain/toolchain-external/toolchain-external.mk +0
-0
[--SNIP--]
Quoted 4 lines
toolchain/toolchain-external/toolchain-external.mk +0
-0@@ -443,6 +443,18 @@ define toolchain_find_libdir $$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64)?)/([^/]*/)?libc.a:\2:') endef
toolchain/toolchain-external/toolchain-external.mk define toolchain_find_libdir · line 455
Quoted 10 lines
toolchain/toolchain-external/toolchain-external.mk +10
-0+# Returns the main sysroot location for the given compiler + flags +# First, try to find the sysroot without flags. +# If the sysroot path is empty/bogus then use the arch sysroot instead. +define toolchain_find_sysroot +$$(main_sysroot="$(call toolchain_find_arch_sysroot,$(1))"; \ +if ! test -d $${main_sysroot}; then \ + echo -n $(call toolchain_find_arch_sysroot,$(1), $(2)) ; \ +else \ + echo -n $${main_sysroot}; \ +fi)
Two comments:
- we prefer positive logic,
- we usually do not prepend a space before arguments to make macros.
So:
if test -d $${main_sysroot}; then \
echo -n $${main_sysroot}; \
else
echo -n $(call toolchain_find_arch_sysroot,$(1),$(2)) ; \
fitoolchain/toolchain-external/toolchain-external.mk endef · line 465
Quoted 11 lines
toolchain/toolchain-external/toolchain-external.mk +3
-1+endef + # Checks for an already installed toolchain: check the toolchain # location, check that it supports sysroot, and then verify that it # matches the configuration provided in Buildroot: ABI, C++ support,@@ -450,13 +462,13 @@ endef define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC)) $(Q)$(call check_unusable_toolchain,$(TOOLCHAIN_EXTERNAL_CC)) - $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
Ditto: no space in front of a macro argument.
toolchain/toolchain-external/toolchain-external.mk endef · line 471
Quoted 7 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \ fi ; \ $(call check_kernel_headers_version,\ - $(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC)),\ + $(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS)),\
Ditto: no space in front of a macro argument.
toolchain/toolchain-external/toolchain-external.mk endif · line 554
Quoted 9 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \ if test "$(BR2_arm)" = "y" ; then \ $(call check_arm_abi,\@@ -539,12 +551,12 @@ endif # to the target filesystem. define TOOLCHAIN_EXTERNAL_INSTALL_CORE - $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
Ditto: no space in front of a macro argument.
toolchain/toolchain-external/toolchain-external.mk endif · line 559
Quoted 6 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \ fi ; \ - ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ + ARCH_SYSROOT_DIR="$(call toolchain_find_arch_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
Ditto: no space in front of a macro argument.
toolchain/toolchain-external/toolchain-external.mk ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) · line 605
Quoted 9 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ SUPPORT_LIB_DIR="" ; \ if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \@@ -590,7 +602,7 @@ ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) define TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC $(Q)$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \ FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \ - FDPIC_SYSROOT_DIR="$(call toolchain_find_sysroot,$${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ + FDPIC_SYSROOT_DIR="$(call toolchain_find_arch_sysroot,$${FDPIC_EXTERNAL_CC}, $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
Ditto: no space in front of a macro argument.
Otherwise, looks OK.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/3 toolchain-external: Detect empty or invalid sysroot
Hi Yann, all,
Le 28/11/2014 00:06, Yann E. MORIN a ?crit :
Quoted 7 lines
Romain, All,
On 2014-11-14 00:03 +0100, Romain Naour spake thusly:
Quoted 2 lines
With the Sourcery Codebench standard edition, the sysroot returned point to a non existant directory if no CFLAGS are specified.
I finally get to review this. Sorry for the long delay... :-(
It's ok, thank you for your help :)
Quoted 35 lines
[--SNIP--]
toolchain/toolchain-external/toolchain-external.mk
Quoted 13 lines
Signed-off-by Romain Naour <[email protected]>---
v3: no change
v2: new patch--- toolchain/toolchain-external/toolchain-external.mk | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-)toolchain/toolchain-external/toolchain-external.mk +0
-0[--SNIP--]
Quoted 4 lines
toolchain/toolchain-external/toolchain-external.mk +0
-0@@ -443,6 +443,18 @@ define toolchain_find_libdir $$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64)?)/([^/]*/)?libc.a:\2:') endeftoolchain/toolchain-external/toolchain-external.mk define toolchain_find_libdir · line 455
Quoted 10 lines
toolchain/toolchain-external/toolchain-external.mk +10
-0+# Returns the main sysroot location for the given compiler + flags +# First, try to find the sysroot without flags. +# If the sysroot path is empty/bogus then use the arch sysroot instead. +define toolchain_find_sysroot +$$(main_sysroot="$(call toolchain_find_arch_sysroot,$(1))"; \ +if ! test -d $${main_sysroot}; then \ + echo -n $(call toolchain_find_arch_sysroot,$(1), $(2)) ; \ +else \ + echo -n $${main_sysroot}; \ +fi)Two comments:
- we prefer positive logic,
- we usually do not prepend a space before arguments to make macros.
Quoted 7 lines
So:
if test -d $${main_sysroot}; then \ echo -n $${main_sysroot}; \ else echo -n $(call toolchain_find_arch_sysroot,$(1),$(2)) ; \ fi
Fixed
Quoted 14 lines
toolchain/toolchain-external/toolchain-external.mk endef · line 465
Quoted 12 lines
toolchain/toolchain-external/toolchain-external.mk +3
-1+endef + # Checks for an already installed toolchain: check the toolchain # location, check that it supports sysroot, and then verify that it # matches the configuration provided in Buildroot: ABI, C++ support,@@ -450,13 +462,13 @@ endef define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC)) $(Q)$(call check_unusable_toolchain,$(TOOLCHAIN_EXTERNAL_CC)) - $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \Ditto: no space in front of a macro argument.
Fixed
Quoted 10 lines
toolchain/toolchain-external/toolchain-external.mk endef · line 471
Quoted 8 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \ fi ; \ $(call check_kernel_headers_version,\ - $(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC)),\ + $(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS)),\Ditto: no space in front of a macro argument.
Fixed
Quoted 7 lines
Quoted 7 lines
toolchain/toolchain-external/toolchain-external.mk +0
-0$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \ if test "$(BR2_arm)" = "y" ; then \ $(call check_arm_abi,\@@ -539,12 +551,12 @@ endif # to the target filesystem.
Quoted 5 lines
toolchain/toolchain-external/toolchain-external.mk endif · line 554
Quoted 3 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1define TOOLCHAIN_EXTERNAL_INSTALL_CORE - $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \ + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \Ditto: no space in front of a macro argument.
Fixed
Quoted 9 lines
toolchain/toolchain-external/toolchain-external.mk endif · line 559
Quoted 7 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1if test -z "$${SYSROOT_DIR}" ; then \ @echo "External toolchain doesn't support --sysroot. Cannot use." ; \ exit 1 ; \ fi ; \ - ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ + ARCH_SYSROOT_DIR="$(call toolchain_find_arch_sysroot,$(TOOLCHAIN_EXTERNAL_CC), $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \Ditto: no space in front of a macro argument.
Fixed
Quoted 12 lines
toolchain/toolchain-external/toolchain-external.mk ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) · line 605
Quoted 10 lines
toolchain/toolchain-external/toolchain-external.mk +1
-1ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ SUPPORT_LIB_DIR="" ; \ if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \@@ -590,7 +602,7 @@ ifeq ($(BR2_BFIN_INSTALL_FDPIC_SHARED),y) define TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC $(Q)$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \ FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \ - FDPIC_SYSROOT_DIR="$(call toolchain_find_sysroot,$${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \ + FDPIC_SYSROOT_DIR="$(call toolchain_find_arch_sysroot,$${FDPIC_EXTERNAL_CC}, $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \Ditto: no space in front of a macro argument.
Fixed
Quoted 6 lines
Otherwise, looks OK.
Regards,
Yann E. MORIN.
Best regards,
Signature · 8 lines
Romain Naour OPEN WIDE Ing?nierie - Paris 23/25, rue Daviel| 75013 PARIS http://ingenierie.openwide.fr Le blog des technologies libres et embarqu?es : http://www.linuxembedded.fr
PATCH v3 2/3 toolchain-helpers: factorise the arch sysroot symlink creation
In reply to Romain NaourThe part of copy_toolchain_sysroot function that create the symlink in the staging directory will be used in two different place in the following patch. So factorize this part in a new function called toolchain_create_arch_sysroot_symlink.
---
v3: no change
v2: new patch
--- toolchain/helpers.mk | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
toolchain/helpers.mk +15 -8
@@ -83,6 +83,20 @@ copy_toolchain_lib_root = \ \ echo -n +# Calculate the symlink's depth by counting the number of slashs. +# Then create the symlink to arch sysroot. +# $1: arch specific subdirectory in the sysroot +toolchain_create_arch_sysroot_symlink = \ + ARCH_SUBDIR="$(strip $1)"; \ + mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \ + relpath="./" ; \ + nbslashs=`echo -n $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \ + for slash in `seq 1 $${nbslashs}` ; do \ + relpath=$${relpath}"../" ; \ + done ; \ + ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ + echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" + # # Copy the full external toolchain sysroot directory to the staging # dir. The operation of this function is rendered a little bit
@@ -148,14 +162,7 @@ copy_toolchain_sysroot = \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \ fi ; \ - mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \ - relpath="./" ; \ - nbslashs=`echo -n $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \ - for slash in `seq 1 $${nbslashs}` ; do \ - relpath=$${relpath}"../" ; \ - done ; \ - ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ - echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \ + $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \ fi ; \ if test -n "$${SUPPORT_LIB_DIR}" ; then \ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
Signature · 1 line
1.9.3
PATCH v3 2/3 toolchain-helpers: factorise the arch sysroot symlink creation
Romain, All,
On 2014-11-14 00:03 +0100, Romain Naour spake thusly:
Quoted 19 lines
The part of
copy_toolchain_sysrootfunction that create the symlink in the staging directory will be used in two different place in the following patch. So factorize this part in a new function calledtoolchain_create_arch_sysroot_symlink.Signed-off-by Romain Naour <[email protected]>---
v3: no change
v2: new patch--- toolchain/helpers.mk | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)toolchain/helpers.mk +0
-0
toolchain/helpers.mk copy_toolchain_lib_root = \ · line 90
Quoted 8 lines
toolchain/helpers.mk +5
-0@@ -83,6 +83,20 @@ copy_toolchain_lib_root = \ \ echo -n +# Calculate the symlink's depth by counting the number of slashs. +# Then create the symlink to arch sysroot. +# $1: arch specific subdirectory in the sysroot +toolchain_create_arch_sysroot_symlink = \ + ARCH_SUBDIR="$(strip $1)"; \
I think I have some problems parsing that...
- $(strip $1) is makefile syntax,
- $1 is the first argument to the macro,
- $1 is set to literally $${ARCH_SUBDIR} at the time of the call.
So, you're calling $(strip) which is evaluated by make on a shell variable, set in the shell to something that is already $(strip)ed.
I think this assignement should just go away.
Unless I'm too tired and I missed something...
Quoted 15 lines
toolchain/helpers.mk +9
-0+ mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \ + relpath="./" ; \ + nbslashs=`echo -n $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \ + for slash in `seq 1 $${nbslashs}` ; do \ + relpath=$${relpath}"../" ; \ + done ; \ + ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ + echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" + # # Copy the full external toolchain sysroot directory to the staging # dir. The operation of this function is rendered a little bit@@ -148,14 +162,7 @@ copy_toolchain_sysroot = \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
toolchain/helpers.mk copy_toolchain_sysroot = \ · line 165
Quoted 10 lines
toolchain/helpers.mk +1
-8fi ; \ - mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \ - relpath="./" ; \ - nbslashs=`echo -n $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \ - for slash in `seq 1 $${nbslashs}` ; do \ - relpath=$${relpath}"../" ; \ - done ; \ - ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ - echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \ + $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \
Here you are doing the call with something that is supposed to be a shell variable.
Care to review this part, and provide an explanation of what I missed?
Regards,
Yann E. MORIN.
Quoted 6 lines
toolchain/helpers.mk +0
-0fi ; \ if test -n "$${SUPPORT_LIB_DIR}" ; then \ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \Signature · 1 line
1.9.3
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 2/3 toolchain-helpers: factorise the arch sysroot symlink creation
Hi Yann, all,
Le 28/11/2014 00:21, Yann E. MORIN a ?crit :
Quoted 37 lines
Romain, All,
On 2014-11-14 00:03 +0100, Romain Naour spake thusly:
Quoted 19 lines
The part of
copy_toolchain_sysrootfunction that create the symlink in the staging directory will be used in two different place in the following patch. So factorize this part in a new function calledtoolchain_create_arch_sysroot_symlink.Signed-off-by Romain Naour <[email protected]>---
v3: no change
v2: new patch--- toolchain/helpers.mk | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)toolchain/helpers.mk +0
-0toolchain/helpers.mk copy_toolchain_lib_root = \ · line 90
Quoted 8 lines
toolchain/helpers.mk +5
-0@@ -83,6 +83,20 @@ copy_toolchain_lib_root = \ \ echo -n +# Calculate the symlink's depth by counting the number of slashs. +# Then create the symlink to arch sysroot. +# $1: arch specific subdirectory in the sysroot +toolchain_create_arch_sysroot_symlink = \ + ARCH_SUBDIR="$(strip $1)"; \I think I have some problems parsing that...
- $(strip $1) is makefile syntax,
- $1 is the first argument to the macro,
- $1 is set to literally $${ARCH_SUBDIR} at the time of the call.
Quoted 6 lines
So, you're calling $(strip) which is evaluated by make on a shell variable, set in the shell to something that is already $(strip)ed.
I think this assignement should just go away.
Unless I'm too tired and I missed something...
No, you're right, the call to strip is useless.
Quoted 30 lines
Quoted 16 lines
toolchain/helpers.mk +9
-0+ mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \ + relpath="./" ; \ + nbslashs=`echo -n $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \ + for slash in `seq 1 $${nbslashs}` ; do \ + relpath=$${relpath}"../" ; \ + done ; \ + ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ + echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" + # # Copy the full external toolchain sysroot directory to the staging # dir. The operation of this function is rendered a little bit@@ -148,14 +162,7 @@ copy_toolchain_sysroot = \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \toolchain/helpers.mk copy_toolchain_sysroot = \ · line 165
Quoted 10 lines
toolchain/helpers.mk +1
-8fi ; \ - mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \ - relpath="./" ; \ - nbslashs=`echo -n $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \ - for slash in `seq 1 $${nbslashs}` ; do \ - relpath=$${relpath}"../" ; \ - done ; \ - ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ - echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \ + $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \Here you are doing the call with something that is supposed to be a shell variable.
Quoted 1 line
Care to review this part, and provide an explanation of what I missed?
Indeed, ARCH_SUBDIR is already stripped.
Quoted 11 lines
Regards,
Yann E. MORIN.Quoted 6 lines
toolchain/helpers.mk +0
-0fi ; \ if test -n "$${SUPPORT_LIB_DIR}" ; then \ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \Signature · 1 line
1.9.3
I'll wait for the review of the last patch before sending v4.
Thanks !
Signature · 8 lines
Romain Naour OPEN WIDE Ing?nierie - Paris 23/25, rue Daviel| 75013 PARIS http://ingenierie.openwide.fr Le blog des technologies libres et embarqu?es : http://www.linuxembedded.fr
PATCH v3 3/3 toolchain-external: calculation of the symlink to the arch sysroot
In reply to Romain NaourWhen copying external toolchain sysroot to staging, we need to create the symbolic link that matches the name of the subdirectory for the architecture variant in the original sysroot. (ex: sgxx-glibc for CodeSourcery Standard edition)
To do that, SYSROOT_DIR must be different than ARCH_SYSROOT_DIR.
In the case where ARCH_SYSROOT_DIR is used as SYSROOT_DIR we need to check again the path to the main sysroot directory. if SYSROOT_DIR returned by toolchain_find_sysroot without TOOLCHAIN_EXTERNAL_CFLAGS is empty/invalid, then compute the common part between SYSROOT_DIR and ARCH_SYSROOT_DIR returned by toolchain_print_sysroot in order to get the "base sysroot". This "base sysroot" is used as SYSROOT_DIR to create the symlink in the staging directory.
---
v3: Rework the end of string detection (Yann E. Morin)
Handle a second argument in toolchain_print_sysroot Detect if the main sysroot is the same as arch sysroot, then return the main_sysroot
v2: new patch
--- toolchain/helpers.mk | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)
toolchain/helpers.mk +51 -0
@@ -97,6 +97,36 @@ toolchain_create_arch_sysroot_symlink = \ ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" +# Returns the location of the sysroot for the given compiler + flags using +# -print-sysroot gcc option (gcc > 4.3 is needed) +define toolchain_print_sysroot +$$(readlink -f $$(LANG=C $(1) $(2) -print-sysroot)) +endef + +# Returns the common path between the main sysroot and arch sysroot returned by +# toolchain_print_sysroot. This is required to calculate the depth of the symlink +# in the staging directory when the main sysroot directory is empty/bogus. +define toolchain_calculate_base_sysroot +$$(common_sysroot_path="" ; \ +main_sysroot_path=$(call toolchain_print_sysroot,$(TOOLCHAIN_EXTERNAL_CC)); \ +arch_sysroot_path=$(call toolchain_print_sysroot,$(TOOLCHAIN_EXTERNAL_CC),$(TOOLCHAIN_EXTERNAL_CFLAGS)); \ +if [ "$${main_sysroot_path}" = "$${arch_sysroot_path}" ]; then \ + common_sysroot_path="$${main_sysroot_path}"; \ +else \ + index=0 ; \ + while [ "$${main_sysroot_path:$${index}:1}" = "$${arch_sysroot_path:$${index}:1}" ] ; do \ + if [ "$${main_sysroot_path:$${index}:1}" = "/" ]; then \ + common_sysroot_path="$${main_sysroot_path:0:$${index}+1}"; \ + fi ; \ + if [ $${index} -gt $${#main_sysroot_path} ] || [ $${index} -gt $${#arch_sysroot_path} ]; then \ + break; \ + fi ; \ + : $$((index++)) ; \ + done ; \ +fi ; \ +echo -n $${common_sysroot_path}) +endef + # # Copy the full external toolchain sysroot directory to the staging # dir. The operation of this function is rendered a little bit
@@ -130,6 +160,17 @@ toolchain_create_arch_sysroot_symlink = \ # non-default architecture variant is used. Without this, the # compiler fails to find libraries and headers. # +# Some toolchain (i.e CodeSourcery Standard edition) doesn't have +# a main sysroot directory and use the arch sysroot as fallback. +# In this case we need to check again the path to the main sysroot +# directory when SYSROOT_DIR == ARCH_SYSROOT_DIR. +# if SYSROOT_DIR returned by toolchain_find_sysroot without +# TOOLCHAIN_EXTERNAL_CFLAGS point to valid directory. +# If SYSROOT_DIR is empty/invalid, compute the common part between +# SYSROOT_DIR and ARCH_SYSROOT_DIR returned by toolchain_print_sysroot +# in order to get the "base sysroot". This "base sysroot" is used +# to create the symlink in the staging directory. +# # Some toolchains (i.e Linaro binary toolchains) store support # libraries (libstdc++, libgcc_s) outside of the sysroot, so we simply # copy all the libraries from the "support lib directory" into our
@@ -163,6 +204,16 @@ copy_toolchain_sysroot = \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \ fi ; \ $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \ + else \ + if ! test -d "$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; then \ + SYSROOT_DIR="$(call toolchain_calculate_base_sysroot)"; \ + if ! test -d $${SYSROOT_DIR} ; then \ + echo "ERROR: Unable to find the main sysroot directory." ; \ + exit 1; \ + fi ; \ + ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \ + $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \ + fi ; \ fi ; \ if test -n "$${SUPPORT_LIB_DIR}" ; then \ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
Signature · 1 line
1.9.3
PATCH v3 3/3 toolchain-external: calculation of the symlink to the arch sysroot
Hi Yann, all,
Le 14/11/2014 00:03, Romain Naour a ?crit :
Quoted 33 lines
When copying external toolchain sysroot to staging, we need to create the symbolic link that matches the name of the subdirectory for the architecture variant in the original sysroot. (ex: sgxx-glibc for CodeSourcery Standard edition)
To do that,SYSROOT_DIRmust be different thanARCH_SYSROOT_DIR.In the case where
ARCH_SYSROOT_DIRis used asSYSROOT_DIRwe need to check again the path to the main sysroot directory. ifSYSROOT_DIRreturned bytoolchain_find_sysrootwithoutTOOLCHAIN_EXTERNAL_CFLAGSis empty/invalid, then compute the common part betweenSYSROOT_DIRandARCH_SYSROOT_DIRreturned bytoolchain_print_sysrootin order to get the "base sysroot". This "base sysroot" is used asSYSROOT_DIRto create the symlink in the staging directory.Signed-off-by Romain Naour <[email protected]>---
v3: Rework the end of string detection (Yann E. Morin)
Handle a second argument intoolchain_print_sysrootDetect if the main sysroot is the same as arch sysroot, then return themain_sysrootv2: new patch
--- toolchain/helpers.mk | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+)toolchain/helpers.mk +0
-0
toolchain/helpers.mk toolchain_create_arch_sysroot_symlink = \ · line 104
Quoted 8 lines
toolchain/helpers.mk +5
-0@@ -97,6 +97,36 @@ toolchain_create_arch_sysroot_symlink = \ ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \ echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" +# Returns the location of the sysroot for the given compiler + flags using +# -print-sysroot gcc option (gcc > 4.3 is needed) +define toolchain_print_sysroot +$$(readlink -f $$(LANG=C $(1) $(2) -print-sysroot)) +endef
For now, we can't use -print-sysroot gcc option (which is available since gcc 4.4) for toolchain_find_arch_sysroot() and toolchain_find_sysroot() because we need to support toolchains that use gcc < 4.4 (avr32 targets).
But the support for these toolchains can be dropped after avr32 removal which is planned for the 2015.02 release, so toolchain_print_sysroot() can be replaced by toolchain_find_arch_sysroot() or toolchain_find_sysroot().
toolchain/helpers.mk toolchain_create_arch_sysroot_symlink = \ · line 112
Quoted 8 lines
toolchain/helpers.mk +8
-0+ +# Returns the common path between the main sysroot and arch sysroot returned by +# toolchain_print_sysroot. This is required to calculate the depth of the symlink +# in the staging directory when the main sysroot directory is empty/bogus. +define toolchain_calculate_base_sysroot +$$(common_sysroot_path="" ; \ +main_sysroot_path=$(call toolchain_print_sysroot,$(TOOLCHAIN_EXTERNAL_CC)); \ +arch_sysroot_path=$(call toolchain_print_sysroot,$(TOOLCHAIN_EXTERNAL_CC),$(TOOLCHAIN_EXTERNAL_CFLAGS)); \
So:
main_sysroot_path=$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC)); \
arch_sysroot_path=$(call toolchain_find_arch_sysroot,$(TOOLCHAIN_EXTERNAL_CC),$(TOOLCHAIN_EXTERNAL_CFLAGS)); \
Quoted 39 lines
toolchain/helpers.mk +28
-0+if [ "$${main_sysroot_path}" = "$${arch_sysroot_path}" ]; then \ + common_sysroot_path="$${main_sysroot_path}"; \ +else \ + index=0 ; \ + while [ "$${main_sysroot_path:$${index}:1}" = "$${arch_sysroot_path:$${index}:1}" ] ; do \ + if [ "$${main_sysroot_path:$${index}:1}" = "/" ]; then \ + common_sysroot_path="$${main_sysroot_path:0:$${index}+1}"; \ + fi ; \ + if [ $${index} -gt $${#main_sysroot_path} ] || [ $${index} -gt $${#arch_sysroot_path} ]; then \ + break; \ + fi ; \ + : $$((index++)) ; \ + done ; \ +fi ; \ +echo -n $${common_sysroot_path}) +endef + # # Copy the full external toolchain sysroot directory to the staging # dir. The operation of this function is rendered a little bit@@ -130,6 +160,17 @@ toolchain_create_arch_sysroot_symlink = \ # non-default architecture variant is used. Without this, the # compiler fails to find libraries and headers. # +# Some toolchain (i.e CodeSourcery Standard edition) doesn't have +# a main sysroot directory and use the arch sysroot as fallback. +# In this case we need to check again the path to the main sysroot +# directory when SYSROOT_DIR == ARCH_SYSROOT_DIR. +# if SYSROOT_DIR returned by toolchain_find_sysroot without +# TOOLCHAIN_EXTERNAL_CFLAGS point to valid directory. +# If SYSROOT_DIR is empty/invalid, compute the common part between +# SYSROOT_DIR and ARCH_SYSROOT_DIR returned by toolchain_print_sysroot +# in order to get the "base sysroot". This "base sysroot" is used +# to create the symlink in the staging directory. +# # Some toolchains (i.e Linaro binary toolchains) store support # libraries (libstdc++, libgcc_s) outside of the sysroot, so we simply # copy all the libraries from the "support lib directory" into our
toolchain/helpers.mk copy_toolchain_sysroot = \ · line 207
Quoted 4 lines
toolchain/helpers.mk +1
-0@@ -163,6 +204,16 @@ copy_toolchain_sysroot = \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \ fi ; \ $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \ + else \
Question by Yann on IRC:
"y_morin: I was wondering why you would re-do the sysroot detection in copy_toolchain_sysroot, and why you would not do it in TOOLCHAIN_EXTERNAL_INSTALL_CORE."
You're right I can do it in TOOLCHAIN_EXTERNAL_INSTALL_CORE but, as discussed during the meeting at Dusseldorf, we don't want to use a "dummy" path as SYSROOT_DIR like I did previously in this series (v1).
http://lists.busybox.net/pipermail/buildroot/2014-October/108641.html
"y_morin: Why is it not possible to set SYSROOT_DIR to the "default" sysroot for the CS toolchain, and set ARCH_SYSROOT_DIR to the one you want ?"
I can't use the default/base sysroot as SYSROOT_DIR everywhere because it will break, for example, during toolchain checks check_kernel_headers_version() or check_glibc() (find -maxdepth 2).
So, to be safe, we need to check if it's really the main_sysroot that is used as SYSROOT_DIR, and that why $(TOOLCHAIN_EXTERNAL_CFLAGS) is not passed.
toolchain/helpers.mk copy_toolchain_sysroot = \ · line 208
Quoted 1 line
toolchain/helpers.mk +1
-0+ if ! test -d "$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; then \
Here, the main_sysroot doesn't exist, ARCH_SYSROOT was used as SYSROOT_DIR.
toolchain/helpers.mk copy_toolchain_sysroot = \ · line 209
Quoted 1 line
toolchain/helpers.mk +1
-0+ SYSROOT_DIR="$(call toolchain_calculate_base_sysroot)"; \
I think it would be better if toolchain_calculate_base_sysroot() can use the $${ARCH_SYSROOT_DIR} and the path returned by "$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" as arguments, instead of recall toolchain_find_arch_sysroot() and toolchain_find_sysroot() internally.
toolchain/helpers.mk copy_toolchain_sysroot = \ · line 213
Quoted 4 lines
toolchain/helpers.mk +4
-0+ if ! test -d $${SYSROOT_DIR} ; then \ + echo "ERROR: Unable to find the main sysroot directory." ; \ + exit 1; \ + fi ; \
Here, we need to overwrite ARCH_SUBDIR since SYSROOT_DIR may have been modified by toolchain_calculate_base_sysroot()
toolchain/helpers.mk copy_toolchain_sysroot = \ · line 219
Quoted 7 lines
toolchain/helpers.mk +3
-0+ ARCH_SUBDIR=`echo $${ARCH_SYSROOT_DIR} | sed -r -e "s:^$${SYSROOT_DIR}(.*)/$$:\1:"` ; \ + $(call toolchain_create_arch_sysroot_symlink,$${ARCH_SUBDIR}) ; \ + fi ; \ fi ; \ if test -n "$${SUPPORT_LIB_DIR}" ; then \ cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
Best regards,
Signature · 8 lines
Romain Naour OPEN WIDE Ing?nierie - Paris 23/25, rue Daviel| 75013 PARIS http://ingenierie.openwide.fr Le blog des technologies libres et embarqu?es : http://www.linuxembedded.fr