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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  Peter Breitenlohner <breitenlohner>
Submitted:  Thu 04 Oct 2007 11:39:37 AM UTC
   
 
Severity:  3 - Normal Item Group:  Incorrect behaviour
Status:  Fixed Privacy:  Public
Assigned to:  mpsuzuki Open/Closed:  Closed
Planned Release:  2.3.8

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>
Group administrator
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>
Group administrator
Thu 04 Oct 2007 07:44:34 PM UTC, comment #1: 

Suzuki-san, can you take care of this?

Werner LEMBERG <wl>
Group 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.)

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
  • -email is unavailable- added by mpsuzuki (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by breitenlohner (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-09-11 mpsuzuki StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2008-07-15 antoinel Dependencies- bugs #15095 is dependent
    2008-07-07 mpsuzuki StatusConfirmed In Progress
        Planned ReleaseNone 2.3.8
    2007-10-04 wl StatusNone Confirmed
        Assigned toNone mpsuzuki
    2007-10-04 breitenlohner Attached File- Added freetype-2.3.5-patch, #14079

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code