All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes
@ 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
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 UTC (permalink / raw)
  To: buildroot

Hello,

Here is a patch set improving the support for external toolchains,
after testing with Buildroot x86-64 toolchain, Crosstool-NG x86-64
toolchain, MIPS and PowerPC CodeSourcery toolchains.

The MIPS CodeSourcery toolchain is not fully supported yet: it is a
very smart multilib toolchain, which supports both glibc and uclibc in
a single toolchain, with -muclibc being the gcc flag to switch to
uClibc. For the moment, only the default variant (glibc) is supported.

This patchset only touches toolchain/external-toolchain/ext-tool.mk,
except for a patch that is added to uClibc to fix fcntl64() on 64 bits
targets. This patch is already upstream in the master branch, and a
bug has been filled into the uClibc bug tracker to ask for this patch
to be merged into the 0.9.31 branch.

Thomas

The following changes since commit 7c709f4affc44f3bbc9a09fec8d84ae3807e31e7:
  Peter Korsgaard (1):
        file: don't force _GNU_SOURCE in CFLAGS

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

 toolchain/external-toolchain/ext-tool.mk           |   92 +++++++++++++-------
 ...ibc-0.9.31-fix-fcntl64-for-64-bit-targets.patch |   34 +++++++
 2 files changed, 96 insertions(+), 30 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] 21+ messages in thread

* [Buildroot] [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic loader variants
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 19:50   ` Yann E. MORIN
  2010-06-14 11:54 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 21+ 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] 21+ messages in thread

* [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes 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 11:54 ` Thomas Petazzoni
  2010-06-14 19:54   ` Yann E. MORIN
  2010-06-28 11:09   ` Peter Korsgaard
  2010-06-14 11:54 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
                   ` (7 subsequent siblings)
  9 siblings, 2 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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>
---
 toolchain/external-toolchain/ext-tool.mk |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

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] 21+ messages in thread

* [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes 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 11:54 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 19:56   ` Yann E. MORIN
  2010-06-14 11:54 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 20:07   ` Yann E. MORIN
  2010-06-14 11:54 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (3 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 21:11   ` Yann E. MORIN
  2010-06-14 11:54 ` [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains Thomas Petazzoni
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (4 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 11:54 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (5 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 11:54 ` [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets Thomas Petazzoni
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (6 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 11:54 ` [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains Thomas Petazzoni
  2010-06-14 11:54 ` [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library Thomas Petazzoni
  9 siblings, 0 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (7 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  2010-06-14 11:54 ` [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library Thomas Petazzoni
  9 siblings, 0 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ messages in thread

* [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library
  2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes Thomas Petazzoni
                   ` (8 preceding siblings ...)
  2010-06-14 11:54 ` [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains Thomas Petazzoni
@ 2010-06-14 11:54 ` Thomas Petazzoni
  9 siblings, 0 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 11:54 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] 21+ 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; 21+ 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] 21+ messages in thread

* [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection
  2010-06-14 11:54 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
@ 2010-06-14 19:54   ` Yann E. MORIN
  2010-06-28 11:09   ` Peter Korsgaard
  1 sibling, 0 replies; 21+ messages in thread
From: Yann E. MORIN @ 2010-06-14 19:54 UTC (permalink / raw)
  To: buildroot

On Monday 14 June 2010 13:54:13 Thomas Petazzoni wrote:
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

FWIW:
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] 21+ messages in thread

* [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot
  2010-06-14 11:54 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
@ 2010-06-14 19:56   ` Yann E. MORIN
  0 siblings, 0 replies; 21+ messages in thread
From: Yann E. MORIN @ 2010-06-14 19:56 UTC (permalink / raw)
  To: buildroot

On Monday 14 June 2010 13:54:14 Thomas Petazzoni wrote:
> 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] 21+ messages in thread

* [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains
  2010-06-14 11:54 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
@ 2010-06-14 20:07   ` Yann E. MORIN
  2010-06-14 20:59     ` Thomas Petazzoni
  0 siblings, 1 reply; 21+ messages in thread
From: Yann E. MORIN @ 2010-06-14 20:07 UTC (permalink / raw)
  To: buildroot

On Monday 14 June 2010 13:54:15 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.
[--SNIP--]
>  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 \

Using readelf(1) on libc.so would give us the exact name of the dynamic
linker ( but I'm just repeating myself here... :-) )

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] 21+ messages in thread

* [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains
  2010-06-14 20:07   ` Yann E. MORIN
@ 2010-06-14 20:59     ` Thomas Petazzoni
  2010-06-14 21:06       ` Yann E. MORIN
  0 siblings, 1 reply; 21+ messages in thread
From: Thomas Petazzoni @ 2010-06-14 20:59 UTC (permalink / raw)
  To: buildroot

On Mon, 14 Jun 2010 22:07:30 +0200
"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> wrote:

> Using readelf(1) on libc.so would give us the exact name of the
> dynamic linker ( but I'm just repeating myself here... :-) )

That's a good idea to investigate. I'll have a look at it, but I'd
prefer if this patch set could get merged as is, and have a look at
this idea afterwards.

Thanks for the hint!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

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

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

Thomas, All,

On Monday 14 June 2010 22:59:02 Thomas Petazzoni wrote:
> On Mon, 14 Jun 2010 22:07:30 +0200
> "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> wrote:
> > Using readelf(1) on libc.so would give us the exact name of the
> > dynamic linker ( but I'm just repeating myself here... :-) )
> That's a good idea to investigate. I'll have a look at it, but I'd
> prefer if this patch set could get merged as is, and have a look at
> this idea afterwards.

Yes, sure! You can add my:
  Reviewed-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>

to the 3 patches which deal with that:
  [PATCH 01/10] ext-toolchains: take into account other Glibc dynamic [...]
  [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains
  [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains

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] 21+ messages in thread

* [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed
  2010-06-14 11:54 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
@ 2010-06-14 21:11   ` Yann E. MORIN
  0 siblings, 0 replies; 21+ messages in thread
From: Yann E. MORIN @ 2010-06-14 21:11 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On Monday 14 June 2010 13:54:16 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)

That holds true for crosstool-NG, but what if another toolchain has the
lib64 -> lib, but usr/lib64 is a directory (or the other way around) ?

>  # 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

I think that should be called unconditionally for 64-bit targets, but only
create missing .../lib (or .../lib64) as symlink to the other.

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] 21+ messages in thread

* [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection
  2010-06-14 11:54 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
  2010-06-14 19:54   ` Yann E. MORIN
@ 2010-06-28 11:09   ` Peter Korsgaard
  1 sibling, 0 replies; 21+ messages in thread
From: Peter Korsgaard @ 2010-06-28 11:09 UTC (permalink / raw)
  To: buildroot

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

Hi,

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

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

[snip]

 Thomas> +TARGET_CFLAGS_NO_SYSROOT=$(filter-out --sysroot=%,$(TARGET_CFLAGS))

Hmm, in package/Makefile.in I see:

else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TARGET_CFLAGS+=--sysroot $(STAGING_DIR)/
TARGET_CXXFLAGS=$(TARGET_CFLAGS)

E.G. no = between --sysroot and the value.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 21+ 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; 21+ 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] 21+ 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
  0 siblings, 1 reply; 21+ 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] 21+ messages in thread

end of thread, other threads:[~2010-07-05 19:26 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-14 11:54 [Buildroot] [pull request] Pull request for branch ext-toolchain-fixes 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
2010-06-14 11:54 ` [Buildroot] [PATCH 02/10] ext-toolchain: Fix ARCH_SYSROOT detection Thomas Petazzoni
2010-06-14 19:54   ` Yann E. MORIN
2010-06-28 11:09   ` Peter Korsgaard
2010-06-14 11:54 ` [Buildroot] [PATCH 03/10] external-toolchain: only copy existing directories of the sysroot Thomas Petazzoni
2010-06-14 19:56   ` Yann E. MORIN
2010-06-14 11:54 ` [Buildroot] [PATCH 04/10] external-toolchain: support 64 bits glibc toolchains Thomas Petazzoni
2010-06-14 20:07   ` Yann E. MORIN
2010-06-14 20:59     ` Thomas Petazzoni
2010-06-14 21:06       ` Yann E. MORIN
2010-06-14 11:54 ` [Buildroot] [PATCH 05/10] external-toolchain: create lib64 symlinks if needed Thomas Petazzoni
2010-06-14 21:11   ` Yann E. MORIN
2010-06-14 11:54 ` [Buildroot] [PATCH 06/10] external-toolchain: mention MIPS and PowerPC CodeSourcery toolchains Thomas Petazzoni
2010-06-14 11:54 ` [Buildroot] [PATCH 07/10] external-toolchain: recognize uClibc 64 bits toolchains Thomas Petazzoni
2010-06-14 11:54 ` [Buildroot] [PATCH 08/10] uclibc: add patch to fix fcntl64() on 64 bits targets Thomas Petazzoni
2010-06-14 11:54 ` [Buildroot] [PATCH 09/10] external-toolchain: handle libstdc++/libgcc_s for BR toolchains Thomas Petazzoni
2010-06-14 11:54 ` [Buildroot] [PATCH 10/10] external-toolchain: hardcode the destination directory for a library Thomas Petazzoni
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

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.