compiling 32bit libraries on x86-64 system

tom fogal tfogal at alumni.unh.edu
Thu Jan 1 22:19:07 PST 2009


Dirk Hohndel <hohndel at infradead.org> writes:
> I must be missing some 'configure' magic here...
> 
> For some modules (like the X server) it's rather straight forward to
> build 32bit on a 64bit system. Something like
> 
> LDFLAGS=-L/opt/X11R7-32/lib ./configure --prefix=/opt/X11R7-32
> --enable-32-bit --build=x86-linux

It's not usually relevant, but these days recommended practice is
setting the variables *after* ./configure, e.g.:

    ./configure LDFLAGS=-L/opt/... \
        --prefix=... --enable-32-bit --build=...

> But for some other modules this fails (for example, libX11 doesn't know
> the --enable-32-bit flag). Worse, there doesn't seem to be a clean way
> to separate 32 and 64bit libraries and have apps pick up the right libs
> when running a custom build...
>
> Any suggestions?

At least w/ gcc, can you just add -m32 to your compiler command line?

    ./configure CFLAGS="-m32" LDFLAGS=-L/opt/... \
        --prefix=... --enable-32-bit --build=...

-tom



More information about the xorg mailing list