bugThe FreeType Project - Bugs: bug #21250, Installed headers on bi-arch...

 
 

bug #21250: Installed headers on bi-arch systems shouldn't depend on 32/64-bit mode

Submitted by:  Peter Breitenlohner <breitenlohner>
Submitted on:  Thu 04 Oct 2007 11:39:37 AM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: suzuki toshiya <mpsuzuki>Open/Closed: Closed
Planned Release: 2.3.8

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 11 Sep 2008 08:15:43 AM UTC, comment #3:

As I received few comments on previous patch,
so I wrote a sh script to compare the cpp computation
of the big length of int & long with the results obtained
by AC_CHECK_SIZE() - and enable the cpp computation
if they are consistent. I've committed new patch
described in:
http://lists.nongnu.org/archive/html/freetype-devel/2008-09/msg00011.html

I wish it fixes this issue.

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Mon 07 Jul 2008 05:55:24 AM UTC, comment #2:

I'm quite sorry for long long delay about this issue.
Recently I've written a cpp code to determine the
size of int & long in compilation time. Still configure
writes the values obtained by AC_CHECK_SIZEOF(),
most cpp can determine the sizes from standard cpp macros
INT_MAX and LONG_MAX.

#include <limits.h>

#if ( 0x7FFFFFFFUL < 0x7FFFFFFFFFFFFFFFUL )

# warning cpp can evaluate 64bit numerics

# if ( INT_MAX < 0x7FFF )
# error Non-standard C whose int cannot cover signed 16bit
# elif ( 0x7FFF <= INT_MAX ) && ( INT_MAX < 0x7FFFFFFFUL )
# define FT_SIZEOF_INT 2
# elif ( 0x7FFFFFFF <= INT_MAX ) && ( INT_MAX < 0x7FFFFFFFFFFFUL )
# define FT_SIZEOF_INT 4
# else
# define FT_SIZEOF_INT 8
# endif

# if ( LONG_MAX < 0x7FFFFFFFL )
# error Non-standard C whose long cannot cover signed 32bit
# elif ( ( 0x7FFFFFFFL <= LONG_MAX ) && ( LONG_MAX < 0x7FFFFFFFFFFFUL ) )
# define FT_SIZEOF_LONG 4
# else
# define FT_SIZEOF_LONG 8
# endif

#else /* cpp cannot evaluate signed 64bit */

# warning cpp does not support 64bit numeric
/*
* Here we list the environment that can execute multiple ABIs
* with different bitsize (e.g. IRIX on mips64, AIX on ppc64)
* or build binary for multiple ABIs by single SDK (Mac OS X).
* The environment that use single ABI or multiple ABIs but
* same bit-length should be prepared by configure.
*/
# if defined( linux ) || defined( _FreeBSD_ ) || defined( _NetBSD_ ) || defined( _OpenBSD_ )
# if defined( __amd64 ) || defined( __ia64 ) || defined( __ppc64 ) || defined( __mips64 ) || defined( __sparc64 ) || defined( __sh64 )
# define _LP64_ 1
# elif defined( __i386 ) || defined( __ppc ) || defined( __mips ) || defined( __sparc ) || defined( __sh )
# define _LP32_ 1
# endif

/* AIX */
# elif defined( _AIX ) /* See /usr/include/sys/limits.h */
# if defined( _64BIT_ )
# define _LP64_ 1
# else
# define _LP32_ 1
# endif

/* HP-UX */
# elif defined( __hpux )
# ifndef _LP64_
# define _LP32_ 1
# endif

/* IRIX */
# elif defined( sgi )
# if defined( _MIPS_SZLONG ) && ( _MIPS_SZLONG == 64 )
# define _LP64_
# else
# define _LP32_
# endif

/* Mac OS X */
# elif defined( _APPLE_ ) && defined( _MACH_ )
# ifndef _LP64_
# define _LP32_
# endif

/* Solaris */
# elif defined( sun )
# ifdef _LP64
# define _LP64_
# else
# define _LP32_
# endif

# endif

# if defined( _LP32_ ) || defined( _LLP64_ )
# define FT_SIZEOF_INT 4
# define FT_SIZEOF_LONG 4
# elif defined( _LP64_ )
# define FT_SIZEOF_INT 4
# define FT_SIZEOF_LONG 8
# elif defined( _ILP64_ )
# define FT_SIZEOF_INT 8
# define FT_SIZEOF_LONG 8
# else

/* 16bit platform support should be added here */

# define FT_SIZEOF_INT @SIZEOF_INT@
# define FT_SIZEOF_LONG @SIZEOF_INT@

# endif

#endif

suzuki toshiya <mpsuzuki>
Project AdministratorIn charge of this item.
Thu 04 Oct 2007 07:44:34 PM UTC, comment #1:

Suzuki-san, can you take care of this?

Werner LEMBERG <wl>
Project Administrator
Thu 04 Oct 2007 11:39:37 AM UTC, original submission:

When installing the headers on a bi-arch system (e.g., x86_64-linux-gnu with its i686-linux-gnu compatibility mode), the installed headers for 32- and 64-bit mode shouldn't differ. Instead, the header should determine the correct mode at compile time according to the -- explicit or implicit -- compiler options ('gcc -m32' vs. 'gcc -m64').

At present the header
${prefix)/include/freetype2/freetype/config/ftconfig.h
contains one such undesirable difference:
#define SIZEOF_LONG 4
for 32-bit, or
#define SIZEOF_LONG 8
for-64.

Attached is a small patch handling this situation. Note, however, that this patch is far from perfect: at the very least configure should determine the presence of the <bits/wordsize.h> header.

Peter Breitenlohner <breitenlohner>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #14079:  freetype-2.3.5-patch added by breitenlohner (1KiB - application/octet-stream - patch to handle 32/64-bit mode on bi-arch systems (e.g., i686/x86_64))

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by mpsuzuki (Posted a comment)
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by breitenlohner (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 11 Sep 2008 08:15:43 AM UTCmpsuzukiStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Tue 15 Jul 2008 03:31:39 PM UTCantoinelDependencies-=>bugs #15095 is dependent
    Mon 07 Jul 2008 05:55:24 AM UTCmpsuzukiStatusConfirmed=>In Progress
      Planned ReleaseNone=>2.3.8
    Thu 04 Oct 2007 07:44:34 PM UTCwlStatusNone=>Confirmed
      Assigned toNone=>mpsuzuki
    Thu 04 Oct 2007 11:39:37 AM UTCbreitenlohnerAttached File-=>Added freetype-2.3.5-patch, #14079

    Back to the top


    Powered by Savane 3.1-cleanup1