Skip to contentSkip to conversation

toolchain-external: Improve lib subdirectory matching

PATCH New Bai Yingjie 3 participants 4 messages Sep 3, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain-external: Improve lib subdirectory matching

Some external toolchain provides lib32-fp which supports FPU instructions as well as lib32 in sys-root/usr, but lib32-fp can't be matched and in consequence causes a compile error.

The toolchain in this case is OCTEON mips64 toolchain, and the CFLAGS cause the issue is -march=octeon3.

This patch improves the matching by accepting lib(32|64)?([^/]*)? as lib name.

---
 toolchain/toolchain-external/toolchain-external.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
toolchain/toolchain-external/toolchain-external.mk +2 -2
index b2957d9..dad000e 100644
@@ -436,13 +436,13 @@ endef
 
 # Returns the sysroot location for the given compiler + flags
 define toolchain_find_sysroot
-$$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:(usr/)?lib(32|64)?/([^/]*/)?libc\.a::')
+$$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:(usr/)?lib(32|64)?([^/]*)?/([^/]*/)?libc\.a::')
 endef
 
 # Returns the lib subdirectory for the given compiler + flags (i.e
 # typically lib32 or lib64 for some toolchains)
 define toolchain_find_libdir
-$$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64)?)/([^/]*/)?libc.a:\2:')
+$$(echo -n $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64)?([^/]*)?)/([^/]*/)?libc.a:\2:')
 endef
 
 # Checks for an already installed toolchain: check the toolchain
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 toolchain-external: Improve lib subdirectory matching

Dear Bai Yingjie,

Quoted 11 lines · Bai Yingjie

Some external toolchain provides lib32-fp which supports FPU instructions as well as lib32 in sys-root/usr, but lib32-fp can't be matched and in consequence causes a compile error.

The toolchain in this case is OCTEON mips64 toolchain, and the CFLAGS cause the issue is -march=octeon3.

This patch improves the matching by accepting lib(32|64)?([^/]*)? as lib name.

Thanks for this contribution! Is this toolchain available publicly? The problem I have is that if the toolchain is not available, then we have no way to test if future changes to the external toolchain logic will not break the support for this toolchain.

Thanks!

Thomas

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

PATCH 1/1 toolchain-external: Improve lib subdirectory matching

Hi Thomas,

Quoted 13 lines · Thomas Petazzoni

Dear Bai Yingjie,

Quoted 10 lines · Bai Yingjie

Some external toolchain provides lib32-fp which supports FPU instructions as well as lib32 in sys-root/usr, but lib32-fp can't be matched and in consequence causes a compile error.

The toolchain in this case is OCTEON mips64 toolchain, and the CFLAGS cause the issue is -march=octeon3.

This patch improves the matching by accepting lib(32|64)?([^/]*)? as lib name.

Quoted 6 lines
Quoted 1 line

Thanks for this contribution! Is this toolchain available publicly? The problem I have is that if the toolchain is not available, then we have no way to test if future changes to the external toolchain logic will not break the support for this toolchain.

The mentioned toolchain comes from Cavium Networks. You can find a public version of this toolchain here:
http://www.cnusers.org/index.php?option=com_remository&Itemid=32&func=select&id=62

I don't think that this public toolchain is 100% identical to the one given to their (paying) customers, but I assume that the lib32-fp issue is the same.

Best regards,
Thomas

#3 lore raw

PATCH 1/1 toolchain-external: Improve lib subdirectory matching

Hi Thomas,

Quoted 24 lines · Thomas De Schampheleire

Hi Thomas,

Quoted 13 lines · Thomas Petazzoni

Dear Bai Yingjie,

Quoted 10 lines · Bai Yingjie

Some external toolchain provides lib32-fp which supports FPU instructions as well as lib32 in sys-root/usr, but lib32-fp can't be matched and in consequence causes a compile error.

The toolchain in this case is OCTEON mips64 toolchain, and the CFLAGS cause the issue is -march=octeon3.

This patch improves the matching by accepting lib(32|64)?([^/]*)? as lib name.

Quoted 6 lines
Quoted 1 line

Thanks for this contribution! Is this toolchain available publicly? The problem I have is that if the toolchain is not available, then we have no way to test if future changes to the external toolchain logic will not break the support for this toolchain.

Quoted 7 lines

The mentioned toolchain comes from Cavium Networks. You can find a public version of this toolchain here:
http://www.cnusers.org/index.php?option=com_remository&Itemid=32&func=select&id=62

I don't think that this public toolchain is 100% identical to the one given to their (paying) customers, but I assume that the lib32-fp issue is the same.

I am very happy to get replied, thanks for your explanation.