All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Jiafu He <jay@goldhive.com>
Cc: linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] Makefile.build: Fix built-in.o linking errors
Date: Thu, 17 Dec 2009 23:34:32 +0100	[thread overview]
Message-ID: <4B2AB1F8.8090100@suse.cz> (raw)
In-Reply-To: <20091216170114.0b50c25debf12a9aa545bf810459b532.5b12d5606d.wbe@email.secureserver.net>

Jiafu He napsal(a):
> This patch fixes two linking errors regarding the empty built-in.o:
> - Error "...built-in.o: no such file or directory" happens if
> "dirx/Makefile" contains only "obj-m += diry/ dirz/" and the empty
> "dirx/built-in.o" is missing. Adding $(subdir-m) into check for
> builtin-target fixes this error.
> - Linking the child builtin.o's using arm-xscale-linux-gnueabi linker
> fails with an EABI version mismatch error "... has EABI version 0, but
> ... has EABI verion 4". The cause is built-in.o created by $(AR) has
> EABI verison 0, while the non-empty built-in.o's have EABI version 4.
> The fix is to use $(CC) to create the empty built-in.o.
> 
> The fixes have been tested with x86/x86_64 native platforms and the
> arm-xscale-linux-gnueabi cross-compiler.
> 
> Signed-off-by: Jiafu He <jay@goldhive.com>
> -----
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 341b589..c8c8c81 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -82,7 +82,7 @@ ifneq ($(strip $(lib-y) $(lib-m) $(lib-n) $(lib-)),)
>  lib-target := $(obj)/lib.a
>  endif
>  
> -ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(lib-target)),)
> +ifneq ($(strip $(obj-y) $(obj-m) $(obj-n) $(obj-) $(subdir-m)
> $(lib-target)),)
>  builtin-target := $(obj)/built-in.o
>  endif

Ack on this part, I need to think a bit more about the second part :).
Could you please send two separate patches, they fix two independent
issues after all.

Thanks,
Michal

>  
> @@ -291,7 +291,7 @@ quiet_cmd_link_o_target = LD      $@
>  cmd_link_o_target = $(if $(strip $(obj-y)),\
>                       $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^)
> \
>                       $(cmd_secanalysis),\
> -                     rm -f $@; $(AR) rcs $@)
> +                     rm -f $@; $(CC) -c -xassembler /dev/null -o $@)
>  
>  $(builtin-target): $(obj-y) FORCE
>         $(call if_changed,link_o_target)
> -----
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2009-12-17 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-17  0:01 [PATCH] Makefile.build: Fix built-in.o linking errors Jiafu He
2009-12-17 22:34 ` Michal Marek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-12-18  1:04 Jiafu He

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=4B2AB1F8.8090100@suse.cz \
    --to=mmarek@suse.cz \
    --cc=jay@goldhive.com \
    --cc=linux-kbuild@vger.kernel.org \
    /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 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.