freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Re: freetype-2.3.7 -- ftconfig.h for biarch systems


From: Peter Breitenlohner
Subject: [ft-devel] Re: freetype-2.3.7 -- ftconfig.h for biarch systems
Date: Mon, 7 Jul 2008 11:14:42 +0200 (CEST)
User-agent: Alpine 1.10 (LNX 962 2008-03-14)

On Sun, 6 Jul 2008, Werner LEMBERG wrote:

Here is a sample of cpp input which is based on
my previous post. I tested on:

* Mac OS X 10.4 on G3 PowerPC (default is LP32)
* HP-UX 11 on IA64 & HP C compiler (default is LP32. +DD64 makes LP64).
* AIX 5.2 on ppc64 & Hitachi C compiler (default is LP32. -64 makes LP64).
* GNU/Linux (glibc-2.7) on amd64 & gcc-3.3 (default is LP64, -m32 makes LP32).
* GNU/Linux (glibc-2.7) on i386 & Tiny C compiler (default is LP32).
* FreeBSD 4.11 on i386 & gcc-2.95.4 (LP32 but inttypes.h has uint64_t).
* FreeBSD 6.2 on amd64 & gcc-3.4.6 (default is LP64, -m32 makes LP64).

Thanks a lot for your great analysis and code!  Please install
whatever you think is appropriate.

Yes, but unfortunately the situation is somewhat more complicated:

GNU/Linux has the commands:
        setarch ARCH [CMD]
        linux32 [CMD]
        linux64 [CMD]
that execute CMD (or /bin/sh) under a slightly modified environment.
Depending on the hardware ARCH could be
        i386/i486/i586/i686 vs. x86_64
        ppc/ppc32 vs. ppc64
        mips/mips32 vs. mips64
        sparc/sparc32 vs. sparc64
etc., and linux32 or linux64 generically select the 32 or 64 bit variant.

E.g., for GNU/Linux on x86_64:
        uname -m => x86_64
        linux64 uname -m => x86_64
        linux32 uname -m => i686
but
        gcc
        linux64 gcc
        linux32 gcc
will all produce 64 bit binaries. Adding '-m64' yields the same 64 bit
binaries, but adding '-m32' will all produce 32 bit binaries.

Moreover, for gcc-3.3 and later on GNU/Linux i686 systems you can add 'gcc
-m32' without harm, whereas 'gcc -m64' will usually fail with an error
message.

However, with a little bit of trickery it is possible to build gcc with
'-m32' as default, such that gcc consists of 32 bit binaries, capable to run
and produce either 32 or 64 bit binaries on 32 or 64 bit systems.

=========================

Conclusion: I think for gcc on a potential biarch system you should try 'gcc
-m32' as well as 'gcc -m64' to detect its true nature. Independently of
that, ftconfig.h should use SIZEOR_LONG only as if no other possibility
exists. Such other possibilities could be
        #include <bits/wordsize.h>
        #ifdef __x86_64__
and analogous.

Regards
Peter Breitenlohner <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]