All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] traceroute: fix 'no rule to make target -lm' error
Date: Wed, 07 Nov 2018 22:08:54 +0100	[thread overview]
Message-ID: <878t24bno9.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <51e4e1aa-c4c8-0353-dbfa-722756a49f71@mind.be> (Arnout Vandecappelle's message of "Tue, 6 Nov 2018 00:40:38 +0100")

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

Hi,

 >  Now, the incorrect dependencies will only affect us in case a Makefile contains
 > a rule like this:

 > foo: -lbar
 > 	$(CC) -o $@ $^

 > because make will expand $^ into the vpath-expanded /usr/lib/libbar.so (assuming
 > we set VPATH to STAGING_DIR, but libbar.so doesn't exist in STAGING_DIR). But in
 > that case, we'll get a link error so that situation will be detected and the
 > Makefile can be patched.

 >  For traceroute, this isn't the case; it has something like:

 > LIBS := -lbar
 > foo: $(LIBS)
 > 	$(CC) -o $@ $(LIBS)

 > so the VPATH override should work.

I still find it a bit strange to list system libraries as dependencies
when the Makefile doesn't have any rules to create/update them, but yeah.


 >  Bottom line: it looks like Sergio's patch is indeed correct, and moreover, it
 > looks like it might be better to add it to TARGET_MAKE_ENV. Note sure if we want
 > to take the risk at this point to make such a landslide change?

I've now committed Sergio's patch with these details added to the
description, thanks for the investigation.

Notice that this particular case could also be fixed by filtering out
-l% from LIBS, just like traceroute already does for -L entries:

LIBDEPS = $(filter-out -L%,$(LIBS))

..

$(TARGET): $(OBJS) $(MOD_OBJS) $(LIBDEPS)
           $(CC) $(LDFLAGS) -o $@ $(OBJS) $(MOD_OBJS) $(LIBS)

-- 
Bye, Peter Korsgaard

  parent reply	other threads:[~2018-11-07 21:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 22:37 [Buildroot] [PATCH] traceroute: fix 'no rule to make target -lm' error Sergio Prado
2018-11-04 10:45 ` Thomas Petazzoni
2018-11-04 11:26   ` Thomas Petazzoni
2018-11-05 15:25     ` Arnout Vandecappelle
2018-11-05 23:40       ` Arnout Vandecappelle
2018-11-06 10:07         ` Peter Korsgaard
2018-11-06 10:32           ` Arnout Vandecappelle
2018-11-07 21:08         ` Peter Korsgaard [this message]
2018-11-07 21:02 ` Peter Korsgaard
2018-11-25 20:51 ` Peter Korsgaard

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=878t24bno9.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.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 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.