[tlbuild] graphite2-1.2.0 and gcc3

Peter Breitenlohner peb at mppmu.mpg.de
Tue Jan 8 10:39:14 CET 2013


On Tue, 8 Jan 2013, Karl Berry wrote:

> graphite2-1.20 does not compile with gcc-3.3.5 or gcc-3.4.4.  Sigh.
> GCC3 does not have -std=c++11.

> In file included from ../../../libs/graphite2/graphite2-1.2.0/src/inc/Font.h:31,
>                 from ../../../libs/graphite2/graphite2-1.2.0/src/inc/Slot.h:32,
>                 from ../../../libs/graphite2/graphite2-1.2.0/src/Bidi.cpp:28:
> ../../../libs/graphite2/graphite2-1.2.0/src/inc/Face.h:206: error: base `
>   graphite2::Face' with only non-default constructor in class without a
>   constructor

Hi Karl,

I know and I had the same problem with the linux->mingw32 gcc-3.4.5.  The
attached patch solves this problem.  However, there were subsequent problems
compiling harfbuzz were I did not see any simple workaround.  Consequently I
have built the gcc-4.6.3 cross compiler and now use that one (and gcc-4.4.7
for linux).

Here a message I got from the harfbuzz maintainer:
===========================
Date: Tue, 04 Dec 2012 13:03:58 -0500
From: Behdad Esfahbod <behdad at behdad.org>
To: Khaled Hosny <khaledhosny at eglug.org>
CC: Peter Breitenlohner <peb at mppmu.mpg.de>,
  Martin Hosken <martin_hosken at sil.org>,
  Harfbuzz <harfbuzz at lists.freedesktop.org>
Subject: Re: [HarfBuzz] XeTeX ICU and HarfBuzz in TeX Live

On 12-12-04 09:18 AM, Khaled Hosny wrote:
> On Tue, Dec 04, 2012 at 02:39:53PM +0100, Peter Breitenlohner wrote:
>>
>> I still have problems compiling harfbuzz for mingw32, I get error messages
>>   hb-open-type-private.hh: In function `const Type& OT::Null() [with Type = OT::Tag]':
>>   hb-open-type-private.hh:579: error: call of overloaded `CastP(const char[5])' is ambiguous
>>   hb-open-type-private.hh:55: note: candidates are: const Type* OT::CastP(const TObject*) [with Type = OT::Tag, TObject = char]
>>   hb-open-type-private.hh:58: note:                 Type* OT::CastP(TObject*) [with Type = OT::Tag, TObject = const char]
>>
>> It seems this is too complicated for gcc-3.4.  Any idea how to handle it?
> 
> I build cross compile HarfBuzz with mingw32 regularly, but probably
> gcc-3.4 is too old.

Yeah.  This looks like a ridiculous compiler shortcoming.  We've had more
serious issues with gcc-3.x reported in the past, so I'm not going to sweat
over this one.

behdad
===========================

I know this is not exactly pleasant and we might expect problems with other
oldish compilers, although Visual Studio 2005 used by Akira has no problems.

Regards
Peter
-------------- next part --------------
	Required for gcc-3.4 and probaly other old versions to avoid
	  error: base `graphite2::Face' with only non-default constructor in
          class without a constructor
	and the same for Font, Segment.

diff -ur graphite2-1.2.0.orig/src/inc/Face.h graphite2-1.2.0/src/inc/Face.h
--- graphite2-1.2.0.orig/src/inc/Face.h	2012-09-21 10:39:40.000000000 +0200
+++ graphite2-1.2.0/src/inc/Face.h	2012-12-04 12:15:58.000000000 +0100
@@ -89,6 +89,9 @@
 
     CLASS_NEW_DELETE;
 private:
+    // do not instantiate
+    Face();
+
     SillMap                 m_Sill;
     gr_face_ops             m_ops;
     const void            * m_appFaceHandle;    // non-NULL
diff -ur graphite2-1.2.0.orig/src/inc/Font.h graphite2-1.2.0/src/inc/Font.h
--- graphite2-1.2.0.orig/src/inc/Font.h	2012-09-21 10:39:40.000000000 +0200
+++ graphite2-1.2.0/src/inc/Font.h	2012-12-04 12:13:14.000000000 +0100
@@ -54,6 +54,9 @@
     float               m_scale;      // scales from design units to ppm
     bool                m_hinted;
 
+    // do not instantiate
+    Font();
+
     Font(const Font&);
     Font& operator=(const Font&);
 };
diff -ur graphite2-1.2.0.orig/src/inc/Segment.h graphite2-1.2.0/src/inc/Segment.h
--- graphite2-1.2.0.orig/src/inc/Segment.h	2012-09-21 10:39:40.000000000 +0200
+++ graphite2-1.2.0/src/inc/Segment.h	2012-12-04 12:15:53.000000000 +0100
@@ -148,6 +148,9 @@
     float justify(Slot *pSlot, const Font *font, float width, enum justFlags flags, Slot *pFirst, Slot *pLast);
   
 private:
+    // do not instantiate
+    Segment();
+
     Rect            m_bbox;             // ink box of the segment
     Position        m_advance;          // whole segment advance
     SlotRope        m_slots;            // std::vector of slot buffers


More information about the tlbuild mailing list