Skip to contentSkip to conversation

linux-next: build failure after merge of the kbuild tree

DISCUSSION Stephen Rothwell 2 participants 10 messages Sep 8, 2022 – Sep 12, 2022 1 message not in the archive Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the kbuild tree, today's linux-next build (x86_64 allmodconfig) failed like this:

make[2]: *** No rule to make target 'objtool/objtool'. Stop. make[1]: *** [/home/sfr/next/next/Makefile:1361: tools/objtool/objtool] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:222: __sub-make] Error 2

I have used the kbuild tree from next-20220907 again (with the last 4 commits reverted).

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the kbuild tree, today's linux-next build (x86_64 allmodconfig) failed like this:

Hmm, I am testing allmodconfig in my tree, but it is not reproducible so far.

Do you have any more hint?
(which commit exactly?, and what build command did you use? etc.)

Quoted 1 line

make[2]: *** No rule to make target 'objtool/objtool'. Stop.

Presumably, it is failing in tools/Makefile, but I do not know how this can happen...

Quoted 10 lines

make[1]: *** [/home/sfr/next/next/Makefile:1361: tools/objtool/objtool] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:222: __sub-make] Error 2

I have used the kbuild tree from next-20220907 again (with the last 4 commits reverted).

--
Cheers,
Stephen Rothwell

--
Best Regards
Masahiro Yamada

#2 lore raw

Hi,

Quoted 6 lines · On Fri, 9 Sep 2022 14:10:06 +0900 Masahiro Yamada <[email protected]> wrote:

Hmm, I am testing allmodconfig in my tree, but it is not reproducible so far.

Do you have any more hint?
(which commit exactly?, and what build command did you use? etc.)

I was trying your top of tree commit

99ea8da56dca "kbuild: use objtool-args-y to clean up objtool arguments"

(merged with Linus' tree and some fix patches).

I am doing a cross build with an out of tree object directory:

$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../x86_64_allmodconfig -s allmodconfig
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../x86_64_allmodconfig -j100 -O -s
$ x86_64-linux-gnu-gcc --version
x86_64-linux-gnu-gcc (Debian 11.2.0-9) 11.2.0
$ x86_64-linux-gnu-ld --version
GNU ld (GNU Binutils for Debian) 2.37
$ make --version
GNU Make 4.3
Built for powerpc64le-unknown-linux-gnu
Quoted 4 lines
Quoted 1 line

make[2]: *** No rule to make target 'objtool/objtool'. Stop.

Presumably, it is failing in tools/Makefile, but I do not know how this can happen...

Right, I could not see what caused this, either. I tried reverting that top commit, but that did not help.

Signature · 2 lines
Cheers,
Stephen Rothwell
#3 lore raw

Hi,

Quoted 11 lines · On Fri, 9 Sep 2022 15:24:53 +1000 Stephen Rothwell <[email protected]> wrote:
Quoted 6 lines · On Fri, 9 Sep 2022 14:10:06 +0900 Masahiro Yamada <[email protected]> wrote:

Hmm, I am testing allmodconfig in my tree,
but it is not reproducible so far.

Do you have any more hint?
(which commit exactly?, and what build command did you use? etc.)

I was trying your top of tree commit

Quoted 8 lines

99ea8da56dca "kbuild: use objtool-args-y to clean up objtool arguments"

(merged with Linus' tree and some fix patches).

I am doing a cross build with an out of tree object directory:

$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../x86_64_allmodconfig -s allmodconfig
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../x86_64_allmodconfig -j100 -O -s

So it seems to be related to doing an incremental build. I have just built my "pending-fixes" branch (which I have pushed out to the linux-next tree on git.kernel.org), then merged your tree and then built again:

$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../obj -j15 -O
make[1]: Entering directory '/home/sfr/kernels/obj'
  GEN     Makefile
make[1]: Leaving directory '/home/sfr/kernels/obj'
make[1]: Entering directory '/home/sfr/kernels/obj'
  UPD     include/generated/compile.h
make[1]: Leaving directory '/home/sfr/kernels/obj'
  DESCEND objtool
make[2]: *** No rule to make target 'objtool/objtool'.  Stop.
make[1]: *** [/home/sfr/kernels/test/Makefile:1361: tools/objtool/objtool] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:222: __sub-make] Error 2

(I actually did this on my laptop rather than my build machine, but the compiles are still cross compiles - just from arm64 instead of powerpc64le).

Signature · 2 lines
Cheers,
Stephen Rothwell
#4 lore raw
Quoted 21 lines · Stephen Rothwell

Hi,

Quoted 17 lines · On Fri, 9 Sep 2022 15:24:53 +1000 Stephen Rothwell <[email protected]> wrote:
Quoted 6 lines · On Fri, 9 Sep 2022 14:10:06 +0900 Masahiro Yamada <[email protected]> wrote:

Hmm, I am testing allmodconfig in my tree,
but it is not reproducible so far.

Do you have any more hint?
(which commit exactly?, and what build command did you use? etc.)

I was trying your top of tree commit

99ea8da56dca "kbuild: use objtool-args-y to clean up objtool arguments"

(merged with Linus' tree and some fix patches).

I am doing a cross build with an out of tree object directory:

Quoted 7 lines
Quoted 2 lines
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../x86_64_allmodconfig -s allmodconfig
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../x86_64_allmodconfig -j100 -O -s

So it seems to be related to doing an incremental build. I have just built my "pending-fixes" branch (which I have pushed out to the linux-next tree on git.kernel.org), then merged your tree and then built again:

I tried this.

I built fa8e6bb658f682ff63b3af3dd4c5e4d3b43f4ffd (pending-fixes) first, then merged b326faa3e125.

masahiro@oscar:~/ref/linux-next$ git show --pretty=fuller
commit ca2e36215ba55dab29160cfe0512b5a8a172efe0 (HEAD -> merge-kbuild)
Merge: fa8e6bb658f6 b326faa3e125
Author:     Masahiro Yamada <[email protected]>
AuthorDate: Fri Sep 9 15:41:07 2022 +0900
Commit:     Masahiro Yamada <[email protected]>
CommitDate: Fri Sep 9 15:41:07 2022 +0900

Merge ../../workspace/linux-kbuild into merge-kbuild

Quoted 8 lines
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../obj -j15 -O
make[1]: Entering directory '/home/sfr/kernels/obj'
  GEN     Makefile
make[1]: Leaving directory '/home/sfr/kernels/obj'
make[1]: Entering directory '/home/sfr/kernels/obj'
  UPD     include/generated/compile.h
make[1]: Leaving directory '/home/sfr/kernels/obj'

Weird 'Entering/Leaving directory' logs.

In my case, it went quite normally.

I see only one 'Entering directory', with no error.

masahiro@oscar:~/ref/linux-next$ make ARCH=x86_64
CROSS_COMPILE=x86_64-linux-gnu- O=../obj  -j24
make[1]: Entering directory '/home/masahiro/ref/obj'
  GEN     Makefile
  DESCEND objtool
  CALL    /home/masahiro/ref/linux-next/scripts/atomic/check-atomics.sh
  CALL    /home/masahiro/ref/linux-next/scripts/checksyscalls.sh
  CHK     include/generated/compile.h
Quoted 12 lines

DESCEND objtool
make[2]: *** No rule to make target 'objtool/objtool'. Stop. make[1]: *** [/home/sfr/kernels/test/Makefile:1361: tools/objtool/objtool] Error 2 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:222: __sub-make] Error 2

(I actually did this on my laptop rather than my build machine, but the compiles are still cross compiles - just from arm64 instead of powerpc64le).
--
Cheers,
Stephen Rothwell

Signature · 2 lines
Best Regards
Masahiro Yamada
#5 lore raw

Hi,

Quoted 5 lines · On Fri, 9 Sep 2022 15:48:55 +0900 Masahiro Yamada <[email protected]> wrote:
Quoted 2 lines

I tried this.

I built fa8e6bb658f682ff63b3af3dd4c5e4d3b43f4ffd (pending-fixes) first, then merged b326faa3e125.

I don't have b326faa3e125 in my tree at all ... the kbuild/for-next branch I fetched this morning is commit

99ea8da56dca "kbuild: use objtool-args-y to clean up objtool arguments"

Commit b326faa3e125 looks like it is your "foo3" branch which does *not* contain your for-next branch.

I presume your builds are on an x86_64 machine?

I did a bisect which lead me to commit

f96f5ad080fe kbuild: move vmlinux.o rule to the top Makefile

So, I did:

build pending-fixes
merge f96f5ad080fe^
build again - which works fine

reset to pending-fixes and rebuild
merge f96f5ad080fe
build fails

Signature · 2 lines
Cheers,
Stephen Rothwell

A message that is not in the archive (sent off-list or not yet received): CAK7LNARiW66Hk5JJgRYb-edkb6sgTWPbNr1iETkq-RASCo-YkA@mail.gmail.com

#7 lore raw

Hi Masahiro,

Quoted 3 lines · On Fri, 9 Sep 2022 19:30:24 +0900 Masahiro Yamada <[email protected]> wrote:

The following fix will make it working again.

diff --git a/Makefile b/Makefile

Quoted 11 lines

index b459e3d0fc5a..c8fba03ec93c 100644

Makefile +0 -1
@@ -1151,7 +1151,6 @@ quiet_cmd_autoksyms_h = GEN     $@
 $(autoksyms_h):
        $(call cmd,autoksyms_h)
 
-targets += vmlinux.o
 vmlinux.o: autoksyms_recursive $(KBUILD_VMLINUX_OBJS)

$(KBUILD_VMLINUX_LIBS) FORCE

        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.vmlinux_o

Thank you. The kbuild tree merge builds fine again.

Signature · 2 lines
Cheers,
Stephen Rothwell
#8 lore raw
Quoted 22 lines · Stephen Rothwell

Hi Masahiro,

Quoted 3 lines · On Fri, 9 Sep 2022 19:30:24 +0900 Masahiro Yamada <[email protected]> wrote:

The following fix will make it working again.

diff --git a/Makefile b/Makefile

Quoted 11 lines

index b459e3d0fc5a..c8fba03ec93c 100644

Makefile +0 -1
@@ -1151,7 +1151,6 @@ quiet_cmd_autoksyms_h = GEN     $@
 $(autoksyms_h):
        $(call cmd,autoksyms_h)
 
-targets += vmlinux.o
 vmlinux.o: autoksyms_recursive $(KBUILD_VMLINUX_OBJS)

$(KBUILD_VMLINUX_LIBS) FORCE

        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.vmlinux_o

Thank you. The kbuild tree merge builds fine again.

Quoted 3 lines

--
Cheers,
Stephen Rothwell

That is good news.

BTW, as you may have noticed already,
sub-directories are now listed in ./Kbuild.

So, you will need to move the rust/ entry accordingly.

obj-$(CONFIG_IO_URING)  += io_uring/
obj-$(CONFIG_RUST)      += rust/              <--- Move from Makefile
obj-y                   += drivers/

I have not tested the merge result, though.

--
Best Regards
Masahiro Yamada

#9 lore raw

Hi Masahiro,

Quoted 5 lines · On Mon, 12 Sep 2022 14:06:01 +0900 Masahiro Yamada <[email protected]> wrote:

BTW, as you may have noticed already,
sub-directories are now listed in ./Kbuild.

Quoted 7 lines

So, you will need to move the rust/ entry accordingly.

obj-$(CONFIG_IO_URING)  += io_uring/
obj-$(CONFIG_RUST)      += rust/              <--- Move from Makefile
obj-y                   += drivers/

I have not tested the merge result, though.

Thanks for the heads up.

Signature · 2 lines
Cheers,
Stephen Rothwell
#10 lore raw
In reply to Masahiro Yamada

Hi,

Quoted 11 lines · On Fri, 9 Sep 2022 15:48:55 +0900 Masahiro Yamada <[email protected]> wrote:
Quoted 8 lines
$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../obj -j15 -O
make[1]: Entering directory '/home/sfr/kernels/obj'
  GEN     Makefile
make[1]: Leaving directory '/home/sfr/kernels/obj'
make[1]: Entering directory '/home/sfr/kernels/obj'
  UPD     include/generated/compile.h
make[1]: Leaving directory '/home/sfr/kernels/obj'  

Weird 'Entering/Leaving directory' logs.

That is because I pass -O to make.

Without -O, I get:

$ make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=../obj -j15
make[1]: Entering directory '/home/sfr/kernels/obj'
  GEN     Makefile
  DESCEND objtool
make[2]: *** No rule to make target 'objtool/objtool'.  Stop.
make[1]: *** [/home/sfr/kernels/test/Makefile:1351: tools/objtool/objtool] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/sfr/kernels/obj'
make: *** [Makefile:222: __sub-make] Error 2
Signature · 2 lines
Cheers,
Stephen Rothwell