[Buildroot] [PATCH 2/2] bfin: put the libc link path of the flat shared and sep data formats before the sysroot link path

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Dec 29 21:01:49 UTC 2015


Sonic,

On Wed, 18 Mar 2015 16:59:16 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang at analog.com>
> 
> The libc of the shared flat and sep data formats are different from the
> standard flat libc in the sysroot lib path. In order to make application
> link with proper libc, put their path before the sysroot link path.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang at analog.com>
> ---
>  package/Makefile.in |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 803b162..e88d1ad 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -153,12 +153,12 @@ TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-elf2flt=-s$($(PKG)_FLAT_STACKSI
>  endif
>  
>  ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
> -TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0
> +TARGET_LDFLAGS += -mid-shared-library -mshared-library-id=0 -L$(STAGING_DIR)/usr/lib/mid-shared-library
>  TARGET_CFLAGS += -mid-shared-library -mshared-library-id=0
>  TARGET_CXXFLAGS += -mid-shared-library -mshared-library-id=0
>  endif
>  ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
> -TARGET_LDFLAGS += -msep-data
> +TARGET_LDFLAGS += -msep-data -L$(STAGING_DIR)/usr/lib/msep-data
>  TARGET_CFLAGS += -msep-data
>  TARGET_CXXFLAGS += -msep-data
>  endif

We finally discussed your patch today during a review meeting.
Unfortunately, your solution is not appropriate for two reasons:

 1) It applies to all cases, while the problem is completely specific
    to the Analog Devices Blackfin toolchain.

 2) The problem that needs to be solved is in fact that the external
    toolchain logic in Buildroot seems to not be copying the right
    sysroot. If you build with -mid-shared-library, then it's directly
    this libc.a variant that should be in $(STAGING_DIR)/usr/lib.

Could you instead investigate the external toolchain code to understand
why the appropriate sysroot doesn't get copied?

In the mean time, I'll mark your patch as Changes Requested in our
patch tracking system.

Thanks!

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


More information about the buildroot mailing list