Skip to contentSkip to conversation

Build errors caused by modalias generation patch

DISCUSSION Ralf Baechle 3 participants 6 messages May 6, 2013 – May 7, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Andreas,

doing builds of all MIPS defconfigs I observed a fair number of them were failing to build with errors like these:

cobalt_defconfig:

CC [M] drivers/hid/usbhid/hid-quirks.o
LD [M] drivers/hid/usbhid/usbhid.o
FATAL: drivers/hid/usbhid/usbhid: sizeof(struct usb_device_id)=32 is not a modulo of the size of section __mod_usb_device_table=48. Fix definition of struct usb_device_id in mod_devicetable.h
make[5]: *** [drivers/hid/usbhid/usbhid.o] Error 1

gpr_defconfig:

LD [M] drivers/atm/fore_200e.o
FATAL: drivers/atm/fore_200e: sizeof(struct pci_device_id)=32 is not a modulo of the size of section __mod_pci_device_table=56. Fix definition of struct pci_device_id in mod_devicetable.h
make[4]: *** [drivers/atm/fore_200e.o] Error 1

jazz_defconfig:

Building modules, stage 2.
MODPOST 355 modules
FATAL: drivers/block/floppy: sizeof(struct pnp_device_id)=16 is not a modulo of the size of section __mod_pnp_device_table=24. Fix definition of struct pnp_device_id in mod_devicetable.h
make[3]: *** [__modpost] Error 1

malta_defconfig:

LD [M] drivers/net/ethernet/chelsio/cxgb3/cxgb3.o
FATAL: drivers/net/ethernet/chelsio/cxgb3/cxgb3: sizeof(struct pci_device_id)=32 is not a modulo of the size of section __mod_pci_device_table=392. Fix definition of struct pci_device_id in mod_devicetable.h
make[7]: *** [drivers/net/ethernet/chelsio/cxgb3/cxgb3.o] Error 1
make[6]: *** [drivers/net/ethernet/chelsio/cxgb3] Error 2
make[5]: *** [drivers/net/ethernet/chelsio] Error 2

etc.

I can reproduce the issue can only building with a separate object directory.

Reverting 6543becf26fff612cdadeed7250ccc8d49f67f27 [mod/file2alias: make modalias generation safe for cross compiling] fixes these for me.

Ralf

#3 lore raw
Quoted 6 lines · Ralf Baechle
Quoted 2 lines · Andreas Schwab

Please try the patch in
<http://marc.info/?l=linux-kbuild&m=136767800809256&w=2>.

No change in observed behaviour. I did all my builds in empty object directories so I don't see why this patch would make any difference.

I'm getting this in an ia64 build (don't ask me why I build for itanic ;-):

FATAL: drivers/acpi/button: sizeof(struct acpi_device_id)=14 is not a modulo of the size of section __mod_acpi_device_table=144. Fix definition of struct acpi_device_id in mod_devicetable.h

This is next-20130501, with or without Andreas' fix.

It works in my development tree based on yesterday's mainline (d7ab7302f970a254997687a1cdede421a5635c68).

I'll try today's linux-next, and will bisect if I find time...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#4 lore raw
Quoted 14 lines · Geert Uytterhoeven
Quoted 6 lines · Ralf Baechle
Quoted 2 lines · Andreas Schwab

Please try the patch in
<http://marc.info/?l=linux-kbuild&m=136767800809256&w=2>.

No change in observed behaviour. I did all my builds in empty object directories so I don't see why this patch would make any difference.

I'm getting this in an ia64 build (don't ask me why I build for itanic ;-):

FATAL: drivers/acpi/button: sizeof(struct acpi_device_id)=14 is not a modulo of the size of section __mod_acpi_device_table=144. Fix definition of struct acpi_device_id in mod_devicetable.h

Quoted 6 lines

This is next-20130501, with or without Andreas' fix.

It works in my development tree based on yesterday's mainline (d7ab7302f970a254997687a1cdede421a5635c68).

I'll try today's linux-next, and will bisect if I find time...

This was also caused by a leftover scripts/mod/devicetable-offsets.h in the source tree.

Andreas' fix works (sort of, read on), but only if you run "make mrproper" _after_ applying it.

Still, if you have other leftovers from a previous build in the source tree, you get:

Using /scratch/geert/linux/linux-next as source for kernel /scratch/geert/linux/linux-next is not clean, please run 'make mrproper' in the '/scratch/geert/linux/linux-next' directory.

However, you don't get that message if there's still a stale scripts/mod/devicetable-offsets.h in the source tree. Any idea how to fix that?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw
In reply to Ralf Baechle
Quoted 6 lines · Ralf Baechle

cobalt_defconfig:

CC [M] drivers/hid/usbhid/hid-quirks.o
LD [M] drivers/hid/usbhid/usbhid.o
FATAL: drivers/hid/usbhid/usbhid: sizeof(struct usb_device_id)=32 is not a modulo of the size of section __mod_usb_device_table=48. Fix definition of struct usb_device_id in mod_devicetable.h

What are the contents of devicetable-offsets.[sh]?

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."