Skip to contentSkip to conversation

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

DISCUSSION Stephen Rothwell 2 participants 4 messages Aug 26, 2021 – Aug 27, 2021 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

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

make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'.

Caused by commit

624a912f84bc ("kbuild: detect objtool changes correctly and remove .SECONDEXPANSION")

(at least, reverting that commit fixes it)

I use a separate object directory and, in this case, it is newly created.

A build with V=1 and -s removed (and no -j) gives this around the failure:

make -f /home/sfr/next/next/scripts/Makefile.build obj=scripts/mod make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'. Stop. make[1]: *** [/home/sfr/next/next/Makefile:1309: prepare0] Error 2

I have reverted that commit for today.

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

Hi all,

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

make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'.

Caused by commit

624a912f84bc ("kbuild: detect objtool changes correctly and remove .SECONDEXPANSION")

(at least, reverting that commit fixes it)

I use a separate object directory and, in this case, it is newly created.

A build with V=1 and -s removed (and no -j) gives this around the failure:

Quoted 8 lines

make -f /home/sfr/next/next/scripts/Makefile.build obj=scripts/mod make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'. Stop. make[1]: *** [/home/sfr/next/next/Makefile:1309: prepare0] Error 2

I have reverted that commit for today.
--
Cheers,
Stephen Rothwell

Hmm, it is strange.

I re-applied that commit based on today's linux-next (git cherry-pick 624a912f84bc)

allnoconfig built successfully.

My build log is as follows.

Can you tell the exact steps to reproduce the error?

masahiro@grover:~/ref/linux-next$ git log -2 --oneline
5046c6516ca2 (HEAD -> tmp) kbuild: detect objtool changes correctly
and remove .SECONDEXPANSION
88fac11862d3 (tag: next-20210826, origin/master, origin/HEAD) Add
linux-next specific files for 20210826
masahiro@grover:~/ref/linux-next$ rm -rf /tmp/foo
masahiro@grover:~/ref/linux-next$ make O=/tmp/foo  allnoconfig all
make[1]: Entering directory '/tmp/foo'
  GEN     Makefile
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
  GEN     Makefile
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_32.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_64.h
  SYSHDR  arch/x86/include/generated/uapi/asm/unistd_x32.h
  SYSTBL  arch/x86/include/generated/asm/syscalls_32.h
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/sorttable
  WRAP    arch/x86/include/generated/uapi/asm/bpf_perf_event.h
  WRAP    arch/x86/include/generated/uapi/asm/errno.h
  WRAP    arch/x86/include/generated/uapi/asm/fcntl.h
  WRAP    arch/x86/include/generated/uapi/asm/ioctl.h
  WRAP    arch/x86/include/generated/uapi/asm/ioctls.h
  WRAP    arch/x86/include/generated/uapi/asm/ipcbuf.h
  WRAP    arch/x86/include/generated/uapi/asm/param.h
  WRAP    arch/x86/include/generated/uapi/asm/poll.h
  WRAP    arch/x86/include/generated/uapi/asm/resource.h
  WRAP    arch/x86/include/generated/uapi/asm/socket.h
  WRAP    arch/x86/include/generated/uapi/asm/sockios.h
  WRAP    arch/x86/include/generated/uapi/asm/termbits.h
  WRAP    arch/x86/include/generated/uapi/asm/termios.h
  WRAP    arch/x86/include/generated/uapi/asm/types.h
  WRAP    arch/x86/include/generated/asm/early_ioremap.h
  WRAP    arch/x86/include/generated/asm/export.h
  WRAP    arch/x86/include/generated/asm/mcs_spinlock.h
  WRAP    arch/x86/include/generated/asm/irq_regs.h
  WRAP    arch/x86/include/generated/asm/kmap_size.h
  WRAP    arch/x86/include/generated/asm/local64.h
  WRAP    arch/x86/include/generated/asm/mmiowb.h
  WRAP    arch/x86/include/generated/asm/module.lds.h
  WRAP    arch/x86/include/generated/asm/rwonce.h
  WRAP    arch/x86/include/generated/asm/unaligned.h
  UPD     include/config/kernel.release
  UPD     include/generated/uapi/linux/version.h
  UPD     include/generated/utsrelease.h
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  CC      scripts/mod/devicetable-offsets.s
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  UPD     include/generated/bounds.h
  UPD     include/generated/timeconst.h
  CC      arch/x86/kernel/asm-offsets.s
  UPD     include/generated/asm-offsets.h
  CALL    /home/masahiro/ref/linux-next/scripts/checksyscalls.sh
  CALL    /home/masahiro/ref/linux-next/scripts/atomic/check-atomics.sh
  CC      init/main.o
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  CC      init/do_mounts.o
  CC      init/noinitramfs.o
  CC      init/calibrate.o
  CC      init/init_task.o
  AR      init/built-in.a
  AR      usr/built-in.a
  CC      arch/x86/entry/vdso/vma.o
  CC      arch/x86/entry/vdso/extable.o
  CC      arch/x86/entry/vdso/vdso32-setup.o
  LDS     arch/x86/entry/vdso/vdso32/vdso32.lds
  AS      arch/x86/entry/vdso/vdso32/note.o
  AS      arch/x86/entry/vdso/vdso32/system_call.o
  AS      arch/x86/entry/vdso/vdso32/sigreturn.o
  CC      arch/x86/entry/vdso/vdso32/vclock_gettime.o
  VDSO    arch/x86/entry/vdso/vdso32.so.dbg
/home/masahiro/ref/linux-next/arch/x86/entry/vdso/Makefile:135: FORCE
prerequisite is missing
  OBJCOPY arch/x86/entry/vdso/vdso32.so
  HOSTCC  arch/x86/entry/vdso/vdso2c
  VDSO2C  arch/x86/entry/vdso/vdso-image-32.c
  CC      arch/x86/entry/vdso/vdso-image-32.o
  AR      arch/x86/entry/vdso/built-in.a

[snip]

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

Hi Masahiro,

Quoted 41 lines · On Fri, 27 Aug 2021 09:52:18 +0900 Masahiro Yamada <[email protected]> wrote:
Quoted 14 lines · Stephen Rothwell

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

make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'.

Caused by commit

624a912f84bc ("kbuild: detect objtool changes correctly and remove .SECONDEXPANSION")

(at least, reverting that commit fixes it)

I use a separate object directory and, in this case, it is newly created.

Quoted 8 lines

A build with V=1 and -s removed (and no -j) gives this around the failure:

make -f /home/sfr/next/next/scripts/Makefile.build obj=scripts/mod make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'. Stop. make[1]: *** [/home/sfr/next/next/Makefile:1309: prepare0] Error 2

I have reverted that commit for today.

Hmm, it is strange.

I re-applied that commit based on today's linux-next (git cherry-pick 624a912f84bc)

allnoconfig built successfully.

My build log is as follows.

Can you tell the exact steps to reproduce the error?

Quoted 7 lines
masahiro@grover:~/ref/linux-next$ git log -2 --oneline
5046c6516ca2 (HEAD -> tmp) kbuild: detect objtool changes correctly
and remove .SECONDEXPANSION
88fac11862d3 (tag: next-20210826, origin/master, origin/HEAD) Add
linux-next specific files for 20210826
masahiro@grover:~/ref/linux-next$ rm -rf /tmp/foo
masahiro@grover:~/ref/linux-next$ make O=/tmp/foo  allnoconfig all

I did more or less the same:

$ rm -rf ../x86_64_allnoconfig
$ mkdir ../x86_64_allnoconfig
$ make ARCH=x86_64 O=../x86_64_allnoconfig CROSS_COMPILE=x86_64-linux-gnu- allnoconfig
$ make V=1 ARCH=x86_64 O=../x86_64_allnoconfig CROSS_COMPILE=x86_64-linux-gnu- -O

I do cross builds hosted on a PowerPC LE host.

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

Hi Masahiro,

Quoted 41 lines · On Fri, 27 Aug 2021 09:52:18 +0900 Masahiro Yamada <[email protected]> wrote:
Quoted 14 lines · Stephen Rothwell

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

make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'.

Caused by commit

624a912f84bc ("kbuild: detect objtool changes correctly and remove .SECONDEXPANSION")

(at least, reverting that commit fixes it)

I use a separate object directory and, in this case, it is newly created.

Quoted 8 lines

A build with V=1 and -s removed (and no -j) gives this around the failure:

make -f /home/sfr/next/next/scripts/Makefile.build obj=scripts/mod make[2]: *** No rule to make target 'scripts/mod/empty.o', needed by '__build'. Stop. make[1]: *** [/home/sfr/next/next/Makefile:1309: prepare0] Error 2

I have reverted that commit for today.

Hmm, it is strange.

I re-applied that commit based on today's linux-next (git cherry-pick 624a912f84bc)

allnoconfig built successfully.

My build log is as follows.

Can you tell the exact steps to reproduce the error?

Quoted 7 lines
masahiro@grover:~/ref/linux-next$ git log -2 --oneline
5046c6516ca2 (HEAD -> tmp) kbuild: detect objtool changes correctly
and remove .SECONDEXPANSION
88fac11862d3 (tag: next-20210826, origin/master, origin/HEAD) Add
linux-next specific files for 20210826
masahiro@grover:~/ref/linux-next$ rm -rf /tmp/foo
masahiro@grover:~/ref/linux-next$ make O=/tmp/foo  allnoconfig all

I did more or less the same:

$ rm -rf ../x86_64_allnoconfig
$ mkdir ../x86_64_allnoconfig
$ make ARCH=x86_64 O=../x86_64_allnoconfig CROSS_COMPILE=x86_64-linux-gnu- allnoconfig
$ make V=1 ARCH=x86_64 O=../x86_64_allnoconfig CROSS_COMPILE=x86_64-linux-gnu- -O
Quoted 5 lines

I do cross builds hosted on a PowerPC LE host.

--
Cheers,
Stephen Rothwell

Ah, OK.
Now I understood what was happening.

scripts/mod/ is built before objtool, so
the dependency is not met.

I was previously not able to reproduce it because a stale objtool was remaining in my source tree. 'make clean' cannot clean up objtool.

I will fix it by tomorrow's linux-next.

Signature · 2 lines
Best Regards
Masahiro Yamada