Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* Tool directory build problem..
@ 2025-09-27 18:23 Linus Torvalds
  2025-09-27 20:18 ` Nicolas Schier
  2025-09-29 18:25 ` Nathan Chancellor
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Torvalds @ 2025-09-27 18:23 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier, Borislav Petkov
  Cc: Linux Kbuild mailing list

This isn't new, but I hit the problem once again because I decided
that I should make sure to build-test the tools before the 6.17
release since I got another tool pull fairly late in the game..

And it fails annoyingly and immediately, with

    make tools/all

failing quickly for the ACPI pfrut tool with

    undefined reference to `uuid_unparse'

errors.

Those errors do *not* happen if you build it inside the tools/
directory itself. So doing

    make -C tools all

works just fine, but we literally have a "tools/%" target that is
designed for this, and it doesn't work.

It doesn't work for that pfrut tool because the top-level Makefile
rule does this:

    $(Q)$(MAKE) LDFLAGS= O=$(abspath $(objtree)) subdir=tools -C
$(srctree)/tools/ $*

and that "LDFLAGS=" is an overriding variable assignment, so the use of

    LDFLAGS += -luuid

in tools/power/acpi/tools/pfrut/Makefile end sup not working.

But it works in all other situations, just not when build this way
from the top. Annoying.

I'm not sure *why* the top-level Makefile does that "LDFLAGS="
override thing. It doesn't do it for anything else. Just that LDFLAGS
variable.

Yes, yes, the ACPI tool makefile could then use

    override LDFLAGS += -luuid

but why would it do something as crazy as that?

That "LDFLAGS=" override goes back many many years,  In fact, it goes
back to the very initial addition of those rules in commit
ea01fa9f63ae ("tools: Connect to the kernel build system").

So I have no idea why it exists. Just removing the "LDFLAGS=" override
seems to fix everything for me, but I must be missing something.

And when I say "fix everything", I lie. It fixes this issue, and most
things build find, but it eventually ends up hitting a few build
errors in the tests and then fatally for virtio_test.

That seems to be entirely unrelated, and an actual real build problem
(possibly me not having some library or other, my motivation to look
into it ran out).

Comments?

              Linus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-29 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-27 18:23 Tool directory build problem Linus Torvalds
2025-09-27 20:18 ` Nicolas Schier
2025-09-29 18:25 ` Nathan Chancellor
2025-09-29 18:29   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox