Skip to contentSkip to conversation

toolchain-external: fix staging install for CodeSourcery AArch64 toolchain

PATCH New Romain Naour 2 participants 4 messages May 4, 2015 – May 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain-external: fix staging install for CodeSourcery AArch64 toolchain

The extracted toolchain sources contains a single symlink in the aarch64-linux-gnu/libc/lib directory wich is lost during Buildroot's staging install.

aarch64-linux-gnu/libc/lib/ld-linux-aarch64.so.1 -> ../lib64/ld-2.18.so

Add a custom post install staging hook to create it manually.

Cc Thomas Petazzoni <[email protected]>
---
 toolchain/toolchain-external/toolchain-external.mk | 4 ++++
 1 file changed, 4 insertions(+)
toolchain/toolchain-external/toolchain-external.mk +4 -0
index b293ba9..e66db77 100644
@@ -355,6 +355,10 @@ TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/aarch64-linux-gnu
 TOOLCHAIN_EXTERNAL_SOURCE = aarch64-2014.05-30-aarch64-linux-gnu-i686-pc-linux-gnu.tar.bz2
+define TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
+	ln -sf ld-2.18.so $(STAGING_DIR)/lib/ld-linux-aarch64.so.1
+endef
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL_CROSS),y)
 TOOLCHAIN_EXTERNAL_VERSION = 1.1.6
 TOOLCHAIN_EXTERNAL_SITE = https://googledrive.com/host/0BwnS5DMB0YQ6bDhPZkpOYVFhbk0/musl-$(TOOLCHAIN_EXTERNAL_VERSION)
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 toolchain-external: fix staging install for CodeSourcery AArch64 toolchain

Quoted 19 lines · Romain Naour

The extracted toolchain sources contains a single symlink in the aarch64-linux-gnu/libc/lib directory wich is lost during Buildroot's staging install.

aarch64-linux-gnu/libc/lib/ld-linux-aarch64.so.1 -> ../lib64/ld-2.18.so

Add a custom post install staging hook to create it manually.

Cc Thomas Petazzoni <[email protected]>
---
 toolchain/toolchain-external/toolchain-external.mk | 4 ++++
 1 file changed, 4 insertions(+)
toolchain/toolchain-external/toolchain-external.mk +0 -0
index b293ba9..e66db77 100644

toolchain/toolchain-external/toolchain-external.mk TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH · line 359

Quoted 5 lines
toolchain/toolchain-external/toolchain-external.mk +2 -0
@@ -355,6 +355,10 @@ TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/aarch64-linux-gnu
 TOOLCHAIN_EXTERNAL_SOURCE = aarch64-2014.05-30-aarch64-linux-gnu-i686-pc-linux-gnu.tar.bz2
+define TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
+	ln -sf ld-2.18.so $(STAGING_DIR)/lib/ld-linux-aarch64.so.1

Shouldn't this instead be added to LIB_EXTERNAL_LIBS like the other ld*.so* ?
Actually, it matches the ld*.so* pattern, so how come this isn't symlinked already? Actually, why is it even needed to symlink an ld.so in the staging dir?

Regards,
Arnout

Quoted 6 lines
toolchain/toolchain-external/toolchain-external.mk +2 -0
+endef
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL_CROSS),y)
 TOOLCHAIN_EXTERNAL_VERSION = 1.1.6
 TOOLCHAIN_EXTERNAL_SITE = https://googledrive.com/host/0BwnS5DMB0YQ6bDhPZkpOYVFhbk0/musl-$(TOOLCHAIN_EXTERNAL_VERSION)
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH 1/1 toolchain-external: fix staging install for CodeSourcery AArch64 toolchain

Hi Arnout,

Le 05/05/2015 23:34, Arnout Vandecappelle a ?crit :

Quoted 15 lines · Romain Naour
Quoted 14 lines

The extracted toolchain sources contains a single symlink in the aarch64-linux-gnu/libc/lib directory wich is lost during Buildroot's staging install.

aarch64-linux-gnu/libc/

Add a custom post install staging hook to create it manually.

Cc Thomas Petazzoni <[email protected]>
---
 toolchain/toolchain-external/toolchain-external.mk | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 13 lines

toolchain/toolchain-external/toolchain-external.mk TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH · line 359

Quoted 10 lines
toolchain/toolchain-external/toolchain-external.mk +2 -0
index b293ba9..e66db77 100644
@@ -355,6 +355,10 @@ TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/aarch64-linux-gnu
 TOOLCHAIN_EXTERNAL_SOURCE = aarch64-2014.05-30-aarch64-linux-gnu-i686-pc-linux-gnu.tar.bz2
+define TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
+	ln -sf ld-2.18.so $(STAGING_DIR)/lib/ld-linux-aarch64.so.1

Shouldn't this instead be added to LIB_EXTERNAL_LIBS like the other ld*.so* ?
Actually, it matches the ld*.so* pattern, so how come this isn't symlinked already?

I think it's because ARCH_LIB_DIR=lib64 and copy_toolchain_lib_root doesn't take into account the content of lib directory in that case.

Other toolchains contains this symlink in lib or lib64.

libc/lib:
ld-linux.so.2 -> ld-2.18.so

libc/lib64:
ld-linux-x86-64.so.2 -> ld-2.18.so

But here we have:
libc/lib:
ld-linux-aarch64.so.1 -> ../lib64/ld-2.18.so

and no symlink in lib64 directory.

Quoted 1 line

Actually, why is it even needed to symlink an ld.so in the staging dir?

Maybe just to avoid to link against a library with a specific version (ld-2.18.do) and be sure that the correct ELF dynamic linker is user depending on arch's name (ld-linux-aarch64.so.1).
Otherwise, I don't know.

Best regards,
Romain

Quoted 14 lines

Regards,
Arnout

Quoted 6 lines
toolchain/toolchain-external/toolchain-external.mk +2 -0
+endef
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL_CROSS),y)
 TOOLCHAIN_EXTERNAL_VERSION = 1.1.6
 TOOLCHAIN_EXTERNAL_SITE = https://googledrive.com/host/0BwnS5DMB0YQ6bDhPZkpOYVFhbk0/musl-$(TOOLCHAIN_EXTERNAL_VERSION)
#3 lore raw

PATCH 1/1 toolchain-external: fix staging install for CodeSourcery AArch64 toolchain

Hi Arnout, all

Le 06/05/2015 00:19, Romain Naour a ?crit :

Quoted 11 lines

Hi Arnout,

Le 05/05/2015 23:34, Arnout Vandecappelle a ?crit :

Quoted 8 lines · Romain Naour
Quoted 7 lines

The extracted toolchain sources contains a single symlink in the aarch64-linux-gnu/libc/lib directory wich is lost during Buildroot's staging install.

aarch64-linux-gnu/libc/

Add a custom post install staging hook to create it manually.

The simlink is also needed in the target directory.

Best regards,
Romain

Quoted 68 lines
Quoted 7 lines
Quoted 7 lines
Cc Thomas Petazzoni <[email protected]>
---
 toolchain/toolchain-external/toolchain-external.mk | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 13 lines

toolchain/toolchain-external/toolchain-external.mk TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH · line 359

Quoted 10 lines
toolchain/toolchain-external/toolchain-external.mk +2 -0
index b293ba9..e66db77 100644
@@ -355,6 +355,10 @@ TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64),y)
 TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/aarch64-linux-gnu
 TOOLCHAIN_EXTERNAL_SOURCE = aarch64-2014.05-30-aarch64-linux-gnu-i686-pc-linux-gnu.tar.bz2
+define TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
+	ln -sf ld-2.18.so $(STAGING_DIR)/lib/ld-linux-aarch64.so.1

Shouldn't this instead be added to LIB_EXTERNAL_LIBS like the other ld*.so* ?
Actually, it matches the ld*.so* pattern, so how come this isn't symlinked already?

I think it's because ARCH_LIB_DIR=lib64 and copy_toolchain_lib_root doesn't take into account the content of lib directory in that case.

Other toolchains contains this symlink in lib or lib64.

libc/lib:
ld-linux.so.2 -> ld-2.18.so

libc/lib64:
ld-linux-x86-64.so.2 -> ld-2.18.so

But here we have:
libc/lib:
ld-linux-aarch64.so.1 -> ../lib64/ld-2.18.so

and no symlink in lib64 directory.

Quoted 1 line

Actually, why is it even needed to symlink an ld.so in the staging dir?

Maybe just to avoid to link against a library with a specific version (ld-2.18.do) and be sure that the correct ELF dynamic linker is user depending on arch's name (ld-linux-aarch64.so.1).
Otherwise, I don't know.

Best regards,
Romain

Quoted 6 lines

Regards,
Arnout

Quoted 8 lines

toolchain/toolchain-external/toolchain-external.mk TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_AARCH · line 364

Quoted 6 lines
toolchain/toolchain-external/toolchain-external.mk +2 -0
+endef
+TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_FIXUP
 else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL_CROSS),y)
 TOOLCHAIN_EXTERNAL_VERSION = 1.1.6
 TOOLCHAIN_EXTERNAL_SITE = https://googledrive.com/host/0BwnS5DMB0YQ6bDhPZkpOYVFhbk0/musl-$(TOOLCHAIN_EXTERNAL_VERSION)

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot