[HarfBuzz] Cross-compiling HarfBuzz for ios

Behdad Esfahbod behdad at behdad.org
Thu Jul 17 13:24:11 PDT 2014


No idea.

On 14-07-17 11:31 AM, Anita Hui wrote:
> Hi Behdad :)
> 
> So I built the two static libraries libharfbuzz.a and libicu-le-hb.a, and put the two and their respective header files into my project, replacing libicule.a and its header files like so:
> 
>     /Users/anitahui/Projects/main/Gladiator/uswish/samples/FocusAE/src/../../../thirdparty/prebuilt/ios/arch-arm/Debug/libicui18n.a         
>     /Users/anitahui/Projects/main/Gladiator/uswish/samples/FocusAE/src/../../../thirdparty/prebuilt/ios/arch-arm/Debug/libiculx.a 
>     /Users/anitahui/Projects/main/Gladiator/uswish/samples/FocusAE/src/../../../thirdparty/prebuilt/ios/arch-arm/Debug/libharfbuzz.a 
>     /Users/anitahui/Projects/main/Gladiator/uswish/samples/FocusAE/src/../../../thirdparty/prebuilt/ios/arch-arm/Debug/libicu-le-hb.a 
>     /Users/anitahui/Projects/main/Gladiator/uswish/samples/FocusAE/src/../../../thirdparty/prebuilt/ios/arch-arm/Debug/libicuuc.a 
>     /Users/anitahui/Projects/main/Gladiator/uswish/samples/FocusAE/src/../../../thirdparty/prebuilt/ios/arch-arm/Debug/libicudata.a 
> 
> And I'm getting the error below for amv7 as well as armv7s:
> 
> Undefined symbols for architecture armv7:
>   "icu_50::LayoutEngine::layoutEngineFactory(icu_50::LEFontInstance const*, int, int, LEErrorCode&)", referenced from:
>       icu_50::ParagraphLayout::ParagraphLayout(unsigned short const*, int, icu_50::FontRuns const*, icu_50::ValueRuns const*, icu_50::ValueRuns const*, icu_50::LocaleRuns const*, unsigned char, signed char, LEErrorCode&) in libiculx.a(ParagraphLayout.ao)
>   "icu_50::LayoutEngine::getGlyphs(unsigned int*, LEErrorCode&) const", referenced from:
>       icu_50::ParagraphLayout::ParagraphLayout(unsigned short const*, int, icu_50::FontRuns const*, icu_50::ValueRuns const*, icu_50::ValueRuns const*, icu_50::LocaleRuns const*, unsigned char, signed char, LEErrorCode&) in libiculx.a(ParagraphLayout.ao)
>   "icu_50::LayoutEngine::getGlyphPositions(float*, LEErrorCode&) const", referenced from:
>       icu_50::ParagraphLayout::ParagraphLayout(unsigned short const*, int, icu_50::FontRuns const*, icu_50::ValueRuns const*, icu_50::ValueRuns const*, icu_50::LocaleRuns const*, unsigned char, signed char, LEErrorCode&) in libiculx.a(ParagraphLayout.ao)
>   "vtable for icu_50::LEFontInstance", referenced from:
>       icu_50::LEFontInstance::LEFontInstance() in libuswish.a(YiLEFontInstanceFT.o)
>   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
>   "icu_50::LEFontInstance::canDisplay(int) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::mapCharToGlyph(int, icu_50::LECharMapper const*, signed char) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "typeinfo for icu_50::LEFontInstance", referenced from:
>       typeinfo for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::mapCharToGlyph(int, icu_50::LECharMapper const*) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::xUnitsToPoints(float) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LayoutEngine::getCharIndices(int*, int, LEErrorCode&) const", referenced from:
>       icu_50::ParagraphLayout::ParagraphLayout(unsigned short const*, int, icu_50::FontRuns const*, icu_50::ValueRuns const*, icu_50::ValueRuns const*, icu_50::LocaleRuns const*, unsigned char, signed char, LEErrorCode&) in libiculx.a(ParagraphLayout.ao)
>   "icu_50::LEFontInstance::unitsToPoints(LEPoint&, LEPoint&) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::xPixelsToUnits(float) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::pixelsToUnits(LEPoint&, LEPoint&) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::transformFunits(float, float, LEPoint&) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::yPixelsToUnits(float) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::mapCharsToGlyphs(unsigned short const*, int, int, signed char, icu_50::LECharMapper const*, signed char, icu_50::LEGlyphStorage&) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::getLineHeight() const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::yUnitsToPoints(float) const", referenced from:
>       vtable for CYILEFontInstanceFT in libuswish.a(YiLEFontInstanceFT.o)
>   "icu_50::LEFontInstance::~LEFontInstance()", referenced from:
>       CYILEFontInstanceFT::CYILEFontInstanceFT(CYITextRendererFT*, int) in libuswish.a(YiLEFontInstanceFT.o)
>       CYILEFontInstanceFT::~CYILEFontInstanceFT() in libuswish.a(YiLEFontInstanceFT.o)
> ld: symbol(s) not found for architecture armv7
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> Do you have any ideas as to what I'm doing wrong or any thing I may have missed? 
> 
> Thanks!
> 
> ________________________________________
> From: Behdad Esfahbod <behdad.esfahbod at gmail.com> on behalf of Behdad Esfahbod <behdad at behdad.org>
> Sent: Wednesday, July 16, 2014 3:02 PM
> To: Anita Hui; harfbuzz at lists.freedesktop.org
> Subject: Re: [HarfBuzz] Cross-compiling HarfBuzz for ios
> 
> D'oh.  Up to you whether you do static or dynamic linking, but icu-le-hb uses
> HarfBuzz, so yes, you need libharfbuzz one way or another.  If you want
> all-static, they you need libharfbuzz.a.
> 
> On 14-07-16 02:43 PM, Anita Hui wrote:
>> Oh, so do you mean that I would need to link the executable with libharfbuzz.a to use libicu-le-hb.a to replace libicule.a?
>>
>> Or that I need to have HarfBuzz on my system in order to build libicu-le-hb.a, which I can then use as a replacement for libicule.a without having to link the executable with libharfbuzz.a?
>>
>> ________________________________________
>> From: Behdad Esfahbod <behdad.esfahbod at gmail.com> on behalf of Behdad Esfahbod <behdad at behdad.org>
>> Sent: Wednesday, July 16, 2014 2:12 PM
>> To: Anita Hui; harfbuzz at lists.freedesktop.org
>> Subject: Re: [HarfBuzz] Cross-compiling HarfBuzz for ios
>>
>> On 14-07-16 02:11 PM, Anita Hui wrote:
>>> Just so I'm sure I understand, does this mean that libicu-le-hb.a is standalone and can directly replace libicule.a without anything extra?
>>
>> Yes, as long as by "standalone" you mean "only needs harfbuzz". :)
>>
>>> Also thanks for responding so quickly :D
>>>
>>> ________________________________________
>>> From: Behdad Esfahbod <behdad.esfahbod at gmail.com> on behalf of Behdad Esfahbod <behdad at behdad.org>
>>> Sent: Wednesday, July 16, 2014 12:47 PM
>>> To: Anita Hui; harfbuzz at lists.freedesktop.org
>>> Subject: Re: [HarfBuzz] Cross-compiling HarfBuzz for ios
>>>
>>> On 14-07-16 12:42 PM, Anita Hui wrote:
>>>> Hi Behdad,
>>>>
>>>> Thanks for your response! I have a general question about building static HarfBuzz libraries for replacing icu-LE. I noticed in the configure process when checking for tools, it checks for ICU. Does this mean that I need to have ICU in order to build libharfbuzz-icu.a? Please correct me if I'm wrong but I'm guessing that I need libharfbuzz-icu.a with libicu-le-hb.a in order to replace libicule.a.
>>>
>>> You don't need libharfbuzz-icu to use icu-le-hb.  Same way that ICU Layout
>>> doesn't actually depend on the rest of ICU. :)
>>>
>>> behdad
>>>
>>>> Again, thank you for replying! It's much appreciated :)
>>>>
>>>> Anita
>>>>
>>>> ________________________________________
>>>> From: Behdad Esfahbod <behdad.esfahbod at gmail.com> on behalf of Behdad Esfahbod <behdad at behdad.org>
>>>> Sent: Monday, July 14, 2014 4:46 PM
>>>> To: Anita Hui; harfbuzz at lists.freedesktop.org
>>>> Subject: Re: [HarfBuzz] Cross-compiling HarfBuzz for ios
>>>>
>>>> On 14-07-14 04:27 PM, Anita Hui wrote:
>>>>> Hi!
>>>>
>>>> Hi,
>>>>
>>>>
>>>>> I'm trying to cross compile HarfBuzz for iOS (ARMv7, ARMv7s, i386), and I was
>>>>> wondering if I also needed to compile FreeType, Cairo, and GLib for the
>>>>> iOS architectures as well. I am working on an osx machine, and what led me to
>>>>
>>>> No.
>>>>
>>>>
>>>>> the idea that I may need to cross compile the aforementioned libraries is a
>>>>> warning that I receive when I try to build:
>>>>>
>>>>>
>>>>>     ​ld: warning: ignoring file /opt/local/lib/libfreetype.dylib, file was
>>>>> built for x86_64 which is not the architecture being linked (armv7):
>>>>> /opt/local/lib/libfreetype.dylib
>>>>
>>>> configure --without-freetype --without-glib --without-cairo
>>>>
>>>> Or better yet, set PKG_CONFIG_LIBDIR correctly.
>>>>
>>>> behdad
>>>>
>>>>
>>>>> This warning was followed by a bunch of errors regarding undefined symbols for
>>>>> the architecture. I get the above warning for libglib.dylib and libintl.dylib
>>>>> as well.
>>>>>
>>>>>
>>>>> Ultimately my goal is to create static libraries for HarfBuzz and icu-le-hb.
>>>>>
>>>>>
>>>>> Thanks!
>>>>>
>>>>>
>>>>> Anita Hui
>>>>> anita.hui at youilabs.com
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> HarfBuzz mailing list
>>>>> HarfBuzz at lists.freedesktop.org
>>>>> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>>>>
>>>>
>>>> --
>>>> behdad
>>>> http://behdad.org/
>>>>
>>>
>>> --
>>> behdad
>>> http://behdad.org/
>>>
>>
>> --
>> behdad
>> http://behdad.org/
>>
> 
> --
> behdad
> http://behdad.org/
> 

-- 
behdad
http://behdad.org/


More information about the HarfBuzz mailing list