mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [1/2] kbuild: Add a really-ld-option macro
Date: Sat, 19 Sep 2009 10:07:00 +0200	[thread overview]
Message-ID: <20090919080700.GA25811@merkur.ravnborg.org> (raw)
In-Reply-To: <20090916203654.6AF88B1755@basil.firstfloor.org>

On Wed, Sep 16, 2009 at 10:36:54PM +0200, Andi Kleen wrote:
> 
> Different from the existing ld macro by checking $(LD)
> 
> Needed for the next patch
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> 
> ---
>  scripts/Kbuild.include |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6.31-ak/scripts/Kbuild.include
> ===================================================================
> --- linux-2.6.31-ak.orig/scripts/Kbuild.include
> +++ linux-2.6.31-ak/scripts/Kbuild.include
> @@ -83,11 +83,12 @@ TMPOUT := $(if $(KBUILD_EXTMOD),$(firstw
>  # is automatically cleaned up.
>  try-run = $(shell set -e;		\
>  	TMP="$(TMPOUT).$$$$.tmp";	\
> +	TMPO="$(TMPOUT).$$$$.o";	\
>  	if ($(1)) >/dev/null 2>&1;	\
>  	then echo "$(2)";		\
>  	else echo "$(3)";		\
>  	fi;				\
> -	rm -f "$$TMP")
> +	rm -f "$$TMP" "$$TMPO")
>  
>  # as-option
>  # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
> @@ -135,6 +136,12 @@ cc-ifversion = $(shell [ $(call cc-versi
>  ld-option = $(call try-run,\
>  	$(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2))
>  
> +# really-ld-option
> +# checks $(LD) unlike ld-option
> +# Usage: LDFLAGS += $(call really-ld-option, -X)
> +really-ld-option = $(call try-run,\
> +	$(CC) /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
> +

kbuild has some strange marcro names - but adding more is no good.
I will:
1) rename ld-option to cc-ldoption
2) add ld-option, and _document_ it in makefiles.txt
3) use ld-option for the -X option

I had preferred your patchset did so.

	Sam

  reply	other threads:[~2009-09-19  8:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 20:36 [PATCH] [0/2] Updated patches for gold -X probing Andi Kleen
2009-09-16 20:36 ` [PATCH] [1/2] kbuild: Add a really-ld-option macro Andi Kleen
2009-09-19  8:07   ` Sam Ravnborg [this message]
2009-09-16 20:36 ` [PATCH] [2/2] kbuild: Check if linker supports the -X option Andi Kleen
2009-09-18  2:31 ` [PATCH] [0/2] Updated patches for gold -X probing Américo Wang

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=20090919080700.GA25811@merkur.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®