Skip to contentSkip to conversation

2.4.0-prerelease drm and modversions

PATCH Michael Elizabeth Chastain 1 participant 1 message Jan 1, 2001

lore
Share & tools
lore
#0 lore raw

Keith Owens writes:
kaos> drivers/char/drm/Makefile is breaking the Makefile rules. It builds kaos> drmlib.a and expects to link that library into both the kernel and into kaos> modules.

Ah, shit.

kaos> The kernel makefile system assumes that everything is either kernel or kaos> module, not both. The components in drmlib.a get compiled for kernel kaos> only, when used in a module they are missing the symbol versions.

I agree with Keith.

The kernel version is going to get compiled, and then the module version is going to get compiled with different compilation flags: -DMODULE. The two versions are always going to fight.

kaos> +$(patsubst %.o,%.c,$(lib-objs-mod)):
kaos> + @ln -sf $(subst -mod,,$@) $@
kaos> +

This looks good to me. It's missing a dependency though. If foo-mod.c exists, and someone edits or patches foo.c, then foo-mod.c needs to be re-created.

Keith, what do you think of this:

  source-objs-mod := $(patsubst %-mod.o,%-mod.c,$(lib-objs-mod))
  $(source-objs-mod): $(patsubst %-mod.c,%.c,$(source-objs-mod))
    ln -sf $(patsubst %-mod.c,%.c,$@) $@

It suffers from the thundering herd problem (each *-mod.c depend on all *.c files) but I think it's correct.

Michael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/