All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH for next 0/2] Add support for Cavium Octeon III
@ 2015-02-16 14:52 Thomas De Schampheleire
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching Thomas De Schampheleire
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64 Thomas De Schampheleire
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2015-02-16 14:52 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

This series adds support for building for the Cavium Octeon III processor,
using the Cavium Networks SDK. The specific thing about this toolchain is
that the libraries for the hardware-floating point capable processors are in
lib32-fp and lib64-fp, rather than lib32/lib64.

The first patch was submitted earlier, and is resent with updated commit
message.

Bai Yingjie (1):
  toolchain-external: improve lib subdirectory matching

Thomas De Schampheleire (1):
  toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed
    lib32/lib64

 Makefile                                             | 14 +-------------
 toolchain/helpers.mk                                 | 12 ++++++++++++
 toolchain/toolchain-buildroot/toolchain-buildroot.mk | 11 +++++++++++
 toolchain/toolchain-external/toolchain-external.mk   | 16 ++++++++++++++--
 4 files changed, 38 insertions(+), 15 deletions(-)

-- 
1.8.5.1

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

* [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching
  2015-02-16 14:52 [Buildroot] [PATCH for next 0/2] Add support for Cavium Octeon III Thomas De Schampheleire
@ 2015-02-16 14:52 ` Thomas De Schampheleire
  2015-02-17 11:26   ` Baruch Siach
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64 Thomas De Schampheleire
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas De Schampheleire @ 2015-02-16 14:52 UTC (permalink / raw)
  To: buildroot

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(-)

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

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

* [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64
  2015-02-16 14:52 [Buildroot] [PATCH for next 0/2] Add support for Cavium Octeon III Thomas De Schampheleire
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching Thomas De Schampheleire
@ 2015-02-16 14:52 ` Thomas De Schampheleire
  2015-02-17  9:05   ` Thomas De Schampheleire
  2015-02-17 11:33   ` Baruch Siach
  1 sibling, 2 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2015-02-16 14:52 UTC (permalink / raw)
  To: buildroot

From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Currently, following symbolic links are created in both target and
staging directories:
- lib(32|64) --> lib
- usr/lib(32|64) --> lib

The decision for lib32 or lib64 is based on the target architecture
configuration in buildroot (BR2_ARCH_IS_64).

In at least one case this is not correct: when building for a Cavium Octeon III
processor using the toolchain from the Cavium Networks SDK, and specifying
-march=octeon3 in BR2_TARGET_OPTIMIZATION, libraries are expected in directory
'lib32-fp' rather than 'lib32' (likewise for lib64-fp).

More generally, for external toolchains, the correct symbolic link is
from (usr/)${ARCH_LIB_DIR} to lib. For internal toolchains, current
toolchains always use either lib32 or lib64.

Fix the problem as follows:
- create symlink creation helpers in toolchain/helpers.mk
- for external toolchains, call these helpers based on ARCH_LIB_DIR
- for internal toolchains, call these helpers based on the existing
  fixed lib32/lib64 logic, moved from Makefile
- to fix build order problems, add the correct dependency on
  $(BUILD_DIR) from $(BUILD_DIR)/.root

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
Note: the handling in the internal toolchain is a bit awkward because it
explicitly adds a new target, but I don't see a much better way: it must
be done _before_ the toolchain is being built. The entire logic cannot
be done in Makefile as ARCH_LIB_DIR is not available there.
---
 Makefile                                             | 14 +-------------
 toolchain/helpers.mk                                 | 12 ++++++++++++
 toolchain/toolchain-buildroot/toolchain-buildroot.mk | 11 +++++++++++
 toolchain/toolchain-external/toolchain-external.mk   | 12 ++++++++++++
 4 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index 338c992..9f4cf8a 100644
--- a/Makefile
+++ b/Makefile
@@ -449,20 +449,10 @@ world: target-post-image
 $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
 	@mkdir -p $@
 
-# We make a symlink lib32->lib or lib64->lib as appropriate
-# MIPS64/n32 requires lib32 even though it's a 64-bit arch.
-ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
-LIB_SYMLINK = lib64
-else
-LIB_SYMLINK = lib32
-endif
-
 $(STAGING_DIR):
 	@mkdir -p $(STAGING_DIR)/bin
 	@mkdir -p $(STAGING_DIR)/lib
-	@ln -snf lib $(STAGING_DIR)/$(LIB_SYMLINK)
 	@mkdir -p $(STAGING_DIR)/usr/lib
-	@ln -snf lib $(STAGING_DIR)/usr/$(LIB_SYMLINK)
 	@mkdir -p $(STAGING_DIR)/usr/include
 	@mkdir -p $(STAGING_DIR)/usr/bin
 	@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
@@ -475,15 +465,13 @@ RSYNC_VCS_EXCLUSIONS = \
 	--exclude .svn --exclude .git --exclude .hg --exclude .bzr \
 	--exclude CVS
 
-$(BUILD_DIR)/.root:
+$(BUILD_DIR)/.root: $(BUILD_DIR)
 	mkdir -p $(TARGET_DIR)
 	rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
 		--chmod=Du+w --exclude .empty --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 	$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
-	@ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
 	@mkdir -p $(TARGET_DIR)/usr
-	@ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
 	touch $@
 
 $(TARGET_DIR): $(BUILD_DIR)/.root
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 3121da4..6b5ebe7 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -1,5 +1,17 @@
 # This Makefile fragment declares toolchain related helper functions.
 
+# Create the necessary symlink from (usr/)lib32|lib64|lib32-fp|... to lib
+# In general, for external toolchains, the correct link name is $ARCH_LIB_DIR.
+create_staging_lib_symlink = \
+	LIB_SYMLINK="$(strip $1)" ; \
+	ln -snf lib $(STAGING_DIR)/$${LIB_SYMLINK} ; \
+	ln -snf lib $(STAGING_DIR)/usr/$${LIB_SYMLINK}
+
+create_target_lib_symlink = \
+	LIB_SYMLINK="$(strip $1)" ; \
+	ln -snf lib $(TARGET_DIR)/$${LIB_SYMLINK} ; \
+	ln -snf lib $(TARGET_DIR)/usr/$${LIB_SYMLINK}
+
 # The copy_toolchain_lib_root function copies a toolchain library and
 # its symbolic links from the sysroot directory to the target
 # directory. Note that this function is used both by the external
diff --git a/toolchain/toolchain-buildroot/toolchain-buildroot.mk b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
index b30cc33..e1fe1f4 100644
--- a/toolchain/toolchain-buildroot/toolchain-buildroot.mk
+++ b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
@@ -12,6 +12,17 @@ BR_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC))
 
 TOOLCHAIN_BUILDROOT_DEPENDENCIES = host-gcc-final
 
+ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
+LIB_SYMLINK = lib64
+else
+LIB_SYMLINK = lib32-fp
+endif
+
+host-gcc-final: create-lib-symlinks
+create-lib-symlinks: $(STAGING_DIR) $(TARGET_DIR)
+	$(call create_staging_lib_symlink,$(LIB_SYMLINK))
+	$(call create_target_lib_symlink,$(LIB_SYMLINK))
+
 TOOLCHAIN_BUILDROOT_ADD_TOOLCHAIN_DEPENDENCY = NO
 
 $(eval $(virtual-package))
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index e05957c..927608e 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -600,6 +600,16 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
 	$(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
 endef
 
+define TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK
+	ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
+	$(call create_staging_lib_symlink,$${ARCH_LIB_DIR})
+endef
+
+define TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK
+	ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
+	$(call create_target_lib_symlink,$${ARCH_LIB_DIR})
+endef
+
 # Special installation target used on the Blackfin architecture when
 # FDPIC is not the primary binary format being used, but the user has
 # nonetheless requested the installation of the FDPIC libraries to the
@@ -699,6 +709,7 @@ define TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT
 endef
 
 define TOOLCHAIN_EXTERNAL_INSTALL_STAGING_CMDS
+	$(TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_GDBINIT)
@@ -708,6 +719,7 @@ endef
 # and the target directory, we do everything within the
 # install-staging step, arbitrarily.
 define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_CMDS
+	$(TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FDPIC)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_BFIN_FLAT)
-- 
1.8.5.1

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

* [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64 Thomas De Schampheleire
@ 2015-02-17  9:05   ` Thomas De Schampheleire
  2015-02-17 11:33   ` Baruch Siach
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2015-02-17  9:05 UTC (permalink / raw)
  To: buildroot

On Mon, Feb 16, 2015 at 3:52 PM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> From: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> Currently, following symbolic links are created in both target and
> staging directories:
> - lib(32|64) --> lib
> - usr/lib(32|64) --> lib
>
> The decision for lib32 or lib64 is based on the target architecture
> configuration in buildroot (BR2_ARCH_IS_64).
>
> In at least one case this is not correct: when building for a Cavium Octeon III
> processor using the toolchain from the Cavium Networks SDK, and specifying
> -march=octeon3 in BR2_TARGET_OPTIMIZATION, libraries are expected in directory
> 'lib32-fp' rather than 'lib32' (likewise for lib64-fp).
>
> More generally, for external toolchains, the correct symbolic link is
> from (usr/)${ARCH_LIB_DIR} to lib. For internal toolchains, current
> toolchains always use either lib32 or lib64.
>
> Fix the problem as follows:
> - create symlink creation helpers in toolchain/helpers.mk
> - for external toolchains, call these helpers based on ARCH_LIB_DIR
> - for internal toolchains, call these helpers based on the existing
>   fixed lib32/lib64 logic, moved from Makefile
> - to fix build order problems, add the correct dependency on
>   $(BUILD_DIR) from $(BUILD_DIR)/.root
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
> ---
> Note: the handling in the internal toolchain is a bit awkward because it
> explicitly adds a new target, but I don't see a much better way: it must
> be done _before_ the toolchain is being built. The entire logic cannot
> be done in Makefile as ARCH_LIB_DIR is not available there.
> ---
>  Makefile                                             | 14 +-------------
>  toolchain/helpers.mk                                 | 12 ++++++++++++
>  toolchain/toolchain-buildroot/toolchain-buildroot.mk | 11 +++++++++++
>  toolchain/toolchain-external/toolchain-external.mk   | 12 ++++++++++++
>  4 files changed, 36 insertions(+), 13 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 338c992..9f4cf8a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -449,20 +449,10 @@ world: target-post-image
>  $(BUILD_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
>         @mkdir -p $@
>
> -# We make a symlink lib32->lib or lib64->lib as appropriate
> -# MIPS64/n32 requires lib32 even though it's a 64-bit arch.
> -ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
> -LIB_SYMLINK = lib64
> -else
> -LIB_SYMLINK = lib32
> -endif
> -
>  $(STAGING_DIR):
>         @mkdir -p $(STAGING_DIR)/bin
>         @mkdir -p $(STAGING_DIR)/lib
> -       @ln -snf lib $(STAGING_DIR)/$(LIB_SYMLINK)
>         @mkdir -p $(STAGING_DIR)/usr/lib
> -       @ln -snf lib $(STAGING_DIR)/usr/$(LIB_SYMLINK)
>         @mkdir -p $(STAGING_DIR)/usr/include
>         @mkdir -p $(STAGING_DIR)/usr/bin
>         @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
> @@ -475,15 +465,13 @@ RSYNC_VCS_EXCLUSIONS = \
>         --exclude .svn --exclude .git --exclude .hg --exclude .bzr \
>         --exclude CVS
>
> -$(BUILD_DIR)/.root:
> +$(BUILD_DIR)/.root: $(BUILD_DIR)
>         mkdir -p $(TARGET_DIR)
>         rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
>                 --chmod=Du+w --exclude .empty --exclude '*~' \
>                 $(TARGET_SKELETON)/ $(TARGET_DIR)/
>         $(INSTALL) -m 0644 support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
> -       @ln -snf lib $(TARGET_DIR)/$(LIB_SYMLINK)
>         @mkdir -p $(TARGET_DIR)/usr
> -       @ln -snf lib $(TARGET_DIR)/usr/$(LIB_SYMLINK)
>         touch $@
>
>  $(TARGET_DIR): $(BUILD_DIR)/.root
> diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> index 3121da4..6b5ebe7 100644
> --- a/toolchain/helpers.mk
> +++ b/toolchain/helpers.mk
> @@ -1,5 +1,17 @@
>  # This Makefile fragment declares toolchain related helper functions.
>
> +# Create the necessary symlink from (usr/)lib32|lib64|lib32-fp|... to lib
> +# In general, for external toolchains, the correct link name is $ARCH_LIB_DIR.
> +create_staging_lib_symlink = \
> +       LIB_SYMLINK="$(strip $1)" ; \
> +       ln -snf lib $(STAGING_DIR)/$${LIB_SYMLINK} ; \
> +       ln -snf lib $(STAGING_DIR)/usr/$${LIB_SYMLINK}
> +
> +create_target_lib_symlink = \
> +       LIB_SYMLINK="$(strip $1)" ; \
> +       ln -snf lib $(TARGET_DIR)/$${LIB_SYMLINK} ; \
> +       ln -snf lib $(TARGET_DIR)/usr/$${LIB_SYMLINK}
> +
>  # The copy_toolchain_lib_root function copies a toolchain library and
>  # its symbolic links from the sysroot directory to the target
>  # directory. Note that this function is used both by the external
> diff --git a/toolchain/toolchain-buildroot/toolchain-buildroot.mk b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
> index b30cc33..e1fe1f4 100644
> --- a/toolchain/toolchain-buildroot/toolchain-buildroot.mk
> +++ b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
> @@ -12,6 +12,17 @@ BR_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC))
>
>  TOOLCHAIN_BUILDROOT_DEPENDENCIES = host-gcc-final
>
> +ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
> +LIB_SYMLINK = lib64
> +else
> +LIB_SYMLINK = lib32-fp
> +endif
> +
> +host-gcc-final: create-lib-symlinks
> +create-lib-symlinks: $(STAGING_DIR) $(TARGET_DIR)
> +       $(call create_staging_lib_symlink,$(LIB_SYMLINK))
> +       $(call create_target_lib_symlink,$(LIB_SYMLINK))
> +
>  TOOLCHAIN_BUILDROOT_ADD_TOOLCHAIN_DEPENDENCY = NO
>
>  $(eval $(virtual-package))
> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> index e05957c..927608e 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -600,6 +600,16 @@ define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
>         $(call copy_toolchain_sysroot,$${SYSROOT_DIR},$${ARCH_SYSROOT_DIR},$${ARCH_SUBDIR},$${ARCH_LIB_DIR},$${SUPPORT_LIB_DIR})
>  endef
>
> +define TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK
> +       ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
> +       $(call create_staging_lib_symlink,$${ARCH_LIB_DIR})
> +endef
> +
> +define TOOLCHAIN_EXTERNAL_CREATE_TARGET_LIB_SYMLINK
> +       ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
> +       $(call create_target_lib_symlink,$${ARCH_LIB_DIR})
> +endef

These should be silenced with @.

Also, if ARCH_LIB_DIR is 'lib' itself, then a broken symlink will be
created inside the lib/ directory itself.

I will fix these issues and resubmit...

Best regards,
Thomas

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

* [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching Thomas De Schampheleire
@ 2015-02-17 11:26   ` Baruch Siach
  2015-02-17 15:18     ` Thomas De Schampheleire
  0 siblings, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2015-02-17 11:26 UTC (permalink / raw)
  To: buildroot

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

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64
  2015-02-16 14:52 ` [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64 Thomas De Schampheleire
  2015-02-17  9:05   ` Thomas De Schampheleire
@ 2015-02-17 11:33   ` Baruch Siach
  2015-02-17 15:20     ` Thomas De Schampheleire
  1 sibling, 1 reply; 8+ messages in thread
From: Baruch Siach @ 2015-02-17 11:33 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Mon, Feb 16, 2015 at 03:52:59PM +0100, Thomas De Schampheleire wrote:
> -# We make a symlink lib32->lib or lib64->lib as appropriate
> -# MIPS64/n32 requires lib32 even though it's a 64-bit arch.
> -ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
> -LIB_SYMLINK = lib64
> -else
> -LIB_SYMLINK = lib32
> -endif

[...]

> diff --git a/toolchain/toolchain-buildroot/toolchain-buildroot.mk b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
> index b30cc33..e1fe1f4 100644
> --- a/toolchain/toolchain-buildroot/toolchain-buildroot.mk
> +++ b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
> @@ -12,6 +12,17 @@ BR_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC))
>  
>  TOOLCHAIN_BUILDROOT_DEPENDENCIES = host-gcc-final
>  
> +ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
> +LIB_SYMLINK = lib64
> +else
> +LIB_SYMLINK = lib32-fp

This changes the original logic. We currently have 'LIB_SYMLINK = lib32' here 
(see above).

> +endif

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching
  2015-02-17 11:26   ` Baruch Siach
@ 2015-02-17 15:18     ` Thomas De Schampheleire
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2015-02-17 15:18 UTC (permalink / raw)
  To: buildroot

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

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

* [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64
  2015-02-17 11:33   ` Baruch Siach
@ 2015-02-17 15:20     ` Thomas De Schampheleire
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2015-02-17 15:20 UTC (permalink / raw)
  To: buildroot

On Tue, Feb 17, 2015 at 12:33 PM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Thomas,
>
> On Mon, Feb 16, 2015 at 03:52:59PM +0100, Thomas De Schampheleire wrote:
>> -# We make a symlink lib32->lib or lib64->lib as appropriate
>> -# MIPS64/n32 requires lib32 even though it's a 64-bit arch.
>> -ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
>> -LIB_SYMLINK = lib64
>> -else
>> -LIB_SYMLINK = lib32
>> -endif
>
> [...]
>
>> diff --git a/toolchain/toolchain-buildroot/toolchain-buildroot.mk b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
>> index b30cc33..e1fe1f4 100644
>> --- a/toolchain/toolchain-buildroot/toolchain-buildroot.mk
>> +++ b/toolchain/toolchain-buildroot/toolchain-buildroot.mk
>> @@ -12,6 +12,17 @@ BR_LIBC = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_LIBC))
>>
>>  TOOLCHAIN_BUILDROOT_DEPENDENCIES = host-gcc-final
>>
>> +ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
>> +LIB_SYMLINK = lib64
>> +else
>> +LIB_SYMLINK = lib32-fp
>
> This changes the original logic. We currently have 'LIB_SYMLINK = lib32' here
> (see above).

This is a leftover of my tests, this should clearly be 'lib32' indeed. Sorry.

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

end of thread, other threads:[~2015-02-17 15:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 14:52 [Buildroot] [PATCH for next 0/2] Add support for Cavium Octeon III Thomas De Schampheleire
2015-02-16 14:52 ` [Buildroot] [PATCH for next 1/2] toolchain-external: improve lib subdirectory matching Thomas De Schampheleire
2015-02-17 11:26   ` Baruch Siach
2015-02-17 15:18     ` Thomas De Schampheleire
2015-02-16 14:52 ` [Buildroot] [PATCH for next 2/2] toolchain: create symlink to 'lib' from ARCH_LIB_DIR iso fixed lib32/lib64 Thomas De Schampheleire
2015-02-17  9:05   ` Thomas De Schampheleire
2015-02-17 11:33   ` Baruch Siach
2015-02-17 15:20     ` Thomas De Schampheleire

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.