[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hurd-i386 updates



On Mon, Jul 12, 2004 at 02:04:34AM +0200, Michael Banck wrote:
> Hello,
> 
> I've brought the hurd-i386 port of xfree86 back on track.

Outstanding!  Thank you!

> Initially, I took the xfree86-4.3.0.dfsg.1-4 source package and the
> k*BSD patch from
> http://glibc-bsd.alioth.debian.org/patches/xfree86_4.3.0.dfsg.1-4.diff I
> needed to tweak a couple of .install files to .install.hurd-i386 and fix
> a parse error in xc/programs/xterm/xterm_io.h or similar introduced in
> the k*BSD patch but that was it.

Okay.  This xterm_io.h problem is not present in the stock XFree86
packages, though?

> The resulting packages are up at the ftp.gnuab.org repository and they
> work well on my Radeon7500 with the ati driver.

Cool.

> However, the k*BSD patches are pretty big and Robert Millan apparently
> wants to get them applied upstream, which seems works quite well. On the
> other hand, the hurd-i386 needs updated xfree86 packages on
> ftp.debian.org ASAP to continue the development effort. Thus, I've just
> updated the 80* series of patches to make xfree86 build and install on
> hurd-i386. The attached file xfree86_gnu_patches.diff contains those.

Okay.

> In order to have a clear look at the differences between linux.cf and
> gnu.cf, I shuffled gnu.cf around and reformatted some parts, in order to
> sync the two and make the diff somewhat easy to read.

Yes, that was badly needed.  Thanks!

> The main questions are the following defines, which were missing in
> gnu.cf (diff from linux.cf to gnu.cf):
> 
> -#  define StaticNeedsPicForShared      NO
> -#  define KernelVersionInBanner        YES
> 
> Should we have those? What is the default for the first? I did not add
> them for now.

StaticNeedsPicForShared is upstream's solution to the notorious
PIC-symbols-in-static-libraries problem[1][2].  What upstream does is, for
some architectures, stuff the PIC symbols into the ordinary static library
.a files.  As noted in the Debian section of linux.cf, we don't use this
approach.  What we do is always leave the PIC information out of static
libraries, and provide _pic.a versions of static libraries (in
xlibs-static-pic) for applications that "need" to dlopen() a statically
linked object.

I would #define StaticNeedsPicForShared NO for the Hurd, assuming your
packages are going to be pretty congruent with the Linux ones.

KernelVersionInBanner: this is a thing used only by the XFree86 X server.
This symbol leads us to xc/programs/Xserver/hw/xfree86/common/Imakefile,
where we see that it passes the flag -DXF86_KERNEL_VER_IN_BANNER to the
compiler when building xc/programs/Xserver/hw/xfree86/common/xf86Init.c.

Checking that file, we find the following:

    69  #ifdef XF86_KERNEL_VER_IN_BANNER
    70  static void xf86PrintOSKernelString(void);
    71  #endif
[...]
   122  #ifdef XF86_KERNEL_VER_IN_BANNER
   123  /* The following function is an "ugly hack". mharris told me to say so. */
   124  #define KVERMAXBUF 1024
   125  static void
   126  xf86PrintOSKernelString(void)
   127  {
   128    int tainted = -1;
   129    char *buf;
   130    FILE *infile;
   131
   132    if ((buf = (char *) calloc(1, KVERMAXBUF)) != NULL)
   133    {
   134      if ((infile = fopen("/proc/sys/kernel/tainted", "r")) != NULL)
   135      {
   136         fgets(buf, KVERMAXBUF, infile);
   137         fclose(infile);
   138         tainted = atoi(buf);
   139       }
   140       if ((infile = fopen("/proc/version", "r")) != NULL)
   141       {
   142         if (fgets(buf, KVERMAXBUF, infile) == NULL)
   143           sprintf(buf, "(unable to determine)");
   144         else
   145           buf[strlen(buf) - 1] = '\0';
   146         fclose(infile);
   147        }
   148    }
   149    ErrorF("OS Kernel: %s %s%s\n", buf, (tainted & 0x01) ? "T" : "",
   150                                        (tainted & 0x02) ? "F" : "");
   151    free(buf);
   152  }
   153  #endif
[...]
  1690  static void
  1691  xf86PrintBanner()
  1692  {
[...]
  1741  #ifdef XF86_KERNEL_VER_IN_BANNER
  1742    xf86PrintOSKernelString();
  1743  #endif
  1744  }

Given that I don't expect the Hurd to support Linux's peculiar /proc
namespace as used above, I would expect leaving this Imake parameter
undefined, or #defining it to NO, would be the right choice for the Hurd,
until and unless you want to write a Hurd-specific
xf86PrintOSKernelString() function.

(Why this function isn't in xc/programs/Xserver/hw/xfree86/os-support
someplace instead of having Linux-specific code bolted into the "common"
directory, I'm not sure.  Probably laziness and/or sloppiness.)

> -#  define BuildRenderLibrary           NO
> -#  define HasRenderLibrary             YES
> -#  define BuildXcursorLibrary          NO
> -#  define HasXcursorLibrary            YES

> -#ifndef HasLibpng
> -#define HasLibpng             		YES
> -#ifndef HasGroff
> -#define HasGroff              		YES
> 
> As hurd-i386 has those libraries/programs now, I added those.

Sounds right to me.

> -#   define FontLibSharedFreeType       NO
> 
> This one causes a build failure even with the current trunk, as
> xc/lib/font/libXFont apparently does not get built on Linux and
> xc/lib/font/Freetype/fcfuncs.c needs to be updated for current
> libfreetype6. I added the #define to gnu.cf as well, is that reasonable?

Uh, you lost me on this one.  Can we break this issue out into a separate
mail.  I get confused quickly when it comes to the Byzantine mess that is
font support in X.

> The addition of the xcursor stuff and the definition of Groff resulted
> in a changed MANIFEST.hurd-i386, which I updated. 

Okay.

> Those changes are attached in xfree86_hurd-i386.diff. Please tell me
> whether the changes are good or whether I should proceed differently. I
> tested them against subversion trunk (revision 1623) as well as revision
> -6 of 4.3.0.dfsg.1 and they applied (after a bit of fussing around) and
> worked (as in built and ran) fine. However, I did no test build on
> GNU/Linux, so if you feel this is required let me know. I doubt it
> should break something, though.
> 
> It would be nice if hurd-i386 could be back on line with the next
> upload.

Yes it would.

I glanced over your patch and it looks fine.  I'll take a closer look
before committing.

Would you like to take over as the XSF Hurd committer?

[1] http://lists.debian.org/debian-devel/2001/10/msg00353.html
[2] http://lists.debian.org/debian-devel/2001/11/msg00028.html

-- 
G. Branden Robinson                |    It may be difficult to to determine
Debian GNU/Linux                   |    where religious beliefs end and
branden@debian.org                 |    mental illness begins.
http://people.debian.org/~branden/ |    -- Elaine Cassel

Attachment: signature.asc
Description: Digital signature


Reply to: