[Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed
Yann E. MORIN
yann.morin.1998 at anciens.enib.fr
Mon Jul 5 19:28:50 UTC 2010
On Monday 05 July 2010 18:58:58 Thomas Petazzoni wrote:
> Create lib64 -> lib and usr/lib64 -> usr/lib symbolic links in the
> target and staging directories. This is needed for some 64 bits
> toolchains such as the Crosstool-NG toolchains, for which the path to
> the dynamic loader and other libraries is /lib64, but the libraries
> are stored in /lib.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> ---
> toolchain/external-toolchain/ext-tool.mk | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
> index a181f25..d5a64b5 100644
> --- a/toolchain/external-toolchain/ext-tool.mk
> +++ b/toolchain/external-toolchain/ext-tool.mk
> @@ -133,6 +133,19 @@ copy_toolchain_sysroot = \
> find $(STAGING_DIR) -type d | xargs chmod 755
>
> #
> +# Create lib64 -> lib and usr/lib64 -> usr/lib symbolic links in the
> +# target and staging directories. This is needed for some 64 bits
> +# toolchains such as the Crosstool-NG toolchains, for which the path
> +# to the dynamic loader and other libraries is /lib64, but the
> +# libraries are stored in /lib.
> +#
> +create_lib64_symlinks = \
> + (cd $(TARGET_DIR) ; ln -s lib lib64) ; \
> + (cd $(TARGET_DIR)/usr ; ln -s lib lib64) ; \
> + (cd $(STAGING_DIR) ; ln -s lib lib64) ; \
> + (cd $(STAGING_DIR)/usr ; ln -s lib lib64)
> +
Maybe it's too late, but what if some of the lib64 directories really
*are* directories? It would be better to make the symlinks conditionnal
to whether the destination exists or not.
> +#
> # Check the availability of a particular glibc feature. We assume that
> # all Buildroot toolchain options are supported by glibc, so we just
> # check that they are enabled.
> @@ -319,4 +332,8 @@ endif
> done
> @echo "Copy external toolchain sysroot to staging..."
> $(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR),$(ARCH_SYSROOT_DIR),$(ARCH_SUBDIR))
> + # Create lib64 symbolic links if needed
> + $(Q)if [ -L $(ARCH_SYSROOT_DIR)/lib64 ] ; then \
> + $(call create_lib64_symlinks) ; \
> + fi
> @touch $@
If this is to fix crosstool-NG toolchains only, then the lib64 directories
*will* be symlinks everywhere... So:
Reviewed-by: "Yann E. MORIN" <yann.morin.1998 at anciens.enib.fr>
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
More information about the buildroot
mailing list