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] kmod: disable --gc-sections ld option when building for xtensa
Date: Tue, 4 Mar 2014 20:22:18 +0100	[thread overview]
Message-ID: <20140304202218.3396f4f9@skate> (raw)
In-Reply-To: <1393960216-18633-1-git-send-email-jcmvbkbc@gmail.com>

Dear Max Filippov,

On Tue,  4 Mar 2014 23:10:16 +0400, Max Filippov wrote:
> This is a workaround for the following ld issue exhibited by --gc-sections
> option, until a proper fix for binutils is ready:
> 
> ld: BFD (GNU Binutils) 2.22 internal error, aborting at elf32-xtensa.c line 3374 in elf_xtensa_finish_dynamic_sections
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  package/kmod/900-disable-gc-sections.patch.xtensa | 12 ++++++++++++

The patch should be named kmod-01-<description>.patch. We no longer
accept architecture-specific patches, so the .xtensa extension has to
go, and we have to ensure that the fix is usable on all architectures.

So either we simply remove --gc-sections on all architecture, or the
configure.ac test has to be made conditional on xtensa.

>  1 file changed, 12 insertions(+)
>  create mode 100644 package/kmod/900-disable-gc-sections.patch.xtensa
> 
> diff --git a/package/kmod/900-disable-gc-sections.patch.xtensa b/package/kmod/900-disable-gc-sections.patch.xtensa
> new file mode 100644
> index 0000000..2b7a9cb
> --- /dev/null
> +++ b/package/kmod/900-disable-gc-sections.patch.xtensa

The patch lacks a description. See
http://buildroot.org/downloads/manual/manual.html#patch-policy for more
details about the format of the patches.

> @@ -0,0 +1,12 @@
> +--- kmod-16/configure	2013-12-23 01:31:12.456202872 +0400
> ++++ kmod-16.mod/configure	2014-03-04 22:53:37.132241845 +0400
> +@@ -14511,8 +14511,7 @@

We normally prefer to patch configure.ac, and add KMOD_AUTORECONF = YES.

All that being said, I believe there is a much simpler solution. Don't
use any patch at all, and add:

# --gc-sections triggers a bug in the current Xtensa binutils
ifeq ($(BR2_xtensa),y)
KMOD_CONF_ENV += cc_cv_LDFLAGS__Wl___gc_sections=no
endif

to package/kmod/kmod.mk.

Can you test that it works for you, and submit the corresponding patch?

Thanks!

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

  reply	other threads:[~2014-03-04 19:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 19:10 [Buildroot] [PATCH] kmod: disable --gc-sections ld option when building for xtensa Max Filippov
2014-03-04 19:22 ` Thomas Petazzoni [this message]
2014-03-04 20:23   ` Max Filippov

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=20140304202218.3396f4f9@skate \
    --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