[uClibc]Building X

David Meggy david at techsol.ca
Wed May 1 17:40:40 UTC 2002


I'm having difficulties building Xfree86 4.2 against a uClibc
toolchain.  I applied two patches that I made against the X source, that
are below, and I get the following error when trying to link the Xserver

arm-linux-gcc -o Xfbdev -O2      -L../../exports/lib -L/usr/X11R6/lib
dix/libdix.a os/libos.a ../../exports/lib/libXau.a
../../exports/lib/libXdmcp.a  hw/kdrive/fbdev/libfbdev.a
miext/layer/liblayer.a hw/kdrive/libkdrive.a hw/kdrive/linux/liblinux.a
miext/shadow/libshadow.a render/librender.a randr/librandr.a fb/libfb.a
dix/libxpstubs.a mi/libmi.a Xext/libext.a
XTrap/libxtrap.a   render/librender.a randr/librandr.a
-L/usr/local/armdev/tools/gcc3-cross/arm-linux/lib
../../lib/font/libXfont.a dix/libxpstubs.a -lz -lm    		    
/usr/local/armdev/tools/gcc3-cross/arm-linux/lib/libc.so: undefined
reference to `main'

Now if I run:

arm-linux-objdump -d dix/libdix.a | grep main

I get

main.o:     file format elf32-littlearm
00000020 <main>:

So I know it is there.  Is there something I'm missing?

Dave





----The patches I applied

diff -urN xc-orig/config/cf/cross.def xc/config/cf/cross.def
--- xc-orig/config/cf/cross.def Thu Mar 29 18:15:17 2001
+++ xc/config/cf/cross.def      Tue Apr 30 17:23:40 2002
@@ -15,16 +15,18 @@
 #define StandardDefines        -Dlinux -D__arm__ -D_POSIX_SOURCE \
                                -D_BSD_SOURCE -D_GNU_SOURCE -DX_LOCALE
 #undef CcCmd
-#define StdIncDir /skiff/local/arm-linux/include
+/*#define StdIncDir /skiff/local/arm-linux/include*/
+#define StdIncDir
/usr/local/armdev/tools/gcc3-cross/arm-linux/sys-include
 #define PreIncDir 
 #undef PostIncDir
-#define PostIncDir /skiff/local/lib/gcc-lib/arm-linux/2.95.2/include
-#define CcCmd /skiff/local/bin/arm-linux-gcc
+/*#define PostIncDir /skiff/local/lib/gcc-lib/arm-linux/2.95.2/include*/
+#define PostIncDir
/usr/local/armdev/tools/gcc3-cross/lib/gcc-lib/arm-linux/3.0.4/include
+#define CcCmd arm-linux-gcc
 #undef CplusplusCmd
 #define HasCplusplus YES
-#define CplusplusCmd /skiff/local/bin/arm-linux-g++
+#define CplusplusCmd arm-linux-g++
 #define DoRanlibCmd YES
-#define RanlibCmd /skiff/local/bin/arm-linux-ranlib
+#define RanlibCmd arm-linux-ranlib
 #undef ExtraLoadFlags
 #define ExtraLoadFlags
 #define FbNoPixelAddrCode
@@ -32,7 +34,8 @@
 #define TermcapLibrary -ltermcap
 
 #undef LdPostLib
-#define LdPostLib      -L/skiff/local/arm-linux/lib
+/*#define LdPostLib    -L/skiff/local/arm-linux/lib*/
+#define LdPostLib      -L/usr/local/armdev/tools/gcc3-cross/arm-linux/lib
 
 #undef ExtensionOSDefines
 #define ExtensionOSDefines
diff -urN xc-orig/config/cf/host.def xc/config/cf/host.def
--- xc-orig/config/cf/host.def  Wed Dec 31 16:00:00 1969
+++ xc/config/cf/host.def       Tue Apr 30 17:23:27 2002
@@ -0,0 +1,32 @@
+/*
+ * This configuration file contains additional configuration needed
+ * to cross compile X for the Compaq iPAQ handheld computer.
+ * To use this, add the following to host.def:
+   #define KDriveXServer YES
+   #define XiPAQH3000Server YES
+ */
+
+#define XawI18nDefines         -DUSE_XWCHAR_STRING -DUSE_XMBTOWC
+#define ThreadedX               NO
+
+#define BuildDocs               NO
+
+#define KDriveXServer           YES
+#define KdriveServerExtraDefines -DITSY -DMAXSCREENS=1
+#define TinyXServer             YES
+#define CrossCompiling          YES
+#define TouchScreen             YES
+#define ItsyCompilerBug         YES
+#undef BuildRandR
+#define BuildRandR              YES
+#define BuildLBX                NO
+#define BuildXInputLib          YES
+#define ProjectRoot             /usr/X11R6
+#define Freetype2Dir            $(TOP)/extras/freetype2
+#define Freetype2LibDir         $(TOP)/exports/lib
+#define BuildXTrueType          YES
+#define BuildScreenSaverExt     YES
+#define BuildScreenSaverLibrary YES
+#define SharedLibXss            YES
+#define XfbdevServer            YES
+#define XipaqServer             NO
\ No newline at end of file
diff -urN xc-orig/config/cf/linux.cf xc/config/cf/linux.cf
--- xc-orig/config/cf/linux.cf  Tue Jan 15 13:22:31 2002
+++ xc/config/cf/linux.cf       Tue Apr 30 17:23:52 2002
@@ -210,9 +210,9 @@
                                -D_BSD_SOURCE -D_SVID_SOURCE \
                                LinuxAdditionalIncludes
LinuxGnuSourceDefines \
                                LinuxLocaleDefines
-# define XawI18nDefines                -DHAS_WCHAR_H -DHAS_WCTYPE_H
-DNO_WIDEC_H
+/*# define XawI18nDefines              -DHAS_WCHAR_H -DHAS_WCTYPE_H
-DNO_WIDEC_H*/
 # define HasPosixThreads       YES
-# define ThreadedX             YES
+/*# define ThreadedX           YES*/
 # define HasThreadSafeAPI      YES
 # define ThreadsLibraries      -lpthread
 # define SystemMTDefines       -D_REENTRANT
diff -urN xc-orig/lib/X11/Xlib.h xc/lib/X11/Xlib.h
--- xc-orig/lib/X11/Xlib.h      Fri Dec 14 11:54:08 2001
+++ xc/lib/X11/Xlib.h   Tue Apr 30 17:24:16 2002
@@ -87,6 +87,9 @@
 #endif
 #endif
 
+#define mbstowcs(a,b,c) _Xmbstowcs(a,b,c) /* *********** DAVE *********
*/
+
+
 /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
    November 2000. Its presence is indicated through the following
macro. */
 #define X_HAVE_UTF8_STRING 1






AND


diff -urN xc-orig/programs/Xserver/hw/kdrive/linux/ts.c
xc/programs/Xserver/hw/kdrive/linux/ts.c
--- xc-orig/programs/Xserver/hw/kdrive/linux/ts.c       Thu Dec  6
18:19:04 2001
+++ xc/programs/Xserver/hw/kdrive/linux/ts.c    Wed May  1 10:00:13 2002
@@ -33,17 +33,18 @@
 #include "kdrive.h"
 #include "Xpoll.h"
 #include <sys/ioctl.h>
-#if 1
-#include <linux/h3600_ts.h>    /* touch screen events */
-#else
-/* inline for non-arm debug builds */
+
+
 typedef struct {
-        unsigned short pressure;
-        unsigned short x;
-        unsigned short y;
-        unsigned short pad;    /* TODO TODO word boundary pad */
+         unsigned short          pressure;
+         unsigned short          x;
+         unsigned short          y;
+         unsigned short          pad;
+         struct timeval  stamp;
 } TS_EVENT;
-#endif
+
+
+
 
 static long lastx = 0, lasty = 0;
 int TsScreen;
@@ -79,56 +80,61 @@
     return tot;
 }
 
+
 void
 TsRead (int tsPort, void *closure)
 {
-    KdMouseInfo            *mi = closure;
-    int                    fd = (int) mi->driver;
-    TS_EVENT       event;
-    long           buf[3];
-    int                    n;
-    long           pressure;
-    long           x, y;
+    KdMouseInfo     *mi = closure;
+    int             fd = (int) mi->driver;
+    TS_EVENT        event;
+    long            buf[3];
+    int             n;
+    long            pressure;
+    long            x, y;
     unsigned long   flags;
     unsigned long   buttons;
 
     n = TsReadBytes (tsPort, (char *) &event, sizeof (event), sizeof
(event));
     if (n == sizeof (event))  
     {
-       if (event.pressure) 
-       {
-           /* 
-            * HACK ATTACK.  (static global variables used !)
-            * Here we test for the touch screen driver actually being on
the
-            * touch screen, if it is we send absolute coordinates. If
not,
-            * then we send delta's so that we can track the entire vga
screen.
-            */
-           if (TsScreen == TsFbdev) {
-               flags = KD_BUTTON_1;
-               x = event.x;
-               y = event.y;
-           } else {
-               flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
-               if ((lastx == 0) || (lasty == 0)) {
-                   x = 0;
-                   y = 0;
-               } else {
-                   x = event.x - lastx;
-                   y = event.y - lasty;
-               }
-               lastx = event.x;
-               lasty = event.y;
-           }
-       } else {
-           flags = KD_MOUSE_DELTA;
-           x = 0;
-           y = 0;
-           lastx = 0;
-           lasty = 0;
-       }
-       KdEnqueueMouseEvent (mi, flags, x, y);
+        if (event.pressure) 
+        {
+            /* 
+             * HACK ATTACK.  (static global variables used !)
+             * Here we test for the touch screen driver actually being on
the
+             * touch screen, if it is we send absolute coordinates. If
not,
+             * then we send delta's so that we can track the entire vga
screen.
+             */
+            if (TsScreen == TsFbdev) {
+                flags = KD_BUTTON_1;
+                x = event.x;
+                y = event.y;
+            } else {
+                flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
+                if ((lastx == 0) || (lasty == 0)) {
+                    x = 0;
+                    y = 0;
+                } else {
+                    x = event.x - lastx;
+                    y = event.y - lasty;
+                }
+
+                lastx = event.x;
+                lasty = event.y;
+            }
+        } else {
+            flags = KD_MOUSE_DELTA;
+            x = 0;
+            y = 0;
+            lastx = 0;
+            lasty = 0;
+        }
+        KdEnqueueMouseEvent (mi, flags, x, y);
     }
 }
+
+
+
 
 char   *TsNames[] = {
   "/dev/ts",   





More information about the uClibc mailing list