Why is linux.ko rebuild everytime?

Kostik Belousov kostikbel at gmail.com
Sat Mar 15 14:13:14 PDT 2008


On Sat, Mar 15, 2008 at 08:46:50AM +0000, Bjoern A. Zeeb wrote:
> Hi,
> 
> if I just do a make right after buildkernel finished successfully
> linux.ko is rebuild (even though nothing was touched).
> I have to admit I am doing make in obj/.../sys/KERNCONF/ but to
> my understanding that should not matter.
> 
> ...
> ===> linsysfs (all)
> ===> linux (all)
> ln -sf 
> /local/building/freebsd/obj/local/building/freebsd/RELENG_7/sys/DOPT/opt_apic.h opt_apic.h
> cc -c -O2 -fno-strict-aliasing -pipe -DCOMPAT_IA32 -DCOMPAT_LINUX32 
> -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -DHAVE_KERNEL_OPTION_HEADERS 
> -include 
> /local/building/freebsd/obj/local/building/freebsd/RELENG_7/sys/DOPT/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -g -fno-omit-frame-pointer -I/local/building/freebsd/obj/local/building/freebsd/RELENG_7/sys/DOPT -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions  @/amd64/amd64/genassym.c
> sh @/kern/genassym.sh genassym.o > assym.s
> cc -c -x assembler-with-cpp -DLOCORE -O2 -fno-strict-aliasing -pipe 
> -DCOMPAT_IA32 -DCOMPAT_LINUX32  -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc   
> -DHAVE_KERNEL_OPTION_HEADERS -include 
> /local/building/freebsd/obj/local/building/freebsd/RELENG_7/sys/DOPT/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -fno-omit-frame-pointer -I/local/building/freebsd/obj/local/building/freebsd/RELENG_7/sys/DOPT -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  /local/building/freebsd/RELENG_7/sys/modules/linux/../../amd64/linux32/linux32_support.s -o linux32_support.o
> as  -o assym.o assym.s
> ld  -d -warn-common -r -d -o linux.ko.debug linux32_locore.o 
> linux32_support.o linux32_dummy.o linux_emul.o linux_file.o linux_futex.o 
> linux_getcwd.o linux_ioctl.o linux_ipc.o linux32_machdep.o linux_mib.o 
> linux_misc.o linux_signal.o linux_socket.o linux_stats.o linux_sysctl.o 
> linux32_sysent.o linux32_sysvec.o linux_uid16.o linux_util.o linux_time.o 
> assym.o
> echo  linux_emul_path linux_get_osname linux_get_osrelease linux_ifname 
> linux_ioctl_register_handler linux_ioctl_unregister_handler > export_syms
> awk -f 
> /local/building/freebsd/RELENG_7/sys/modules/linux/../../conf/kmod_syms.awk 
> linux.ko.debug  export_syms | xargs -J% objcopy % linux.ko.debug
> objcopy --only-keep-debug linux.ko.debug linux.ko.symbols
> objcopy --strip-debug --add-gnu-debuglink=linux.ko.symbols linux.ko.debug 
> linux.ko
> ===> lmc (all)
> ...

I want to say first that I do not know why, and I am interesting myself
in the reason.

Some time ago I tried to understand this, but did not come to any conclusion.
The points I observed are below:
1. On i386, the acpi module (absent on the amd64) also often rebuilds
without obvious reason.
2. Both linux and acpi depend on the assym.s. It seems that these are the
only modules that depend on it. For instance, svr4 depends on svr4_genassym
and does not rebuild.

I did not saw anything obvious in the web of the rules to handle *assym.
BTW, it usually tends to stabilize after several remakes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20080315/1b2fc655/attachment.pgp


More information about the freebsd-current mailing list