Odd kbuild behaviour

Mark Rutland mark.rutland at arm.com
Thu Aug 11 07:30:50 PDT 2022


On Thu, Aug 11, 2022 at 03:20:43PM +0100, Russell King (Oracle) wrote:
> Hi,
> 
> Please can someone try to explain what is going on when I ask for a .S
> file to be built to an object with 5.19 and GNU make 4.3 from Debian
> Bullseye (although I don't think this is a make version issue):
> 
> $ rm ../build/multi/arch/arm/lib/findbit.o
> $ make -j2 CROSS_COMPILE="arm-linux-gnueabihf-" ARCH="arm" O=../build/multi arch/arm/lib/findbit.o
> make[1]: Entering directory '/home/rmk/git/build/multi'
>   GEN     Makefile
>   CALL    /home/rmk/git/linux-rmk/scripts/atomic/check-atomics.sh
>   CALL    /home/rmk/git/linux-rmk/scripts/checksyscalls.sh
> make[3]: *** No rule to make target 'arch/arm/lib/findbit.o'.  Stop.
> make[2]: *** [/home/rmk/git/linux-rmk/scripts/Makefile.build:441: __build] Error 2
> make[1]: *** [/home/rmk/git/linux-rmk/Makefile:1843: arch/arm] Error 2
> make[1]: *** Waiting for unfinished jobs....
>   AS      arch/arm/lib/findbit.o
> make[1]: Leaving directory '/home/rmk/git/build/multi'
> make: *** [Makefile:219: __sub-make] Error 2

FWIW, I think this is to do with lib-y directories rather than wheether the
object is C or assembly:

[mark at lakrids:~/src/linux]% ls arch/arm64/lib 
clear_page.S  copy_from_user.S  copy_template.S  crc32.S  delay.c         insn.c           Makefile  memcmp.S  memset.S  strchr.S  strlen.S   strnlen.S  tishift.S             xor-neon.c
clear_user.S  copy_page.S       copy_to_user.S   csum.c   error-inject.c  kasan_sw_tags.S  memchr.S  memcpy.S  mte.S     strcmp.S  strncmp.S  strrchr.S  uaccess_flushcache.c
[mark at lakrids:~/src/linux]% usekorg 12.1.0 make ARCH=arm64 CROSS_COMPILE=aarch64-linux- arch/arm64/lib/insn.o
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
make[2]: *** No rule to make target 'arch/arm64/lib/insn.o'.  Stop.
make[1]: *** [scripts/Makefile.build:441: __build] Error 2
make: *** [Makefile:1844: arch/arm64] Error 2
[mark at lakrids:~/src/linux]% usekorg 12.1.0 make ARCH=arm64 CROSS_COMPILE=aarch64-linux- arch/arm64/lib/copy_page.o
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
make[2]: *** No rule to make target 'arch/arm64/lib/copy_page.o'.  Stop.
make[1]: *** [scripts/Makefile.build:441: __build] Error 2
make: *** [Makefile:1844: arch/arm64] Error 2
[mark at lakrids:~/src/linux]% usekorg 12.1.0 make ARCH=arm64 CROSS_COMPILE=aarch64-linux- arch/arm64/lib            
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  AS      arch/arm64/lib/clear_page.o
  AS      arch/arm64/lib/clear_user.o
  AS      arch/arm64/lib/copy_from_user.o
  AS      arch/arm64/lib/copy_page.o
  AS      arch/arm64/lib/copy_to_user.o
  CC      arch/arm64/lib/csum.o
  CC      arch/arm64/lib/delay.o
  CC      arch/arm64/lib/insn.o
  AS      arch/arm64/lib/memchr.o
  AS      arch/arm64/lib/memcmp.o
  AS      arch/arm64/lib/memcpy.o
  AS      arch/arm64/lib/memset.o
  AS      arch/arm64/lib/strchr.o
  AS      arch/arm64/lib/strcmp.o
  AS      arch/arm64/lib/strlen.o
  AS      arch/arm64/lib/strncmp.o
  AS      arch/arm64/lib/strnlen.o
  AS      arch/arm64/lib/strrchr.o
  AS      arch/arm64/lib/tishift.o
  AR      arch/arm64/lib/lib.a
  AS      arch/arm64/lib/crc32.o
  AS      arch/arm64/lib/mte.o
  AR      arch/arm64/lib/built-in.a


... clearly it figures how to build the directory as a whole, but can't figure
out how to build indiviual objects within that.

Thanks,
Mark



More information about the linux-arm-kernel mailing list