Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@linux.ibm.com>
To: Brian Norris <briannorris@chromium.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kbuild@vger.kernel.org, bpf@vger.kernel.org
Subject: [PATCH] tools build: Provide consistent build options for fixdep
Date: Wed, 14 Aug 2024 19:30:21 +0200	[thread overview]
Message-ID: <20240814173021.3726785-1-agordeev@linux.ibm.com> (raw)

The fixdep binary is being compiled and linked in one step since commit
ea974028a049 ("tools build: Avoid circular .fixdep-in.o.cmd issues").
While the host linker flags are passed to the compiler the host compiler
flags are missed.

That might lead to failures as result of the compiler vs linker flags
inconsistency. For example, during RPM package build redhat-hardened-ld
script is provided to gcc, while redhat-hardened-cc1 script is missed.
That leads to an error on s390:

/usr/bin/ld: /tmp/ccUT8Rdm.o: `stderr@@GLIBC_2.2' non-PLT reloc for
symbol defined in shared library and accessed from executable (rebuild
file with -fPIC ?)

Provide both KBUILD_HOSTCFLAGS and KBUILD_HOSTLDFLAGS to avoid that.

Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---

This patch is against kernel-next next-20240814 tag

---
 tools/build/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/build/Makefile b/tools/build/Makefile
index fea3cf647f5b..18ad131f6ea7 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -44,4 +44,4 @@ ifneq ($(wildcard $(TMP_O)),)
 endif
 
 $(OUTPUT)fixdep: $(srctree)/tools/build/fixdep.c
-	$(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
+	$(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTCFLAGS) $(KBUILD_HOSTLDFLAGS) -o $@ $<
-- 
2.43.0


             reply	other threads:[~2024-08-14 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 17:30 Alexander Gordeev [this message]
2024-08-14 17:35 ` [PATCH] tools build: Provide consistent build options for fixdep Brian Norris
2024-08-14 17:53   ` Alexander Gordeev
2024-08-15  7:03     ` Thorsten Leemhuis
2024-08-15 21:07       ` Arnaldo Carvalho de Melo

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=20240814173021.3726785-1-agordeev@linux.ibm.com \
    --to=agordeev@linux.ibm.com \
    --cc=acme@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=briannorris@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@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