diff mbox

[for,next,1/2] toolchain-external: improve lib subdirectory matching

Message ID 1424098379-8320-2-git-send-email-patrickdepinguin@gmail.com
State Superseded
Headers show

Commit Message

Thomas De Schampheleire Feb. 16, 2015, 2:52 p.m. UTC
From: Bai Yingjie <byj.tea@gmail.com>

The toolchain from the Cavium Networks Octeon SDK provides a sysroot
with library directories lib32, lib32-fp, lib64 and lib64-fp. The -fp
variants are used for processors with hardware floating point unit, such
as the Octeon III variants.

When specifying -march=octeon3 in BR2_TARGET_OPTIMIZATION, the toolchain
will use lib32-fp, but currently Buildroot does not accept that pattern.

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

Signed-off-by: Bai Yingjie <byj.tea@gmail.com>
[ThomasDS: update commit message]
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
 toolchain/toolchain-external/toolchain-external.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Baruch Siach Feb. 17, 2015, 11:26 a.m. UTC | #1
Hi Thomas,

On Mon, Feb 16, 2015 at 03:52:58PM +0100, Thomas De Schampheleire wrote:
> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> index 999a354..e05957c 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -434,13 +434,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

Not directly related to this patch, but the reason we use this convoluted way 
to find sysroot (instead of just -print-sysroot) is to support toolchains 
older than 4.4. Can we get rid of this as part of removing support for AVR32?

baruch
Thomas De Schampheleire Feb. 17, 2015, 3:18 p.m. UTC | #2
Hi Baruch,

On Tue, Feb 17, 2015 at 12:26 PM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Thomas,
>
> On Mon, Feb 16, 2015 at 03:52:58PM +0100, Thomas De Schampheleire wrote:
>> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
>> index 999a354..e05957c 100644
>> --- a/toolchain/toolchain-external/toolchain-external.mk
>> +++ b/toolchain/toolchain-external/toolchain-external.mk
>> @@ -434,13 +434,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
>
> Not directly related to this patch, but the reason we use this convoluted way
> to find sysroot (instead of just -print-sysroot) is to support toolchains
> older than 4.4. Can we get rid of this as part of removing support for AVR32?

What do you mean with '4.4', gcc version 4.4?
In this case I would answer no, because toolchains using gcc older
than 4.4 are still commonly used by buildroot users (at least in my
case), so not supporting them anymore does not seem good.

Best regards,
Thomas
diff mbox

Patch

diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 999a354..e05957c 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -434,13 +434,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