From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Masahiro Yamada <masahiroy@kernel.org>,
linux-kbuild@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Odd kbuild behaviour
Date: Thu, 11 Aug 2022 15:20:43 +0100 [thread overview]
Message-ID: <YvUQOwL6lD4/5/U6@shell.armlinux.org.uk> (raw)
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
If I re-run it without removing the generated object, I get:
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]: Nothing to be done for 'arch/arm/lib/findbit.o'.
make[1]: Leaving directory '/home/rmk/git/build/multi'
Note the "make[3]:" line, which ought not be there.
If I run make with V=1 in addition:
$ 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 V=1
make -C /home/rmk/git/build/multi -f /home/rmk/git/linux-rmk/Makefile arch/arm/lib/findbit.o
make[1]: Entering directory '/home/rmk/git/build/multi'
if [ -f /home/rmk/git/linux-rmk/.config -o \
-d /home/rmk/git/linux-rmk/include/config -o \
-d /home/rmk/git/linux-rmk/arch/arm/include/generated ]; then \
echo >&2 "***"; \
echo >&2 "*** The source tree is not clean, please run 'make ARCH=arm mrproper'"; \
echo >&2 "*** in /home/rmk/git/linux-rmk";\
echo >&2 "***"; \
false; \
fi
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=arch/arm/tools uapi
ln -fsn /home/rmk/git/linux-rmk source
{ echo "# Automatically generated by /home/rmk/git/linux-rmk/Makefile: don't edit"; echo "include /home/rmk/git/linux-rmk/Makefile"; } > Makefile
test -e .gitignore || \
{ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=scripts/basic
set -e; mkdir -p include/config/; trap "rm -f include/config/.kernel.release.tmp" EXIT; { echo "5.19.0$(sh /home/rmk/git/linux-rmk/scripts/setlocalversion /home/rmk/git/linux-rmk)"; } > include/config/.kernel.release.tmp; if [ ! -r include/config/kernel.release ] || ! cmp -s include/config/kernel.release include/config/.kernel.release.tmp; then : ' UPD include/config/kernel.release'; mv -f include/config/.kernel.release.tmp include/config/kernel.release; fi
make -f /home/rmk/git/linux-rmk/scripts/Makefile.asm-generic obj=arch/arm/include/generated/uapi/asm \
generic=include/uapi/asm-generic
set -e; mkdir -p include/generated/uapi/linux/; trap "rm -f include/generated/uapi/linux/.version.h.tmp" EXIT; { if [ 0 -gt 255 ]; then echo \#define LINUX_VERSION_CODE 332799; else echo \#define LINUX_VERSION_CODE 332544; fi; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))'; echo \#define LINUX_VERSION_MAJOR 5; echo \#define LINUX_VERSION_PATCHLEVEL 19; echo \#define LINUX_VERSION_SUBLEVEL 0; } > include/generated/uapi/linux/.version.h.tmp; if [ ! -r include/generated/uapi/linux/version.h ] || ! cmp -s include/generated/uapi/linux/version.h include/generated/uapi/linux/.version.h.tmp; then : ' UPD include/generated/uapi/linux/version.h'; mv -f include/generated/uapi/linux/.version.h.tmp include/generated/uapi/linux/version.h; fi
/home/rmk/git/linux-rmk/scripts/remove-stale-files
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=scripts/dtc
make -f /home/rmk/git/linux-rmk/scripts/Makefile.asm-generic obj=arch/arm/include/generated/asm \
generic=include/asm-generic
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=scripts
set -e; mkdir -p include/generated/; trap "rm -f include/generated/.utsrelease.h.tmp" EXIT; { if [ `echo -n "5.19.0+" | wc -c ` -gt 64 ]; then echo '"5.19.0+" exceeds 64 characters' >&2; exit 1; fi; echo \#define UTS_RELEASE \"5.19.0+\"; } > include/generated/.utsrelease.h.tmp; if [ ! -r include/generated/utsrelease.h ] || ! cmp -s include/generated/utsrelease.h include/generated/.utsrelease.h.tmp; then : ' UPD include/generated/utsrelease.h'; mv -f include/generated/.utsrelease.h.tmp include/generated/utsrelease.h; fi
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=arch/arm/tools kapi
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=scripts/mod
set -e; mkdir -p scripts/mod/; trap "rm -f scripts/mod/.devicetable-offsets.h.tmp" EXIT; { echo "#ifndef __DEVICETABLE_OFFSETS_H__"; echo "#define __DEVICETABLE_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < scripts/mod/devicetable-offsets.s; echo ""; echo "#endif"; } > scripts/mod/.devicetable-offsets.h.tmp; if [ ! -r scripts/mod/devicetable-offsets.h ] || ! cmp -s scripts/mod/devicetable-offsets.h scripts/mod/.devicetable-offsets.h.tmp; then : ' UPD scripts/mod/devicetable-offsets.h'; mv -f scripts/mod/.devicetable-offsets.h.tmp scripts/mod/devicetable-offsets.h; fi
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=.
set -e; mkdir -p include/generated/; trap "rm -f include/generated/.bounds.h.tmp" EXIT; { echo "#ifndef __LINUX_BOUNDS_H__"; echo "#define __LINUX_BOUNDS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < kernel/bounds.s; echo ""; echo "#endif"; } > include/generated/.bounds.h.tmp; if [ ! -r include/generated/bounds.h ] || ! cmp -s include/generated/bounds.h include/generated/.bounds.h.tmp; then : ' UPD include/generated/bounds.h'; mv -f include/generated/.bounds.h.tmp include/generated/bounds.h; fi
set -e; mkdir -p include/generated/; trap "rm -f include/generated/.timeconst.h.tmp" EXIT; { echo 250 | bc -q /home/rmk/git/linux-rmk/kernel/time/timeconst.bc; } > include/generated/.timeconst.h.tmp; if [ ! -r include/generated/timeconst.h ] || ! cmp -s include/generated/timeconst.h include/generated/.timeconst.h.tmp; then : ' UPD include/generated/timeconst.h'; mv -f include/generated/.timeconst.h.tmp include/generated/timeconst.h; fi
sh /home/rmk/git/linux-rmk/scripts/atomic/check-atomics.sh
set -e; mkdir -p include/generated/; trap "rm -f include/generated/.asm-offsets.h.tmp" EXIT; { echo "#ifndef __ASM_OFFSETS_H__"; echo "#define __ASM_OFFSETS_H__"; echo "/*"; echo " * DO NOT MODIFY."; echo " *"; echo " * This file was generated by Kbuild"; echo " */"; echo ""; sed -ne 's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; /^->/{s:->#\(.*\):/* \1 */:; s:^->\([^ ]*\) [\$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}' < arch/arm/kernel/asm-offsets.s; echo ""; echo "#endif"; } > include/generated/.asm-offsets.h.tmp; if [ ! -r include/generated/asm-offsets.h ] || ! cmp -s include/generated/asm-offsets.h include/generated/.asm-offsets.h.tmp; then : ' UPD include/generated/asm-offsets.h'; mv -f include/generated/.asm-offsets.h.tmp include/generated/asm-offsets.h; fi
sh /home/rmk/git/linux-rmk/scripts/checksyscalls.sh arm-linux-gnueabihf-gcc -Wp,-MMD,./.missing-syscalls.d -nostdinc -I/home/rmk/git/linux-rmk/arch/arm/include -I./arch/arm/include/generated -I/home/rmk/git/linux-rmk/include -I./include -I/home/rmk/git/linux-rmk/arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I/home/rmk/git/linux-rmk/include/uapi -I./include/generated/uapi -include /home/rmk/git/linux-rmk/include/linux/compiler-version.h -include /home/rmk/git/linux-rmk/include/linux/kconfig.h -include /home/rmk/git/linux-rmk/include/linux/compiler_types.h -D__KERNEL__ -mlittle-endian -fmacro-prefix-map=/home/rmk/git/linux-rmk/= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu11 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mfpu=vfp -funwind-tables -mtp=cp15 -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-address-of-packed-member -O2 -fno-allow-store-data-races -Wframe-larger-than=1024 -fno-stack-protector -Wimplicit-fallthrough=5 -Wno-main -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-stack-clash-protection -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -Wno-stringop-truncation -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -Wno-alloc-size-larger-than -fno-strict-overflow -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -Wno-packed-not-aligned -I /home/rmk/git/linux-rmk/. -I ./. -DKBUILD_MODFILE='"./missing-syscalls"' -DKBUILD_BASENAME='"missing_syscalls"' -DKBUILD_MODNAME='"missing_syscalls"' -D__KBUILD_MODNAME=kmod_missing_syscalls
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=arch/arm \
single-build=1 \
need-builtin=1 need-modorder=1
make -f /home/rmk/git/linux-rmk/scripts/Makefile.build obj=arch/arm/lib \
single-build=1 \
need-builtin=1 need-modorder=1
make -f /dev/null arch/arm/lib/findbit.o
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....
arm-linux-gnueabihf-gcc -Wp,-MMD,arch/arm/lib/.findbit.o.d -nostdinc -I/home/rmk/git/linux-rmk/arch/arm/include -I./arch/arm/include/generated -I/home/rmk/git/linux-rmk/include -I./include -I/home/rmk/git/linux-rmk/arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I/home/rmk/git/linux-rmk/include/uapi -I./include/generated/uapi -include /home/rmk/git/linux-rmk/include/linux/compiler-version.h -include /home/rmk/git/linux-rmk/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -fmacro-prefix-map=/home/rmk/git/linux-rmk/= -D__ASSEMBLY__ -fno-PIE -mabi=aapcs-linux -mfpu=vfp -funwind-tables -mtp=cp15 -marm -Wa,-mno-warn-deprecated -D__LINUX_ARM_ARCH__=7 -march=armv7-a -include asm/unified.h -msoft-float -I /home/rmk/git/linux-rmk/arch/arm/lib -I ./arch/arm/lib -c -o arch/arm/lib/findbit.o /home/rmk/git/linux-rmk/arch/arm/lib/findbit.S
/home/rmk/git/linux-rmk/scripts/check-local-export arch/arm/lib/findbit.o
make[1]: Leaving directory '/home/rmk/git/build/multi'
make: *** [Makefile:219: __sub-make] Error 2
Clearly, kbuild knows how to do this, because it issued the appropriate
command to create the object file!
If I don't use -j2, then make fails at the error without building
findbit.o.
Mike Rapport reports similar issues to me, so it seems it's not just me
encountering this problem.
Any ideas why the kbuild infrastructure thinks it can't build a .o from
a .S file?
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-08-11 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 14:20 Russell King (Oracle) [this message]
2022-08-11 14:30 ` Odd kbuild behaviour Mark Rutland
2022-08-12 2:57 ` Masahiro Yamada
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=YvUQOwL6lD4/5/U6@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=masahiroy@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