[HarfBuzz] Cross-compiling HarfBuzz for ios
Steven R. Loomis
srl at icu-project.org
Thu Jul 17 16:21:54 PDT 2014
Here's what I would do:
* build ICU from source (with --enable-layout)
* after it built, *replace* lib/libicule* ( the ICU layout engine) in
ICU's build dir with Harfbuzz's
* also replace the whole source/layout directory with something
containing the harfbuzz headers
* Then, do a build in the source/layout*ex* directory
That should give you a libiculx linked against HB.
I filed an ICU ticket here: http://bugs.icu-project.org/trac/ticket/11023
Behdad: can you fix the wrapper page to link to this bug with "if you
use layoutex", and I will do the same on the ICU warning.
On 07/17/2014 04:03 PM, Steven R. Loomis wrote:
> Hi, let me take a look..
>
> On 07/17/2014 01:24 PM, Behdad Esfahbod wrote:
>> 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!
> Are you really linking against the wrapper or partly against the real
> libicule?
>
>
> ICU ParagraphLayout doesn't have an option to build against HarfBuzz so
> you will have to probably do that manually.
>
> Probably ICU's ParagraphLayout (libicul*x*) is linking against ICU's
> *libicule*.
>
> -s
>>> ________________________________________
>>> 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
>>>>>>
>
>
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
--
IBMer but all opinions are mine.
https://www.ohloh.net/accounts/srl295 // fingerprint @ https://ssl.icu-project.org/trac/wiki/Srl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20140717/399b15d8/attachment-0001.sig>
More information about the HarfBuzz
mailing list