[Xorg-driver-geode] proposal: always build with -march=geode

Writer, Tim Tim.Writer at amd.com
Wed Jul 14 11:29:46 PDT 2010


On Wed, Jul 14 2010, Gaetan Nadon <memsize at videotron.ca> wrote:

> On Tue, 2010-07-13 at 21:26 -0400, Writer, Tim wrote:
>
>     I'm not following you.
>
>
>
> I was referring to a previous post:
>
>
>     There is yet another potential issue. The drivers are part of the server
>     which has been compiled in 64 bit. In xorg-server.h:
>
>         /* Define to 1 if unsigned long is 64 bits. */
>         #define _XSERVER64 1
>
>
>     This value influences the number of bytes on the wire for client/server
>     communication. Each compilation unit must include xorg-server.h. By using
>     -m32, long will be 32 bits but server code will assume otherwise. I can't
>     really predict one way or the other, it's something I ran into.
>
>
> I don't know if this is a problem or not. I wanted to bring it to your
> attention.

OK, I see the problem.

I think we need to be really clear about what we're trying to
achieve. My goal for this work is simply to use an x86_64 host to
compile a functional i386 (32-bit) Geode driver for use on a 32-bit
Geode target system. In that case, the server should be compiled with:

    /* Define to 1 if unsigned long is 64 bits. */
    #define _XSERVER64 0

and all source files targeted for use on the Geode should be compiled
with `-m32'. This is the vast majority of source code compiled. The only
exception would be build tools and the like that are compiled on the
host for use on the host during compilation.

A typical developer would edit and build on the x86_64 host then
transfer the binaries (server, driver, libraries, etc.) to the target
Geode system (using NFS, rsync, etc.) and start X on it.

There is no suggestion of loading a 32-bit i386 driver into a 64-bit
x86_64 X server.

I'm guessing the above snippet comes from a "config.h" or the like
generated by autoconf/configure. In that case, presumably there's a
configure option (e.g. --enable-xserver64) to enable this or a configure
test that checks the word size. We need to ensure that this is set
properly based on the target arch not on the host arch.

Alternatively, if it's in a manually maintained header, use something
like:

    /* Define to 1 if unsigned long is 64 bits. */
    #if defined __x86_64__
    #define _XSERVER64 1
    #else
    #define _XSERVER64 0
    #endif

There could be other gotchas like this in the Geode driver but I'd be
surprised if there are any in the core X server, libaries, and modules
because compiling on x86_64 for i386 is common.

Tim



More information about the Xorg-driver-geode mailing list