linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: J Sloan <jjs@pobox.com>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	dri-devel@lists.sourceforge.net, torvalds@transmeta.com
Subject: [patch] 2.4.0-prerelease drm and modversions
Date: Mon, 01 Jan 2001 15:59:08 +1100	[thread overview]
Message-ID: <3866.978325148@ocs3.ocs-net> (raw)
In-Reply-To: Your message of "Sun, 31 Dec 2000 14:38:16 -0800." <3A4FB558.688EFE01@pobox.com>

On Sun, 31 Dec 2000 14:38:16 -0800, 
J Sloan <jjs@pobox.com> wrote:
>Looks good here in most respects, but still needs makefile fixes -
>
># modprobe tdfx
>/lib/modules/2.4.0-prerelease/kernel/drivers/char/drm/tdfx.o: unresolved
>symbol remap_page_range
>.... etc, etc
>
>Of course, adding
>
>#include <linux/modversions.h>
>
>to drivers/char/drm/drmP.h makes it all work....

Wrong fix.

drivers/char/drm/Makefile is breaking the Makefile rules.  It builds
drmlib.a and expects to link that library into both the kernel and into
modules.  The kernel makefile system assumes that everything is either
kernel or module, not both.  The components in drmlib.a get compiled
for kernel only, when used in a module they are missing the symbol
versions.

The ability to link into both kernel and modules will be available in
the 2.5 Makefile redesign (already in progress) but this bandaid will
fix 2.4.  It is still fragile, if you change a drm driver from module
to built in or vice versa then you have to manually remove the old drm
driver first, but few people will do that (I hope).

The bandaid is to generate two copies of drmlib from the same C
sources, one for kernel and one for modules.

Index: 0-prerelease.1/drivers/char/drm/Makefile
--- 0-prerelease.1/drivers/char/drm/Makefile Sat, 16 Dec 2000 15:22:55 +1100 kaos (linux-2.4/I/b/2_Makefile 1.1.1.6 644)
+++ 0-prerelease.1(w)/drivers/char/drm/Makefile Mon, 01 Jan 2001 15:56:48 +1100 kaos (linux-2.4/I/b/2_Makefile 1.1.1.6 644)
@@ -55,13 +55,23 @@ obj-$(CONFIG_DRM_I810)  += i810.o
 # When linking into the kernel, link the library just once. 
 # If making modules, we include the library into each module
 
+lib-objs-mod := $(patsubst %.o,%-mod.o,$(lib-objs))
+obj-m += $(lib-objs-mod)
+
 ifdef MAKING_MODULES
-  lib = drmlib.a
+  lib = drmlib-mod.a
 else
   obj-y += drmlib.a
 endif
 
 include $(TOPDIR)/Rules.make
+
+$(patsubst %.o,%.c,$(lib-objs-mod)): 
+	@ln -sf $(subst -mod,,$@) $@
+
+drmlib-mod.a: $(lib-objs-mod)
+	rm -f $@
+	$(AR) $(EXTRA_ARFLAGS) rcs $@ $(lib-objs-mod)
 
 drmlib.a: $(lib-objs)
 	rm -f $@
Index: 0-prerelease.1/Makefile
--- 0-prerelease.1/Makefile Mon, 01 Jan 2001 14:23:43 +1100 kaos (linux-2.4/B/c/27_Makefile 1.1.2.2.2.4.1.7.1.3.1.5.2.5.2.2.1.6.1.10 644)
+++ 0-prerelease.1(w)/Makefile Mon, 01 Jan 2001 15:47:10 +1100 kaos (linux-2.4/B/c/27_Makefile 1.1.2.2.2.4.1.7.1.3.1.5.2.5.2.2.1.6.1.10 644)
@@ -188,6 +188,7 @@ CLEAN_FILES = \
 	.tmp* \
 	drivers/char/consolemap_deftbl.c drivers/video/promcon_tbl.c \
 	drivers/char/conmakehash \
+	drivers/char/drm/*-mod.c \
 	drivers/pci/devlist.h drivers/pci/classlist.h drivers/pci/gen-devlist \
 	drivers/zorro/devlist.h drivers/zorro/gen-devlist \
 	drivers/sound/bin2hex drivers/sound/hex2hex \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-01  5:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-31 22:38 2.4.0-prerelease J Sloan
2001-01-01  0:16 ` 2.4.0-prerelease Tom Rini
2001-01-01  4:59 ` Keith Owens [this message]
2001-01-01  7:35 [patch] 2.4.0-prerelease drm and modversions Michael Elizabeth Chastain
2001-01-01  7:38 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3866.978325148@ocs3.ocs-net \
    --to=kaos@ocs.com.au \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dri-devel@lists.sourceforge.net \
    --cc=jjs@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).