And like many things on the web, it is wrong. Do not put anything in
the source code expect #include <linux/module.h> as the first include.
In particular do not include modversions.h yourself, it will break in
2.5. You compile a module with these gcc flags
(1) -DMODULE
(2) -DMODVERSIONS -include $(TOPDIR)/include/linux/modversions.h
(3) -DEXPORT_SYMTAB
All modules get flag (1).
All modules get flags (2) but only if .config contains
CONFIG_MODVERSIONS, otherwise omit these flags.
Only modules that export symbols get flag (3).
That is what the standard kernel Makefiles do and is the only correct
way to compile modules.
Keith Owens, kernel build and modutils maintainer.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/