xserver: Branch 'server-1.2-branch' - 3 commits

Adam Jackson ajax at kemper.freedesktop.org
Tue Jan 23 01:36:21 EET 2007


 GL/glx/glxdri.c              |    9 +++++----
 configure.ac                 |   21 +++++++--------------
 hw/xfree86/loader/dlloader.c |    4 ++++
 include/dix-config.h.in      |   12 ++----------
 os/utils.c                   |   18 +-----------------
 5 files changed, 19 insertions(+), 45 deletions(-)

New commits:
diff-tree fd838c02be3b3755efb872fd05a51fce99c46ae3 (from fd77f9cbbade5e2e4516c2d755425d07a90d1923)
Author: Adam Jackson <ajax at benzedrine.nwnk.net>
Date:   Mon Jan 22 17:58:37 2007 -0500

    Bug #9555: Always define _GNU_SOURCE in glibc environments.
    
    This keeps us from having to define _POSIX_C_SOURCE, _BSD_SOURCE, and
    _XOPEN_SORUCE to get the C environment we want in different places.  It also
    fixes the build on linux due to RTLD_DEFAULT having not been defined.
    (cherry picked from 7fccec91c46baac4f8d2965180dc535b4eb7d65c commit)

diff --git a/configure.ac b/configure.ac
index 4c29909..d72c74f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1599,20 +1599,13 @@ dnl and the rest of these are generic, s
 AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
 AC_DEFINE(XResExtension, 1, [Build XRes extension])
 
-dnl CYGWIN does not define fd_set if _POSIX_SOURCE is defined
-dnl _*_SOURCE on Solaris restricts to the standards, and removes non-standard
-dnl functions which X uses
-case $host_os in
-	cygwin*) ;;
-	solaris*) ;;
-        darwin*) ;;
-	freebsd*|netbsd*|openbsd*) ;;
-	*) 
-		AC_DEFINE(_POSIX_SOURCE, 1, [POSIX-compliant source])
-		AC_DEFINE(_XOPEN_SOURCE, 500, [X/Open-compliant source])
-		AC_DEFINE(_BSD_SOURCE, 1, [BSD-compliant source])
-		;;
-esac
+AC_TRY_COMPILE([
+#include <features.h>
+#ifndef __GLIBC__
+#error not glibc
+#endif
+], [], [AC_DEFINE(_GNU_SOURCE, 1,
+	[ Enable GNU and other extensions to the C environment for glibc])])
 
 AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
 
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 35700e4..5efd356 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -410,16 +410,8 @@
 /* Endian order */
 #undef X_BYTE_ORDER
 
-/* BSD-compliant source */
-#undef _BSD_SOURCE
-
-/* POSIX-compliant source */
-#undef _POSIX_SOURCE
-
-#ifndef _XOPEN_SOURCE
-/* X/Open-compliant source */
-#undef _XOPEN_SOURCE
-#endif
+/* Enable GNU and other extensions to the C environment for GLIBC */
+#undef _GNU_SOURCE
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
diff --git a/os/utils.c b/os/utils.c
index 9824501..7c725e3 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -53,23 +53,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
 #include <dix-config.h>
 #endif
 
-/* The world's most shocking hack, to ensure we get clock_gettime() and
- * CLOCK_MONOTONIC. */
-#ifdef sun              /* Needed to tell Solaris headers not to restrict to */
-#define __EXTENSIONS__  /* only the functions defined in POSIX 199309.       */
-#endif
-
-#ifdef _POSIX_C_SOURCE
-#define _SAVED_POSIX_C_SOURCE _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
-#endif
-#define _POSIX_C_SOURCE 199309L
-#include <time.h>
-#undef _POSIX_C_SOURCE
-#ifdef _SAVED_POSIX_C_SOURCE
-#define _POSIX_C_SOURCE _SAVED_POSIX_C_SOURCE
-#endif
-
 #ifdef __CYGWIN__
 #include <stdlib.h>
 #include <signal.h>
@@ -80,6 +63,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
 #endif
 #include <X11/Xos.h>
 #include <stdio.h>
+#include <time.h>
 #include "misc.h"
 #include <X11/X.h>
 #define XSERV_t
diff-tree fd77f9cbbade5e2e4516c2d755425d07a90d1923 (from cf7049352009fa013c6da8d21e2242bd2eccfa8f)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Dec 21 09:16:19 2006 -0800

    Try dlsym(RTLD_DEFAULT) first when finding symbols.
    
    The previous mechanism failed when finding drm symbols now that libdrm has
    moved to being linked by libdri instead of being linked into the server.
    (cherry picked from aab2ca204279b638c7e5bb6b8427c58be9704c57 commit)

diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c
index a0e8670..2afdef7 100644
--- a/hw/xfree86/loader/dlloader.c
+++ b/hw/xfree86/loader/dlloader.c
@@ -113,6 +113,10 @@ DLFindSymbol(const char *name)
     DLModuleList *l;
     void *p;
 
+    p = dlsym(RTLD_DEFAULT, name);
+    if (p != NULL)
+	return p;
+
     for (l = dlModuleList; l != NULL; l = l->next) {
         p = DLFindSymbolLocal(l->module, name);
 	if (p)
diff-tree cf7049352009fa013c6da8d21e2242bd2eccfa8f (from 6b23b12cc81916b3f66ba74f0fd2803aa87a027b)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Fri Jan 19 17:54:03 2007 +0100

    __glXDRIscreenProbe: Use drmOpen/CloseOnce.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=9275 . Based on patch from
    Alan Swanson.
    (cherry picked from 65f4690ecb4576f60396fcccff8e5bd5d4b6645f commit)

diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 170662c..e035704 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -864,6 +864,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     int api_ver = COPY_SUB_BUFFER_INTERNAL_VERSION;
     drm_magic_t magic;
     drmVersionPtr version;
+    int newlyopened;
     char *driverName;
     drm_handle_t  hFB;
     int        junk;
@@ -914,10 +915,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 	goto handle_error;
     }
 
-    fd = drmOpen(NULL, BusID);
+    fd = drmOpenOnce(NULL, BusID, &newlyopened);
 
     if (fd < 0) {
-	LogMessage(X_ERROR, "AIGLX error: drmOpen failed (%s)\n",
+	LogMessage(X_ERROR, "AIGLX error: drmOpenOnce failed (%s)\n",
 		   strerror(-fd));
 	goto handle_error;
     }
@@ -940,7 +941,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 	drm_version.patch = -1;
     }
 
-    if (!DRIAuthConnection(pScreen, magic)) {
+    if (newlyopened && !DRIAuthConnection(pScreen, magic)) {
 	LogMessage(X_ERROR, "AIGLX error: DRIAuthConnection failed\n");
 	goto handle_error;
     }
@@ -1082,7 +1083,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 	xfree(dev_priv);
 
     if (fd >= 0)
-	drmClose(fd);
+	drmCloseOnce(fd);
 
     DRICloseConnection(pScreen);
 



More information about the xorg-commit mailing list