All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes
@ 2010-07-05 16:58 Thomas Petazzoni
  2010-07-05 16:58 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a new version of my ext-toolchain-fixes branch, which fixes
the problem noted by Peter on the sysroot detection code.

We switch to --sysroot=/path/to instead of --sysroot /path/to, which
eases the filtering of this option, which is needed to find out the
original location of the toolchain sysroot.

Thanks,

Thomas

The following changes since commit f4abd4e61215b119d38ccba011a901732ce704e4:
  Peter Huewe (1):
        docs: Fixed spelling error in buildroot.html GETTEXT instead of GNUTTEXT

are available in the git repository at:

  git://git.busybox.net/~tpetazzoni/git/buildroot ext-toolchain-fixes

Thomas Petazzoni (10):
      ext-toolchains: take into account other Glibc dynamic loader variants
      ext-toolchain: Fix ARCH_SYSROOT detection
      external-toolchain: only copy existing directories of the sysroot
      external-toolchain: support 64 bits glibc toolchains
      external-toolchain: create lib64 symlinks if needed
      external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains
      external-toolchain: recognize uClibc 64 bits toolchains
      uclibc: add patch to fix fcntl64() on 64 bits targets
      external-toolchain: handle libstdc++/libgcc_s for BR toolchains
      external-toolchain: hardcode the destination directory for a library

 package/Makefile.in                                |    4 +-
 toolchain/external-toolchain/ext-tool.mk           |   92 +++++++++++++-------
 ...ibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch |   34 +++++++
 3 files changed, 98 insertions(+), 32 deletions(-)
 create mode 100644 toolchain/uClibc/uClibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch

Thanks,
-- 
Thomas Petazzoni

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
@ 2010-07-05 16:58 ` Thomas Petazzoni
  2010-07-05 19:26   ` Yann E. MORIN
  2010-07-05 16:58 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

External toolchains using Glibc have different names for the dynamic
loader. Some of them name it ld-linux.so.*, while some others (such as
the PowerPC and MIPS CodeSourcery toolchains) name it simply ld.so.*.

Therefore, we fix the glibc detection code to handle this case.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 8daae15..3943ceb 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -155,7 +155,7 @@ check_glibc_feature = \
 #
 check_glibc = \
 	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* ; then \
+	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \
 		echo "Incorrect selection of the C library"; \
 		exit -1; \
 	fi; \
@@ -251,11 +251,9 @@ check_cross_compiler_exists = \
 
 uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
 
-EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
-EXTERNAL_LIBS+=ld-uClibc.so
-else
-EXTERNAL_LIBS+=ld-linux.so libnss_files.so libnss_dns.so
+EXTERNAL_LIBS=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GCLIBC),y)
+EXTERNAL_LIBS+=libnss_files.so libnss_dns.so
 endif
 
 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
  2010-07-05 16:58 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
@ 2010-07-05 16:58 ` Thomas Petazzoni
  2010-07-05 19:27   ` Yann E. MORIN
  2010-07-05 16:58 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

For the detection of the ARCH_SYSROOT_DIR (which contains the C
library variant specific to the compiler flags), we used to pass only
the -march argument instead of the full TARGET_CFLAGS. This was done
because TARGET_CFLAGS contains --sysroot, and we don't want to tell
here the compiler which sysroot to use, because we're specifically
asking the compiler where the *normal* arch sysroot directory is.

Unfortunately, there are some multilib variants that aren't decided
only based on -march, but also on -msoft-float or other compiler
flags. Therefore, we take the opposite approach: pass the full
TARGET_CFLAGS, from which we have stripped the --sysroot option.

For example, this allows a PowerPC CodeSourcery toolchain, on which
we're using the soft-float multilib variant, to work properly as an
external toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/Makefile.in                      |    4 ++--
 toolchain/external-toolchain/ext-tool.mk |   18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 92b5710..5147dc8 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -88,9 +88,9 @@ TARGET_LDFLAGS+= $(BR2_SYSROOT)
 
 #########################################################################
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TARGET_CFLAGS+=--sysroot $(STAGING_DIR)/
+TARGET_CFLAGS+=--sysroot=$(STAGING_DIR)/
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-TARGET_LDFLAGS=--sysroot $(STAGING_DIR)/
+TARGET_LDFLAGS=--sysroot=$(STAGING_DIR)/
 TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
 endif
 #########################################################################
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 3943ceb..b1eee23 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -270,9 +270,10 @@ endif # ! no threads
 # SYSROOT_DIR selection. We first try the -print-sysroot option,
 # available in gcc 4.4.x and in some Codesourcery toolchains. If this
 # option is not available, we fallback to the value of --with-sysroot
-# as visible in CROSS-gcc -v. We don't pass the -march= option to gcc
-# as we want the "main" sysroot, which contains all variants of the C
-# library in the case of multilib toolchains.
+# as visible in CROSS-gcc -v. We don't pass any option to gcc that
+# could select a multilib variant as we want the "main" sysroot, which
+# contains all variants of the C library in the case of multilib
+# toolchains.
 SYSROOT_DIR=$(shell $(TARGET_CC) -print-sysroot 2>/dev/null)
 ifeq ($(SYSROOT_DIR),)
 SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC) -print-file-name=libc.a |sed -r -e 's:usr/lib/libc\.a::;'))
@@ -281,15 +282,14 @@ endif
 # Now, find if the toolchain specifies a sub-directory for the
 # specific architecture variant we're interested in. This is the case
 # with multilib toolchain, when the selected architecture variant is
-# not the default one. To do so, we ask the compiler by passing the
-# appropriate -march= flags. ARCH_SUBDIR will contain the
+# not the default one. To do so, we ask the compiler by passing all
+# flags, except the --sysroot flag since we want to the compiler to
+# tell us where its original sysroot is. ARCH_SUBDIR will contain the
 # subdirectory, in the main SYSROOT_DIR, that corresponds to the
 # selected architecture variant. ARCH_SYSROOT_DIR will contain the
 # full path to this location.
-ifneq ($(CC_TARGET_ARCH_),)
-TARGET_CC_ARCH_CFLAGS+=-march=$(CC_TARGET_ARCH_)
-endif
-ARCH_SUBDIR=$(shell $(TARGET_CC) $(TARGET_CC_ARCH_CFLAGS) -print-multi-directory)
+TARGET_CFLAGS_NO_SYSROOT=$(filter-out --sysroot=%,$(TARGET_CFLAGS))
+ARCH_SUBDIR=$(shell $(TARGET_CC) $(TARGET_CFLAGS_NO_SYSROOT) -print-multi-directory)
 ARCH_SYSROOT_DIR=$(SYSROOT_DIR)/$(ARCH_SUBDIR)
 
 $(STAMP_DIR)/ext-toolchain-installed:
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
  2010-07-05 16:58 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
  2010-07-05 16:58 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
@ 2010-07-05 16:58 ` Thomas Petazzoni
  2010-07-05 19:27   ` Yann E. MORIN
  2010-07-05 16:58 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

Instead of copying all directories in "etc lib sbin usr", check that
each of them exists before doing the copy. This is only to avoid an
harmless error message.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index b1eee23..9c1ec8f 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -120,7 +120,9 @@ copy_toolchain_sysroot = \
 	ARCH_SYSROOT_DIR="$(strip $2)"; \
 	ARCH_SUBDIR="$(strip $3)"; \
 	for i in etc lib sbin usr ; do \
-		cp -a $${ARCH_SYSROOT_DIR}/$$i $(STAGING_DIR)/ ; \
+		if [ -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \
+			cp -a $${ARCH_SYSROOT_DIR}/$$i $(STAGING_DIR)/ ; \
+		fi ; \
 	done ; \
 	if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
 		if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2010-07-05 16:58 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
@ 2010-07-05 16:58 ` Thomas Petazzoni
  2010-07-05 19:27   ` Yann E. MORIN
  2010-07-05 16:58 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

On 64 bits glibc toolchains, the dynamic loader is named
ld-linux-x86-64.so and not simply ld-linux.so. So, adjust the
detection of the C library accordingly.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 9c1ec8f..a181f25 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -157,7 +157,7 @@ check_glibc_feature = \
 #
 check_glibc = \
 	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \
+	if ! test -f $${SYSROOT_DIR}/lib/ld-linux*.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \
 		echo "Incorrect selection of the C library"; \
 		exit -1; \
 	fi; \
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2010-07-05 16:58 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
@ 2010-07-05 16:58 ` Thomas Petazzoni
  2010-07-05 19:28   ` Yann E. MORIN
  2010-07-05 16:58 ` [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains Thomas Petazzoni
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

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@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)
+
+#
 # 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 $@
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2010-07-05 16:58 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
@ 2010-07-05 16:58 ` Thomas Petazzoni
  2010-07-05 16:59 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:58 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index d5a64b5..d591781 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -7,7 +7,9 @@
 #
 #  * Toolchains generated by Crosstool-NG
 #  * Toolchains generated by Buildroot
-#  * ARM toolchains made available by Codesourcery
+#  * ARM, MIPS and PowerPC toolchains made available by
+#    Codesourcery. For the MIPS toolchain, the -muclibc variant isn't
+#    supported yet, only the default glibc-based variant is.
 #
 # The basic principle is the following
 #
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2010-07-05 16:58 ` [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains Thomas Petazzoni
@ 2010-07-05 16:59 ` Thomas Petazzoni
  2010-07-05 19:26   ` Yann E. MORIN
  2010-07-05 16:59 ` [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets Thomas Petazzoni
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:59 UTC (permalink / raw)
  To: buildroot

With uClibc 64 bits toolchain, the dynamic loader is named
ld64-uClibc.so.0 and not ld-uClibc.so.0. So, this commit adjust the
uClibc detection code for external toolchains.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index d591781..3996184 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -216,7 +216,7 @@ check_uclibc_feature = \
 #
 check_uclibc = \
 	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-uClibc.so.* ; then \
+	if ! test -f $${SYSROOT_DIR}/lib/ld*-uClibc.so.* ; then \
 		echo "Incorrect selection of the C library"; \
 		exit -1; \
 	fi; \
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2010-07-05 16:59 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
@ 2010-07-05 16:59 ` Thomas Petazzoni
  2010-07-05 16:59 ` [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains Thomas Petazzoni
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:59 UTC (permalink / raw)
  To: buildroot

The patch is already in upstream uClibc, in the master branch, at
http://git.buildroot.net/uClibc/commit/?id=6f1daaaf2d94c1e6184add44eda38b0781b88cf0.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...ibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch |   34 ++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 toolchain/uClibc/uClibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch

diff --git a/toolchain/uClibc/uClibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch b/toolchain/uClibc/uClibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch
new file mode 100644
index 0000000..763bfd3
--- /dev/null
+++ b/toolchain/uClibc/uClibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch
@@ -0,0 +1,34 @@
+From 6f1daaaf2d94c1e6184add44eda38b0781b88cf0 Mon Sep 17 00:00:00 2001
+From: Rob Landley <rob@landley.net>
+Date: Sun, 16 May 2010 21:41:36 +0000
+Subject: Fix fcntl64 for 64 bit targets.
+
+64 bit targets often don't have a separate fcntl64() system call, because they don't need one.
+
+Signed-off-by: Rob Landley <rob@landley.net>
+Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
+---
+diff --git a/include/fcntl.h b/include/fcntl.h
+index e37073f..3cfb25f 100644
+--- a/include/fcntl.h
++++ b/include/fcntl.h
+@@ -73,7 +73,7 @@ __BEGIN_DECLS
+ 
+    This function is a cancellation point and therefore not marked with
+    __THROW.  */
+-#ifndef __USE_FILE_OFFSET64
++#if !defined(__USE_FILE_OFFSET64) || defined(__LP64__)
+ extern int fcntl (int __fd, int __cmd, ...);
+ libc_hidden_proto(fcntl)
+ #else
+@@ -83,7 +83,7 @@ extern int __REDIRECT (fcntl, (int __fd, int __cmd, ...), fcntl64);
+ #  define fcntl fcntl64
+ # endif
+ #endif
+-#ifdef __USE_LARGEFILE64
++#if defined(__USE_LARGEFILE64) && !defined(__LP64__)
+ extern int fcntl64 (int __fd, int __cmd, ...);
+ libc_hidden_proto(fcntl64)
+ #endif
+--
+cgit v0.8.2.1
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2010-07-05 16:59 ` [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets Thomas Petazzoni
@ 2010-07-05 16:59 ` Thomas Petazzoni
  2010-07-05 16:59 ` [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library Thomas Petazzoni
  2010-07-06  6:02 ` [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Peter Korsgaard
  10 siblings, 0 replies; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:59 UTC (permalink / raw)
  To: buildroot

Most toolchains have their libraries either in /lib or /usr/lib
relative to their ARCH_SYSROOT_DIR. Buildroot toolchains, however,
have basic libraries in /lib, and libstdc++/libgcc_s in
/usr/<target-name>/lib(64).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 3996184..1c84893 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -42,6 +42,11 @@
 # directory to the target directory. Also optionaly strips the
 # library.
 #
+# Most toolchains have their libraries either in /lib or /usr/lib
+# relative to their ARCH_SYSROOT_DIR. Buildroot toolchains, however,
+# have basic libraries in /lib, and libstdc++/libgcc_s in
+# /usr/<target-name>/lib(64).
+#
 # $1: arch specific sysroot directory
 # $2: library name
 # $3: destination directory
@@ -52,7 +57,11 @@ copy_toolchain_lib_root = \
 	LIB="$(strip $2)"; \
 	STRIP="$(strip $4)"; \
  \
-	LIBS=`(cd $${ARCH_SYSROOT_DIR}; find . -path "./lib/$${LIB}.*" -o -path "./usr/lib/$${LIB}.*")` ; \
+	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
+		find -L . -path "./lib/$${LIB}.*"     -o \
+			  -path "./usr/lib/$${LIB}.*" -o \
+			  -path "./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/lib*/$${LIB}.*" \
+		)` ; \
 	for FILE in $${LIBS} ; do \
 		LIB=`basename $${FILE}`; \
 		LIBDIR=`dirname $${FILE}` ; \
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (8 preceding siblings ...)
  2010-07-05 16:59 ` [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains Thomas Petazzoni
@ 2010-07-05 16:59 ` Thomas Petazzoni
  2010-07-06  6:02 ` [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Peter Korsgaard
  10 siblings, 0 replies; 20+ messages in thread
From: Thomas Petazzoni @ 2010-07-05 16:59 UTC (permalink / raw)
  To: buildroot

Until now, the function copy_toolchain_lib_root was copying a given
library to the target filesystem by assuming that it should be at the
same place it was in the toolchain sysroot.

However, with Buildroot hiding libstdc++ in
/usr/<target-name>/lib(64), this isn't correct, and it is probably
safer not to rely on the toolchain organization anyway.

Therefore :

 * Instead of having a single EXTERNAL_LIBS variable, we now have
   LIB_EXTERNAL_LIBS and USR_LIB_EXTERNAL_LIBS, which respectively
   list the libraries that should be copied to /lib and /usr/lib. As
   of today, only libstdc++ is part of the second list.

 * The copy_toolchain_lib_root takes another argument, which is the
   destination directory of the library, relative to $(TARGET_DIR)

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 1c84893..7ca138b 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -49,12 +49,13 @@
 #
 # $1: arch specific sysroot directory
 # $2: library name
-# $3: destination directory
+# $3: destination directory of the libary, relative to $(TARGET_DIR)
 # $4: strip (y|n), default is to strip
 #
 copy_toolchain_lib_root = \
 	ARCH_SYSROOT_DIR="$(strip $1)"; \
 	LIB="$(strip $2)"; \
+	DESTDIR="$(strip $3)" ; \
 	STRIP="$(strip $4)"; \
  \
 	LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
@@ -67,17 +68,17 @@ copy_toolchain_lib_root = \
 		LIBDIR=`dirname $${FILE}` ; \
 		while test \! -z "$${LIB}"; do \
 			FULLPATH="$${ARCH_SYSROOT_DIR}/$${LIBDIR}/$${LIB}" ; \
-			rm -fr $(TARGET_DIR)/$${LIBDIR}/$${LIB}; \
-			mkdir -p $(TARGET_DIR)/$${LIBDIR}; \
+			rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIB}; \
+			mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
 			if test -h $${FULLPATH} ; then \
-				cp -d $${FULLPATH} $(TARGET_DIR)/$${LIBDIR}/; \
+				cp -d $${FULLPATH} $(TARGET_DIR)/$${DESTDIR}/; \
 			elif test -f $${FULLPATH}; then \
-				$(INSTALL) -D -m0755 $${FULLPATH} $(TARGET_DIR)/$${LIBDIR}/$${LIB}; \
+				$(INSTALL) -D -m0755 $${FULLPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIB}; \
 				case "$${STRIP}" in \
 				(0 | n | no) \
 ;; \
 				(*) \
-					$(TARGET_CROSS)strip "$(TARGET_DIR)/$${LIBDIR}/$${LIB}"; \
+					$(TARGET_CROSS)strip "$(TARGET_DIR)/$${DESTDIR}/$${LIB}"; \
 ;; \
 				esac; \
 			else \
@@ -277,19 +278,19 @@ check_cross_compiler_exists = \
 
 uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
 
-EXTERNAL_LIBS=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
+LIB_EXTERNAL_LIBS=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GCLIBC),y)
-EXTERNAL_LIBS+=libnss_files.so libnss_dns.so
+LIB_EXTERNAL_LIBS+=libnss_files.so libnss_dns.so
 endif
 
 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
-EXTERNAL_LIBS+=libstdc++.so
+USR_LIB_EXTERNAL_LIBS+=libstdc++.so
 endif
 
 ifneq ($(BR2_PTHREADS_NONE),y)
-EXTERNAL_LIBS+=libpthread.so
+LIB_EXTERNAL_LIBS+=libpthread.so
 ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
-EXTERNAL_LIBS+=libthread_db.so
+LIB_EXTERNAL_LIBS+=libthread_db.so
 endif # gdbserver
 endif # ! no threads
 
@@ -338,8 +339,11 @@ else
 endif
 	mkdir -p $(TARGET_DIR)/lib
 	@echo "Copy external toolchain libraries to target..."
-	$(Q)for libs in $(EXTERNAL_LIBS); do \
-		$(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+	$(Q)for libs in $(LIB_EXTERNAL_LIBS); do \
+		$(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
+	done
+	$(Q)for libs in $(USR_LIB_EXTERNAL_LIBS); do \
+		$(call copy_toolchain_lib_root,$(ARCH_SYSROOT_DIR),$$libs,/usr/lib,$(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
 	done
 	@echo "Copy external toolchain sysroot to staging..."
 	$(Q)$(call copy_toolchain_sysroot,$(SYSROOT_DIR),$(ARCH_SYSROOT_DIR),$(ARCH_SUBDIR))
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains
  2010-07-05 16:59 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
@ 2010-07-05 19:26   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-07-05 19:26 UTC (permalink / raw)
  To: buildroot

On Monday 05 July 2010 18:59:00 Thomas Petazzoni wrote:
> 
> With uClibc 64 bits toolchain, the dynamic loader is named
> ld64-uClibc.so.0 and not ld-uClibc.so.0. So, this commit adjust the
> uClibc detection code for external toolchains.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants
  2010-07-05 16:58 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
@ 2010-07-05 19:26   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-07-05 19:26 UTC (permalink / raw)
  To: buildroot

On Monday 05 July 2010 18:58:54 Thomas Petazzoni wrote:
> External toolchains using Glibc have different names for the dynamic
> loader. Some of them name it ld-linux.so.*, while some others (such as
> the PowerPC and MIPS CodeSourcery toolchains) name it simply ld.so.*.
> 
> Therefore, we fix the glibc detection code to handle this case.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection
  2010-07-05 16:58 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
@ 2010-07-05 19:27   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-07-05 19:27 UTC (permalink / raw)
  To: buildroot

On Monday 05 July 2010 18:58:55 Thomas Petazzoni wrote:
> For the detection of the ARCH_SYSROOT_DIR (which contains the C
> library variant specific to the compiler flags), we used to pass only
> the -march argument instead of the full TARGET_CFLAGS. This was done
> because TARGET_CFLAGS contains --sysroot, and we don't want to tell
> here the compiler which sysroot to use, because we're specifically
> asking the compiler where the *normal* arch sysroot directory is.
> 
> Unfortunately, there are some multilib variants that aren't decided
> only based on -march, but also on -msoft-float or other compiler
> flags. Therefore, we take the opposite approach: pass the full
> TARGET_CFLAGS, from which we have stripped the --sysroot option.
> 
> For example, this allows a PowerPC CodeSourcery toolchain, on which
> we're using the soft-float multilib variant, to work properly as an
> external toolchain.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot
  2010-07-05 16:58 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
@ 2010-07-05 19:27   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-07-05 19:27 UTC (permalink / raw)
  To: buildroot

On Monday 05 July 2010 18:58:56 Thomas Petazzoni wrote:
> Instead of copying all directories in "etc lib sbin usr", check that
> each of them exists before doing the copy. This is only to avoid an
> harmless error message.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains
  2010-07-05 16:58 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
@ 2010-07-05 19:27   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-07-05 19:27 UTC (permalink / raw)
  To: buildroot

On Monday 05 July 2010 18:58:57 Thomas Petazzoni wrote:
> On 64 bits glibc toolchains, the dynamic loader is named
> ld-linux-x86-64.so and not simply ld-linux.so. So, adjust the
> detection of the C library accordingly.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed
  2010-07-05 16:58 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
@ 2010-07-05 19:28   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-07-05 19:28 UTC (permalink / raw)
  To: buildroot

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@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@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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes
  2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (9 preceding siblings ...)
  2010-07-05 16:59 ` [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library Thomas Petazzoni
@ 2010-07-06  6:02 ` Peter Korsgaard
  10 siblings, 0 replies; 20+ messages in thread
From: Peter Korsgaard @ 2010-07-06  6:02 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Hello,
 Thomas> Here is a new version of my ext-toolchain-fixes branch, which fixes
 Thomas> the problem noted by Peter on the sysroot detection code.

 Thomas> We switch to --sysroot=/path/to instead of --sysroot /path/to, which
 Thomas> eases the filtering of this option, which is needed to find out the
 Thomas> original location of the toolchain sysroot.

Committed, thanks!

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants
  2010-06-14 11:54 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
@ 2010-06-14 19:50   ` Yann E. MORIN
  0 siblings, 0 replies; 20+ messages in thread
From: Yann E. MORIN @ 2010-06-14 19:50 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On Monday 14 June 2010 13:54:12 Thomas Petazzoni wrote:
> External toolchains using Glibc have different names for the dynamic
> loader. Some of them name it ld-linux.so.*, while some others (such as
> the PowerPC and MIPS CodeSourcery toolchains) name it simply ld.so.*.
> 
> Therefore, we fix the glibc detection code to handle this case.
[--SNIP--]
>  check_glibc = \
>  	SYSROOT_DIR="$(strip $1)"; \
> -	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* ; then \
> +	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \

Can't we just readelf(1) the libc.so to get the dynamic linker name ?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants
  2010-06-14 11:54 Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 19:50   ` Yann E. MORIN
  0 siblings, 1 reply; 20+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 UTC (permalink / raw)
  To: buildroot

External toolchains using Glibc have different names for the dynamic
loader. Some of them name it ld-linux.so.*, while some others (such as
the PowerPC and MIPS CodeSourcery toolchains) name it simply ld.so.*.

Therefore, we fix the glibc detection code to handle this case.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 toolchain/external-toolchain/ext-tool.mk |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 8daae15..3943ceb 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -155,7 +155,7 @@ check_glibc_feature = \
 #
 check_glibc = \
 	SYSROOT_DIR="$(strip $1)"; \
-	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* ; then \
+	if ! test -f $${SYSROOT_DIR}/lib/ld-linux.so.* -o -f $${SYSROOT_DIR}/lib/ld.so.* ; then \
 		echo "Incorrect selection of the C library"; \
 		exit -1; \
 	fi; \
@@ -251,11 +251,9 @@ check_cross_compiler_exists = \
 
 uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
 
-EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL_UCLIBC),y)
-EXTERNAL_LIBS+=ld-uClibc.so
-else
-EXTERNAL_LIBS+=ld-linux.so libnss_files.so libnss_dns.so
+EXTERNAL_LIBS=ld*.so libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libresolv.so librt.so libutil.so
+ifeq ($(BR2_TOOLCHAIN_EXTERNAL_GCLIBC),y)
+EXTERNAL_LIBS+=libnss_files.so libnss_dns.so
 endif
 
 ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2010-07-06  6:02 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-05 16:58 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
2010-07-05 16:58 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
2010-07-05 19:26   ` Yann E. MORIN
2010-07-05 16:58 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
2010-07-05 19:27   ` Yann E. MORIN
2010-07-05 16:58 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
2010-07-05 19:27   ` Yann E. MORIN
2010-07-05 16:58 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
2010-07-05 19:27   ` Yann E. MORIN
2010-07-05 16:58 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
2010-07-05 19:28   ` Yann E. MORIN
2010-07-05 16:58 ` [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains Thomas Petazzoni
2010-07-05 16:59 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
2010-07-05 19:26   ` Yann E. MORIN
2010-07-05 16:59 ` [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets Thomas Petazzoni
2010-07-05 16:59 ` [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains Thomas Petazzoni
2010-07-05 16:59 ` [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library Thomas Petazzoni
2010-07-06  6:02 ` [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Peter Korsgaard
  -- strict thread matches above, loose matches on Subject: below --
2010-06-14 11:54 Thomas Petazzoni
2010-06-14 11:54 ` [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants Thomas Petazzoni
2010-06-14 19:50   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.