Subject: Re: compiling x.org in 2.0H
To: Bill Russell Nicolas <nicolas_bill_os@yahoo.co.uk>
From: Nicolas Joly <njoly@pasteur.fr>
List: port-amd64
Date: 10/18/2004 13:55:18
--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Sun, Oct 17, 2004 at 10:43:25AM +0200, Nicolas Joly wrote:
> On Sun, Oct 17, 2004 at 07:31:07AM +0100, Bill Russell Nicolas wrote:
> > Hi everyone,
> >
> > I have problems compiling X.org under 2.0H/amd64. It
> > stops
> > in xorg-imake, displaying the following error message:
> >
> > gcc -O2 -ansi -Dasm=__asm GccWarningOptions
> > -I../../config/imake -I../../include
> > -I../../exports/include/X11 -I../../
> > -I../../exports/include -DCSRG_BASED -DFUNCPROTO=15
> > -DNARROWPROTO -c include.c
> >
> > gcc:GccWarningOptions: No such file or directory
>
> AFAIK, there is no support for NetBSD/amd64 in XOrg (and XFree86 CVS).
>
> Perhaps, we can extract a set of patches from our xsrc tree and give
> them back to both XFree86 and XOrg.
Can you try the following set of patches ?
--
Nicolas Joly
Biological Software and Databanks.
Institut Pasteur, Paris.
--2fHTh5uZTiUOsy+g
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="xorg-netbsdamd64.diff"
Index: config/cf/Imake.cf
===================================================================
RCS file: /cvs/xorg/xc/config/cf/Imake.cf,v
retrieving revision 1.4
diff -u -r1.4 Imake.cf
--- config/cf/Imake.cf 11 Aug 2004 21:14:01 -0000 1.4
+++ config/cf/Imake.cf 18 Oct 2004 11:51:02 -0000
@@ -246,6 +246,10 @@
# define PpcArchitecture
# undef __powerpc__
# endif
+# ifdef __x86_64__
+# define AMD64Architecture
+# undef __x86_64__
+# endif
#endif /* NetBSD */
/* Systems based on kernel of NetBSD */
Index: config/cf/NetBSD.cf
===================================================================
RCS file: /cvs/xorg/xc/config/cf/NetBSD.cf,v
retrieving revision 1.6
diff -u -r1.6 NetBSD.cf
--- config/cf/NetBSD.cf 15 Aug 2004 00:03:36 -0000 1.6
+++ config/cf/NetBSD.cf 18 Oct 2004 11:51:02 -0000
@@ -191,7 +191,7 @@
* Disabled for NetBSD/vax until I figure out the scheme. --CS
*/
#if ((OSMajorVersion > 0) && defined(i386Architecture)) || \
- defined(PpcArchitecture)
+ defined(PpcArchitecture) || defined(AMD64Architecture)
# ifndef DoLoadableServer
# define DoLoadableServer YES
# endif
@@ -236,11 +236,17 @@
# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
# elif defined(PpcArchitecture)
# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME -DDDXOSINIT
+# elif defined(AMD64Architecture)
+# undef OptimizedCDebugFlags
+# define OptimizedCDebugFlags -O2
+# define ServerOSDefines XFree86ServerOSDefines
# else
# define ServerOSDefines /**/
# endif
# if defined(AlphaArchitecture)
# define ServerExtraSysLibs -lalpha
+# elif defined(AMD64Architecture)
+# define ServerExtraSysLibs -lx86_64
# else
# define ServerExtraSysLibs /**/
# endif
@@ -280,11 +286,17 @@
# ifndef XFree86ConsoleDefines
# define XFree86ConsoleDefines -DWSCONS_SUPPORT
# endif
+#elif defined(AMD64Architecture)
+# define ServerExtraDefines GccGasOption XFree86ServerDefines -D_XSERVER64
+# ifndef XFree86ConsoleDefines
+# define XFree86ConsoleDefines -DWSCONS_SUPPORT -DPCVT_SUPPORT
+# endif
#else
# define ServerExtraDefines GccGasOption
#endif
#define StandardDefines -DCSRG_BASED
+
/* Citrus mb locale were added in 1.5P */
#if ((OSMajorVersion > 1) || \
(OSMajorVersion == 1 && OSMinorVersion > 5) || \
@@ -400,6 +412,10 @@
# endif /* MTRRBuiltin */
#endif /* i386Architecture */
+#if defined(AMD64Architecture)
+# define HasMTRRBuiltin YES
+#endif
+
/*
* agpgart support (NetBSD 1.5Y and up)
*/
@@ -588,7 +604,7 @@
# define BuildXInputLib YES
#endif
-#if defined(i386Architecture) || defined(Arm32Architecture) || defined(AlphaArchitecture) || defined(PpcArchitecture)
+#if defined(i386Architecture) || defined(Arm32Architecture) || defined(AlphaArchitecture) || defined(PpcArchitecture) || defined(AMD64Architecture)
# include <xorg.cf>
#endif
Index: programs/Xserver/hw/xfree86/loader/Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader/Imakefile,v
retrieving revision 1.7
diff -u -r1.7 Imakefile
--- programs/Xserver/hw/xfree86/loader/Imakefile 9 Oct 2004 16:22:58 -0000 1.7
+++ programs/Xserver/hw/xfree86/loader/Imakefile 18 Oct 2004 11:51:06 -0000
@@ -40,6 +40,10 @@
ARCHDEFINES = -DDoMMAPedMerge -DMmapPageAlign
#endif
+#if defined(NetBSDArchitecture) && defined(AMD64Architecture)
+ARCHDEFINES = -DUseMMAP
+#endif
+
DEFINES = $(DBMALLOCDEFINE) $(DLOPENDEFINES) $(OS_DEFINES) $(COMPAT_DEFINES) \
$(SHM_DEFINES) $(FONTCACHE_DEFINES) $(ARCHDEFINES)
Index: programs/Xserver/hw/xfree86/loader/loader.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/loader/loader.c,v
retrieving revision 1.3
diff -u -r1.3 loader.c
--- programs/Xserver/hw/xfree86/loader/loader.c 29 Aug 2004 21:06:00 -0000 1.3
+++ programs/Xserver/hw/xfree86/loader/loader.c 18 Oct 2004 11:51:07 -0000
@@ -472,6 +472,14 @@
#ifdef UseMMAP
unsigned long ret;
+# if defined(__NetBSD__) && defined(__amd64__)
+# define LOADER_MMAP_AREA_SIZE (256*1024*1024)
+# define LOADER_MMAP_AREA_START ((2U*1024*1024*1024) - LOADER_MMAP_AREA_SIZE)
+ static char *mm_addr = (char *)LOADER_MMAP_AREA_START;
+# else
+ char *mm_addr = NULL;
+# endif
+
# ifdef MmapPageAlign
unsigned long pagesize;
unsigned long new_size;
@@ -494,21 +502,31 @@
if ((new_off_bias + size) > new_size)
new_size += pagesize;
ret = (unsigned long)mmap(0, new_size, MMAP_PROT, MAP_PRIVATE
-# ifdef __amd64__
+# if defined(__amd64__) && !defined(__NetBSD__)
| MAP_32BIT
# endif
, fd, new_off);
if (ret == -1)
FatalError("mmap() failed: %s\n", strerror(errno));
+
+# if defined(__NetBSD__) && defined(__amd64__)
+ mm_addr += new_size;
+# endif
+
return (void *)(ret + new_off_bias);
# else
ret = (unsigned long)mmap(0, size, MMAP_PROT, MAP_PRIVATE
-# ifdef __amd64__
+# if defined(__amd64__) && !defined(__NetBSD__)
| MAP_32BIT
# endif
, fd, offset + offsetbias);
if (ret == -1)
FatalError("mmap() failed: %s\n", strerror(errno));
+
+# if defined(__NetBSD__) && defined(__amd64__)
+ mm_addr += (size + 4095) & ~4095;
+# endif
+
return (void *)ret;
# endif
#else
Index: programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile,v
retrieving revision 1.4
diff -u -r1.4 Imakefile
--- programs/Xserver/hw/xfree86/os-support/bsd/Imakefile 24 Jul 2004 16:32:39 -0000 1.4
+++ programs/Xserver/hw/xfree86/os-support/bsd/Imakefile 18 Oct 2004 11:51:07 -0000
@@ -114,7 +114,7 @@
KMODOBJ = kmod_noop.o
#endif
-#if defined(i386Architecture) || defined(ia64Architecture)
+#if defined(i386Architecture) || defined(ia64Architecture) || defined(AMD64Architecture)
RES_SRC=stdResource.c
RES_OBJ=stdResource.o
#else
Index: programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c,v
retrieving revision 1.3
diff -u -r1.3 i386_video.c
--- programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c 24 Jul 2004 16:32:39 -0000 1.3
+++ programs/Xserver/hw/xfree86/os-support/bsd/i386_video.c 18 Oct 2004 11:51:07 -0000
@@ -44,6 +44,11 @@
#include <machine/mtrr.h>
#include <machine/sysarch.h>
#include <sys/queue.h>
+#ifdef __x86_64__
+#define i386_set_mtrr x86_64_set_mtrr
+#define i386_get_mtrr x86_64_get_mtrr
+#define i386_iopl x86_64_iopl
+#endif
#endif
#if defined(__OpenBSD__) && defined(__amd64__)
--2fHTh5uZTiUOsy+g--