netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Marcus Meissner <meissner@suse.de>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] iproute2/misc: do not mix CFLAGS with LDFLAGS
Date: Fri, 4 Aug 2017 09:09:10 -0700	[thread overview]
Message-ID: <20170804090910.72a1a4ad@xeon-e3> (raw)
In-Reply-To: <20170804095402.30943-1-meissner@suse.de>

On Fri,  4 Aug 2017 11:54:02 +0200
Marcus Meissner <meissner@suse.de> wrote:

> during linking, do not use CFLAGS. This avoid clashes when doing PIE builds.
> ---
>  misc/Makefile | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/misc/Makefile b/misc/Makefile
> index 72807678..1d86c44d 100644
> --- a/misc/Makefile
> +++ b/misc/Makefile
> @@ -23,17 +23,17 @@ all: $(TARGETS)
>  ss: $(SSOBJ)
>  	$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
>  
> -nstat: nstat.c
> -	$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm
> +nstat: nstat.o
> +	$(QUIET_CC)$(CC) $(LDFLAGS) -o nstat nstat.o $(LIBNETLINK) -lm
>  
> -ifstat: ifstat.c
> -	$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) -lm
> +ifstat: ifstat.o
> +	$(QUIET_CC)$(CC) $(LDFLAGS) -o ifstat ifstat.o $(LIBNETLINK) -lm
>  
> -rtacct: rtacct.c
> -	$(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) -lm
> +rtacct: rtacct.o
> +	$(QUIET_CC)$(CC) $(LDFLAGS) -o rtacct rtacct.o $(LIBNETLINK) -lm
>  
> -arpd: arpd.c
> -	$(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(LDFLAGS) -o arpd arpd.c $(LIBNETLINK) -ldb -lpthread
> +arpd: arpd.o
> +	$(QUIET_CC)$(CC) $(LDFLAGS) -o arpd arpd.o $(LIBNETLINK) -ldb -lpthread
>  
>  ssfilter.c: ssfilter.y
>  	$(QUIET_YACC)bison ssfilter.y -o ssfilter.c

Some CFLAGS do need to be passed to gcc when doing linking, think of -flto
I don't see this on gcc with Debian and hardening.

      reply	other threads:[~2017-08-04 16:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-04  9:54 [PATCH] iproute2/misc: do not mix CFLAGS with LDFLAGS Marcus Meissner
2017-08-04 16:09 ` Stephen Hemminger [this message]

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=20170804090910.72a1a4ad@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=meissner@suse.de \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).