All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Thorsten Leemhuis <linux@leemhuis.info>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>,
	bpf@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH v4 2/3] tools build: Avoid circular .fixdep-in.o.cmd issues
Date: Tue, 13 Aug 2024 09:40:08 -0700	[thread overview]
Message-ID: <ZruMaIGu8EoAE1Fy@google.com> (raw)
In-Reply-To: <99ae0d34-ed76-4ca0-a9fd-c337da33c9f9@leemhuis.info>

Hi Thorsten,

On Mon, Aug 12, 2024 at 08:32:29AM +0200, Thorsten Leemhuis wrote:
> Lo! TWIMC, this change broke my daily arm64 and x86_64 Fedora vanilla RPM
> builds on all Fedora releases when it hit -next a few days ago. Reverting
> it fixes the problem.
> 
> The problem is related to the RPM magic somehow, as building worked fine
> when when I omitted stuff like "-specs=/usr/lib/rpm/redhat/redhat-
> hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" from the
> make call. So the real problem might be that space somewhere.
> 
> 
> This is how the build fails on x86_64:
> 
> + /usr/bin/make -s 'HOSTCFLAGS=-O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection   ' 'HOSTLDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes ' ARCH=x86_64 'KCFLAGS= ' WITH_GCOV=0 -j2 bzImage
> /usr/bin/ld: /tmp/ccMoR0Wr.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIE
> /usr/bin/ld: failed to set dynamic section sizes: bad value
> collect2: error: ld returned 1 exit status
> make[4]: *** [Makefile:47: /builddir/build/BUILD/kernel-next-20240812/linux-6.11.0-0.0.next.20240812.329.vanilla.fc40.x86_64/tools/objtool/fixdep] Error 1
> make[3]: *** [/builddir/build/BUILD/kernel-next-20240812/linux-6.11.0-0.0.next.20240812.329.vanilla.fc40.x86_64/tools/build/Makefile.include:15: fixdep] Error 2
> make[2]: *** [Makefile:73: objtool] Error 2
> make[1]: *** [/builddir/build/BUILD/kernel-next-20240812/linux-6.11.0-0.0.next.20240812.329.vanilla.fc40.x86_64/Makefile:1361: tools/objtool] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:226: __sub-make] Error 2
> error: Bad exit status from /var/tmp/rpm-tmp.ZQfBFY (%build)

I don't have a Fedora installation on hand at the moment, and the logs
don't seem to include most of the actual kernel build logs
(stdout+stderr of a V=1 build might help), but I think what you've
provided so far has highlighted one possible problem -- that the new
one-shot compile+link is ignoring HOSTCFLAGS, which were previously
respected via tools/build/Build.include. Could you try the following
diff? I'll cook a proper patch and description later, but for now:

--- 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) $(HOSTCFLAGS) $(KBUILD_HOSTLDFLAGS) -o $@ $<

  reply	other threads:[~2024-08-13 16:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 20:32 [PATCH v4 0/3] tools build: Incorrect fixdep dependencies Brian Norris
2024-07-15 20:32 ` [PATCH v4 1/3] tools build: Correct libsubcmd " Brian Norris
2024-07-15 20:32 ` [PATCH v4 2/3] tools build: Avoid circular .fixdep-in.o.cmd issues Brian Norris
2024-07-16  7:55   ` Jiri Olsa
2024-07-19 18:32     ` Andrii Nakryiko
2024-08-05 15:31       ` Arnaldo Carvalho de Melo
2024-08-02 21:17     ` Brian Norris
2024-08-12  6:32   ` Thorsten Leemhuis
2024-08-13 16:40     ` Brian Norris [this message]
2024-08-13 16:59       ` Thorsten Leemhuis
2024-07-15 20:32 ` [PATCH v4 3/3] tools build: Correct bpf fixdep dependencies Brian Norris
2024-07-19 18:31   ` Andrii Nakryiko

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=ZruMaIGu8EoAE1Fy@google.com \
    --to=briannorris@chromium.org \
    --cc=acme@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=irogers@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=masahiroy@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tmricht@linux.ibm.com \
    /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.