Skip to contentSkip to conversation

Misc toolchain fixes

PATCH New Thomas Petazzoni 1 participant 5 messages Oct 29, 2013 – Oct 30, 2013

lore
Share & tools
lore
#0 lore raw

cover Misc toolchain fixes

Hello,

Here is a small set of misc toolchain fixes: fix for Linaro toolchain usage and comment, fix to install libthread_db in more cases (i.e when gdb native is installed on the target).

Thomas

Thomas Petazzoni (3):
toolchain-external: add missing symlink for Linaro toolchains
toolchain-external: fix visibility and length of Linaro toolchain
comment
glibc, toolchain-external: copy libthread_db when gdb is enabled

 package/glibc/glibc.mk                             | 2 +-
 toolchain/toolchain-external/Config.in             | 5 ++---
 toolchain/toolchain-external/toolchain-external.mk | 7 ++++---
 3 files changed, 7 insertions(+), 7 deletions(-)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/3 toolchain-external: add missing symlink for Linaro toolchains

In 11ec38b6950 ("toolchain-external: fix Linaro ARM toolchain support"), we fixed the support for Linaro EABIhf toolchains by adding a /lib/arm-linux-gnueabihf -> /lib symbolic link. This is needed because the dynamic loader looks for libraries in /lib/arm-linux-gnueabihf rather than the usual /lib, but Buildroot installs all libraries in /lib.

However, we forgot that the dynamic loader also loads libraries from /usr/lib/arm-linux-gnueabihf rather than /usr/lib, so this patch fixes that by adding the necessary symbolic link.

---
 toolchain/toolchain-external/toolchain-external.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
toolchain/toolchain-external/toolchain-external.mk +3 -2
index d41cc7c..771f69a 100644
@@ -222,10 +222,11 @@ TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
 endif
 
 # The Linaro ARMhf toolchain expects the libraries in
-# /lib/arm-linux-gnueabihf, but Buildroot copies them to /lib, so we
-# need to create a symbolic link.
+# {/usr,}/lib/arm-linux-gnueabihf, but Buildroot copies them to
+# {/usr,}/lib, so we need to create a symbolic link.
 define TOOLCHAIN_EXTERNAL_LINARO_ARMHF_SYMLINK
 	ln -sf . $(TARGET_DIR)/lib/arm-linux-gnueabihf
+	ln -sf . $(TARGET_DIR)/usr/lib/arm-linux-gnueabihf
 endef
 
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109),y)
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 2/3 toolchain-external: fix visibility and length of Linaro toolchain comment

In reply to Thomas Petazzoni

Maxime Ripard reported that the Linaro toolchains were not visible when selecting a Cortex-A, but forgetting to set the EABI to EABIhf. While this is expected, Buildroot should normally should a comment in this case. However, the comment is only visible when the selected ARM architecture is not ARMv7 *and* the EABI is not EABIhf. Instead, make the comment visible when either the selected architecture is not ARMv7 *or* when the selected EABI is not EABIhf.

While we're at it, reword the comment text so that it actually fits within the limits of the menuconfig screen.

---
 toolchain/toolchain-external/Config.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
toolchain/toolchain-external/Config.in +2 -3
index 48b5865..ad35dc7 100644
@@ -66,10 +66,9 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_07
 
 	  To use this toolchain, you must disable soft float usage.
 
-comment "Linaro toolchains available for Cortex-A{5,7,8,9,15} and the EABIhf ABI"
+comment "Linaro toolchains available for Cortex-A + EABIhf"
 	depends on BR2_arm
-	depends on BR2_GCC_TARGET_ARCH != "armv7-a"
-	depends on !BR2_ARM_EABIHF
+	depends on BR2_GCC_TARGET_ARCH != "armv7-a" || !BR2_ARM_EABIHF
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305
 	bool "Sourcery CodeBench ARM 2013.05"
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 3/3 glibc, toolchain-external: copy libthread_db when gdb is enabled

In reply to Thomas Petazzoni

As Samuel Martin noticed, libthread_db is not only needed when cross-gdb+gdbserver is used, but also when the native gdb is used on the target. As a consequence, this patch modifies the glibc package and the external toolchain logic to ensure that libthread_db is copied to the target either when the native gdb or gdbserver is enabled, by relying on the BR2_PACKAGE_GDB option, which is enabled when native gdb and/or gdbserver are enabled.

---
 package/glibc/glibc.mk                             | 2 +-
 toolchain/toolchain-external/toolchain-external.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/glibc/glibc.mk +1 -1
index 0dab492..2e7fe82 100644
@@ -116,7 +116,7 @@ GLIBC_LIBS_LIB = \
 	libnsl.so.* libpthread.so.* libresolv.so.* librt.so.* libutil.so.*   \
 	libnss_files.so.* libnss_dns.so.*
 
-ifeq ($(BR2_PACKAGE_GDB_SERVER),y)
+ifeq ($(BR2_PACKAGE_GDB),y)
 GLIBC_LIBS_LIB += libthread_db.so.*
 endif
 
toolchain/toolchain-external/toolchain-external.mk +1 -1
index 771f69a..9f53a34 100644
@@ -63,7 +63,7 @@ LIB_EXTERNAL_LIBS+=ld*.so.*
 endif
 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
 LIB_EXTERNAL_LIBS+=libpthread.so.*
-ifneq ($(BR2_PACKAGE_GDB_SERVER)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),)
+ifneq ($(BR2_PACKAGE_GDB)$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY),)
 LIB_EXTERNAL_LIBS+=libthread_db.so.*
 endif # gdbserver
 endif # ! no threads
Signature · 1 line
1.8.1.2
author Applied
#4 lore raw

cover Misc toolchain fixes

In reply to Thomas Petazzoni
Quoted 11 lines · Thomas Petazzoni

Here is a small set of misc toolchain fixes: fix for Linaro toolchain usage and comment, fix to install libthread_db in more cases (i.e when gdb native is installed on the target).

Thomas

Thomas Petazzoni (3):
toolchain-external: add missing symlink for Linaro toolchains
toolchain-external: fix visibility and length of Linaro toolchain
comment
glibc, toolchain-external: copy libthread_db when gdb is enabled

I have applied those three patches to for-peter-2013.11.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com