2002-06-17 12:36:41

by Mikael Pettersson

[permalink] [raw]
Subject: 2.5.22 broke modversions

Something in the 2.5.22 Makefile/Rule.make changes broke
modversions on my P4 box. For some reason, a number of
exporting objects, including arch/i386/kernel/i386_ksyms,
weren't given -D__GENKSYMS__ at genksym-time, with the
effect that the resulting .ver files became empty, and the
kernel exported the symbols with unexpanded _R__ver_ suffixes.

Modversions worked in 2.5.21. I didn't see anything obvious
in patch-2.5.22 what could explain this, but I did notice a
tendency of touching files as a means of maintaining dependencies.
This may not actually work, unless you have a slow CPU or a
file system with millisecond or better st_mtime resolution --
most only maintain whole-second resolution st_mtimes.
(My modversions fix in the 2.4.0-test series, which moved the
modversions.h creation/update to a separate rule after make dep,
was due to this very problem.)

For now, I'm using the workaround below.

/Mikael

--- linux-2.5.22/Rules.make.~1~ Mon Jun 17 10:15:13 2002
+++ linux-2.5.22/Rules.make Mon Jun 17 13:45:27 2002
@@ -147,7 +147,7 @@
quiet_cmd_cc_ver_c = MKVER include/linux/modules/$(RELDIR)/$*.ver
define cmd_cc_ver_c
mkdir -p $(dir $@); \
- $(CPP) $(c_flags) $< | $(GENKSYMS) $(genksyms_smp_prefix) \
+ $(CPP) $(c_flags) -D__GENKSYMS__ $< | $(GENKSYMS) $(genksyms_smp_prefix) \
-k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > [email protected]; \
if [ ! -r $@ ] || cmp -s $@ [email protected]; then \
touch $(TOPDIR)/include/linux/modversions.h; \


2002-06-17 14:30:21

by Kai Germaschewski

[permalink] [raw]
Subject: Re: 2.5.22 broke modversions

On Mon, 17 Jun 2002, Mikael Pettersson wrote:

> Something in the 2.5.22 Makefile/Rule.make changes broke
> modversions on my P4 box. For some reason, a number of
> exporting objects, including arch/i386/kernel/i386_ksyms,
> weren't given -D__GENKSYMS__ at genksym-time, with the
> effect that the resulting .ver files became empty, and the
> kernel exported the symbols with unexpanded _R__ver_ suffixes.

You're right, thanks for the report. The fix is appended ;)

> Modversions worked in 2.5.21. I didn't see anything obvious
> in patch-2.5.22 what could explain this, but I did notice a
> tendency of touching files as a means of maintaining dependencies.
> This may not actually work, unless you have a slow CPU or a
> file system with millisecond or better st_mtime resolution --
> most only maintain whole-second resolution st_mtimes.
> (My modversions fix in the 2.4.0-test series, which moved the
> modversions.h creation/update to a separate rule after make dep,
> was due to this very problem.)

I'm using touch in one place, as an optimization. For all I can see it
should be fine unless you run more than one complete build per second ;)

(Whenever a .ver file is updated, include/linux/modversions.h is touched,
so that during the build make only needs to check the timestamp
of modversions.h instead of all the individual .ver files - do you see a
problem with that?)

--Kai

===== Rules.make 1.59 vs edited =====
--- 1.59/Rules.make Mon Jun 10 21:59:33 2002
+++ edited/Rules.make Mon Jun 17 09:24:34 2002
@@ -131,9 +131,9 @@
genksyms_smp_prefix :=
endif

-$(MODVERDIR)/$(real-objs-y:.o=.ver): modkern_cflags := $(CFLAGS_KERNEL)
-$(MODVERDIR)/$(real-objs-m:.o=.ver): modkern_cflags := $(CFLAGS_MODULE)
-$(MODVERDIR)/$(export-objs:.o=.ver): export_flags := -D__GENKSYMS__
+$(addprefix $(MODVERDIR)/,$(real-objs-y:.o=.ver)): modkern_cflags := $(CFLAGS_KERNEL)
+$(addprefix $(MODVERDIR)/,$(real-objs-m:.o=.ver)): modkern_cflags := $(CFLAGS_MODULE)
+$(addprefix $(MODVERDIR)/,$(export-objs:.o=.ver)): export_flags := -D__GENKSYMS__

c_flags = -Wp,-MD,$(depfile) $(CFLAGS) $(NOSTDINC_FLAGS) \
$(modkern_cflags) $(EXTRA_CFLAGS) $(CFLAGS_$(*F).o) \

2002-06-17 14:46:30

by Martin Dalecki

[permalink] [raw]
Subject: Re: 2.5.22 broke modversions

U?ytkownik Kai Germaschewski napisa?:
> On Mon, 17 Jun 2002, Mikael Pettersson wrote:
>
>
>>Something in the 2.5.22 Makefile/Rule.make changes broke
>>modversions on my P4 box. For some reason, a number of
>>exporting objects, including arch/i386/kernel/i386_ksyms,
>>weren't given -D__GENKSYMS__ at genksym-time, with the
>>effect that the resulting .ver files became empty, and the
>>kernel exported the symbols with unexpanded _R__ver_ suffixes.
>
>
> You're right, thanks for the report. The fix is appended ;)

BTW> There is some different thing broken: TEMP files
used by make menuconfig don't get clean up even after make distclean.

2002-06-17 15:01:20

by Holzrichter, Bruce

[permalink] [raw]
Subject: RE: 2.5.22 broke modversions


> U?ytkownik Kai Germaschewski napisa?:
> > On Mon, 17 Jun 2002, Mikael Pettersson wrote:
> >
> >
> >>Something in the 2.5.22 Makefile/Rule.make changes broke
> >>modversions on my P4 box. For some reason, a number of
> >>exporting objects, including arch/i386/kernel/i386_ksyms,
> >>weren't given -D__GENKSYMS__ at genksym-time, with the
> >>effect that the resulting .ver files became empty, and the
> >>kernel exported the symbols with unexpanded _R__ver_ suffixes.
> >
> >
> > You're right, thanks for the report. The fix is appended ;)
>
> BTW> There is some different thing broken: TEMP files
> used by make menuconfig don't get clean up even after make distclean.
>
Is it just me? I am using linus bk version, and I don't see the Kernel
version updated in Makefile to 2.5.22?

B.

2002-06-17 15:30:29

by Kai Germaschewski

[permalink] [raw]
Subject: Re: 2.5.22 broke modversions

On Mon, 17 Jun 2002, Martin Dalecki wrote:

> BTW> There is some different thing broken: TEMP files
> used by make menuconfig don't get clean up even after make distclean.

Could you be more specific? The only file I can see lying around here
is .menuconfig.log, and that gets cleaned up.

--Kai


2002-06-17 15:39:51

by Martin Dalecki

[permalink] [raw]
Subject: Re: 2.5.22 broke modversions

U?ytkownik Kai Germaschewski napisa?:
> On Mon, 17 Jun 2002, Martin Dalecki wrote:
>
>
>>BTW> There is some different thing broken: TEMP files
>>used by make menuconfig don't get clean up even after make distclean.
>
>
> Could you be more specific? The only file I can see lying around here
> is .menuconfig.log, and that gets cleaned up.
>


Bjez probljemaw:

The following diff clutter appears in every diff after make menuconfig

diff -urN linux-2.5.21/scripts/lxdialog/.checklist.o.cmd
linux/scripts/lxdialog/.checklist.o.cmd
--- linux-2.5.21/scripts/lxdialog/.checklist.o.cmd 1970-01-01 0
diff -urN linux-2.5.21/scripts/lxdialog/.inputbox.o.cmd
linux/scripts/lxdialog/.inputbox.o.cmd
--- linux-2.5.21/scripts/lxdialog/.inputbox.o.cmd 1970-01-01 01:00:00.000000000 +0100
+++ linux/scripts/lxdialog/.inputbox.o.cmd 2002-06-13 12:50:06.000000000 +
diff -urN linux-2.5.21/scripts/lxdialog/.menubox.o.cmd
linux/scripts/lxdialog/.menubox.o.cmd
--- linux-2.5.21/scripts/lxdialog/.menubox.o.cmd 1970-01-01 01:00:00.000000000 +0100
+++ linux/scripts/lxdialog/.menubox.o.cmd 2002-06-13 12:50:04.000000000
diff -urN linux-2.5.21/scripts/lxdialog/.msgbox.o.cmd
linux/scripts/lxdialog/.msgbox.o.cmd
--- linux-2.5.21/scripts/lxdialog/.msgbox.o.cmd 1970-01-01 01:00:00.000000000 +0100
+++ linux/scripts/lxdialog/.msgbox.o.cmd 2002-06-13 12:50:07.000000000 3.1/include/stdbool.h \
+
diff -urN linux-2.5.21/scripts/lxdialog/.textbox.o.cmd
linux/scripts/lxdialog/.textbox.o.cmd
--- linux-2.5.21/scripts/lxdialog/.textbox.o.cmd 1970-01-01 01:00:00.000000000 +0100
+++ linux/scripts/lxdialog/.textbox.o.cmd 2002-06-13 12:50:05.000000000 +0200
@@ -0,0 +1,48 @@
+cmd_textbox.o := gcc -Wp,-MD,.textbox.o.d -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -DLOCALE -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"
-c -o textbox.o textbox.c

diff -urN linux-2.5.21/scripts/lxdialog/.yesno.o.cmd
linux/scripts/lxdialog/.yesno.o.cmd
--- linux-2.5.21/scripts/lxdialog/.yesno.o.cmd 1970-01-01 01:00:00.000000000 +0100
+++ linux/scripts/lxdialog/.yesno.o.cmd 2002-06-13 12:50:06.000000000 +0200
ude/stdbool.h \
+

2002-06-17 15:52:26

by Kai Germaschewski

[permalink] [raw]
Subject: Re: 2.5.22 broke modversions

On Mon, 17 Jun 2002, Martin Dalecki wrote:

> The following diff clutter appears in every diff after make menuconfig
>
> diff -urN linux-2.5.21/scripts/lxdialog/.checklist.o.cmd
> linux/scripts/lxdialog/.checklist.o.cmd
> [..]

Ah, okay. We don't remove .*.cmd in scripts/dialog on make clean, since
we want lxdialog to survive the make clean. Unfortunately, that means
we didn't remove those at all.

--Kai


===== Makefile 1.265 vs edited =====
--- 1.265/Makefile Mon Jun 17 10:26:40 2002
+++ edited/Makefile Mon Jun 17 10:49:48 2002
@@ -622,7 +622,8 @@

mrproper: clean archmrproper
@echo 'Making mrproper'
- @find . \( -size 0 -o -name .depend \) -type f -print | xargs rm -f
+ @find . \( -size 0 -o -name .depend -o -name .\*.cmd \) \
+ -type f -print | xargs rm -f
@rm -f $(MRPROPER_FILES)
@rm -rf $(MRPROPER_DIRS)
@$(MAKE) -C Documentation/DocBook mrproper

2002-06-17 19:29:38

by Mikael Pettersson

[permalink] [raw]
Subject: Re: 2.5.22 broke modversions

On Mon, 17 Jun 2002 09:30:13 -0500 (CDT), Kai Germaschewski wrote:
>> Something in the 2.5.22 Makefile/Rule.make changes broke
>> modversions on my P4 box. ...
>
>You're right, thanks for the report. The fix is appended ;)

Thanks. The fix worked fine for me.

>(Whenever a .ver file is updated, include/linux/modversions.h is touched,
> so that during the build make only needs to check the timestamp
> of modversions.h instead of all the individual .ver files - do you see a
> problem with that?)

Nope, that should be ok.

/Mikael