On Mon, Feb  5, 2007 at 01:39:34 +0100, Julien Cristau wrote:

> Indeed, this is a regression from the transition to modular X, the code
> implementing a fallback from vm86 to x86emu isn't getting built.
> In hw/xfree86/os-support/linux/int10/linux.c, this code is dependent on
> the DoSubModules macro, which is never set.

Actually, looking at xfree86 build logs, this wasn't set either.  On
i386, we built two versions of libint10.a:
- one containing the x86emu code, installed as
  /usr/X11R6/lib/modules/libint10.a
- one containing the vm86 code, installed as
  /usr/X11R6/lib/modules/linux/libint10.a
I don't know how the module loader managed to load the right one at
runtime, though, and don't have an amd64 to test.

I'm working on a patch to build vm86 and x86emu as two separate modules,
int10 being a wrapper around them, which is pending testing with a 64bit
kernel.  This tries to replicate the behaviour I described in the
previous mail, based on the Imakefiles from X.Org 6.9.  I'll attach my
current WIP patch to this mail.  I tested a very similar patch against
1.2.0, and it successfully loaded the vm86 submodule on my i386.  I
don't have amd64 hardware, so this is still pending testing on amd64
with 32bit userland.
If anyone wants to test I can provide the 3 needed files which have to
be installed in /usr/lib/xorg/modules.

In addition to the Makefile.am changes, I also had to move the
declaration of "Int10Current" away from xf86int10.c, because that file
is built into the submodules, not the actual int10 module (see upstream
bug #7299).  Hopefully I didn't break int10 on other platforms in the
process...

Cheers,
Julien
Index: xorg-server/hw/xfree86/int10/Makefile.am
===================================================================
--- xorg-server.orig/hw/xfree86/int10/Makefile.am	2007-02-06 00:16:58.000000000 +0100
+++ xorg-server/hw/xfree86/int10/Makefile.am	2007-02-06 00:22:47.000000000 +0100
@@ -7,16 +7,42 @@
 libint10_la_LDFLAGS = -avoid-version
 
 if INT10_VM86
-AM_CFLAGS = -D_PC -D_VM86_LINUX $(XORG_CFLAGS) $(EXTRA_CFLAGS)
+module_LTLIBRARIES += libvm86.la libx86emu.la
+AM_CFLAGS = -D_PC $(XORG_CFLAGS) $(EXTRA_CFLAGS)
 INCLUDES = $(XORG_INCS)
+libint10_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_SYSV_IPC -DDoSubModules
 libint10_la_SOURCES = \
-	helper_exec.c \
-	helper_mem.c \
 	pci.c \
-	xf86int10.c \
 	xf86int10module.c \
-	$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c \
+	helper_mem.c \
 	$(srcdir)/../os-support/linux/int10/linux.c
+libvm86_la_LDFLAGS = -avoid-version
+libvm86_la_CPPFLAGS = \
+	$(AM_CPPFLAGS) \
+	-DMOD_NAME=vm86 \
+	-DHAVE_SYSV_IPC \
+	-DSHOW_ALL_DEVICES \
+	-D_VM86_LINUX
+libvm86_la_SOURCES = \
+	xf86int10module.c \
+	$(srcdir)/../os-support/linux/int10/vm86/linux_vm86.c \
+	helper_exec.c \
+	xf86int10.c
+libx86emu_la_LDFLAGS = -avoid-version
+libx86emu_la_CPPFLAGS = \
+	$(AM_CPPFLAGS) \
+	-DMOD_NAME=x86emu \
+	-DHAVE_SYSV_IPC \
+	-DSHOW_ALL_DEVICES \
+	-D_X86EMU \
+	-DNO_SYS_HEADERS \
+	-I$(srcdir)/../x86emu
+libx86emu_la_SOURCES = \
+	xf86int10module.c \
+	xf86x86emu.c \
+	helper_exec.c \
+	xf86int10.c \
+	x86emu.c
 endif
 
 if INT10_X86EMU
Index: xorg-server/hw/xfree86/int10/xf86int10.c
===================================================================
--- xorg-server.orig/hw/xfree86/int10/xf86int10.c	2007-02-06 00:23:05.000000000 +0100
+++ xorg-server/hw/xfree86/int10/xf86int10.c	2007-02-06 00:23:35.000000000 +0100
@@ -17,7 +17,7 @@
 
 #define REG pInt
 
-xf86Int10InfoPtr Int10Current = NULL;
+// xf86Int10InfoPtr Int10Current = NULL;
 
 static int int1A_handler(xf86Int10InfoPtr pInt);
 #ifndef _PC
Index: xorg-server/hw/xfree86/int10/helper_mem.c
===================================================================
--- xorg-server.orig/hw/xfree86/int10/helper_mem.c	2007-02-06 00:23:48.000000000 +0100
+++ xorg-server/hw/xfree86/int10/helper_mem.c	2007-02-06 00:24:15.000000000 +0100
@@ -23,6 +23,8 @@
 
 #define REG pInt
 
+xf86Int10InfoPtr Int10Current = NULL;
+
 typedef enum {
     OPT_NOINT10,
     OPT_INIT_PRIMARY,

Reply via email to