[Fontconfig] Problems with fc-arch

Behdad Esfahbod behdad at behdad.org
Wed Nov 18 10:53:23 PST 2009


On 11/18/2009 01:24 PM, Tor Lillqvist wrote:
>> Check fontconfig/fc-arch/fcarch.tmpl.h.  It just means that armel and mipsel
>> have the same signature (which is hardly surprising).
>
> Even 32-bit x86 Windows has the same;)

I just checked the signature and the only difference with x86 is that the 
mipsel one has a 8-byte alignment for double whereas x86 has 4byte alignment. 
  That's quite unfortunate though, since this struct is public.  Means that 
fontconfig binaries can't be shared between gcc and MSVC :(.

The relevant gcc option is:

  -malign-double
  -mno-align-double
      Control whether GCC aligns "double", "long double", and "long long"
      variables on a two word boundary or a one word boundary.  Aligning
      "double" variables on a two word boundary will produce code that runs
      somewhat faster on a Pentium at the expense of more memory.

      On x86-64, -malign-double is enabled by default.

      Warning: if you use the -malign-double switch, structures containing
      the above types will be aligned differently than the published
      application binary interface specifications for the 386 and will not
      be binary compatible with structures in code compiled without that
      switch.

I checked all the signatures.  They all boil down to three properties:

   - Endian-ness

   - Long-size (ie. 32bit vs 64bit)

   - For 32bit systems, the double alignment

So, there's a total of 6 different architectures.  In fact, ppc64 and sparc64 
there are dupes right now.  Lets name them this way:

x86:	le32n
mipsel:	le32w
x86-64:	le64

m68k:	be32n
ppc:	be32w
ppc64:	le64

How does that sound?

>>   If you have a better name for the platform, toss it NOW
>
> Just use a hash code of the properties of the architecture?

I thought about that.  It makes the cache file names less intuitive for no 
particular benefit.  Plus, there's a good reason to not rely on hashes: the 
properties we check for may change in the future and that would change the 
hash every time.

behdad

> --tml
>


More information about the Fontconfig mailing list