Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] bfin: put the libc link path of the flat shared and sep data formats before the sysroot link path
Date: Fri, 20 Mar 2015 22:42:07 +0100	[thread overview]
Message-ID: <20150320224207.7b3334b9@free-electrons.com> (raw)
In-Reply-To: <1426669156-24250-2-git-send-email-sonic.adi@gmail.com>

Dear Sonic Zhang,

On Wed, 18 Mar 2015 16:59:16 +0800, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@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@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

Thanks for this patch. I did some quick testing with
BR2_BINFMT_FLAT_SHARED with and without your patch, and I do not see a
difference. For example, I've built strace with and without your patch
applied, and the resulting binary has the same size. Looking at
strace.gdb using readelf, I can see that the C library functions are
not inside the strace binary itself, while with a BR2_BINFMT_FLAT_ONE
build, the strace binary is definitely bigger and a readelf on
strace.gdb shows that the C library functions have been copied into the
binary.

So, could you give us an example of what this patch is fixing?

I'm sorry to ask such questions, but while the Blackfin architecture is
probably well known to you, it isn't to most of us, so some additional
details are always useful.

Thanks a lot!

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

  reply	other threads:[~2015-03-20 21:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  8:59 [Buildroot] [PATCH 1/2] bfin: remove the dependency of flat shared mode to shared library Sonic Zhang
2015-03-18  8:59 ` [Buildroot] [PATCH 2/2] bfin: put the libc link path of the flat shared and sep data formats before the sysroot link path Sonic Zhang
2015-03-20 21:42   ` Thomas Petazzoni [this message]
2015-03-23  2:57     ` Sonic Zhang
2015-12-29 21:01   ` Thomas Petazzoni
     [not found]     ` <B168F8A49F4BCF4C84FD23DA5F6363EE75D82F29@NWD2MBX7.ad.analog.com>
2015-12-30  8:53       ` Thomas Petazzoni
2015-03-20 21:45 ` [Buildroot] [PATCH 1/2] bfin: remove the dependency of flat shared mode to shared library Thomas Petazzoni
2015-03-23  2:43   ` Sonic Zhang
2015-03-24 19:09     ` Arnout Vandecappelle
2015-03-26  8:55       ` Sonic Zhang
2015-03-27 20:31         ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150320224207.7b3334b9@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox