[HarfBuzz] Build-related questions

Vincent Isambart vincent.isambart at gmail.com
Fri Jun 6 17:08:22 PDT 2014


Oops, sorry, didn't Reply all.

Hi Behdad,

> 2 questions/remarks after trying to build HarfBuzz for iPhone:
>
> On OS X?  What toolchain to you use?
>

On OS X. I was trying to cross-compile for iOS using the official Apple
toolchain.


>
> > - The build process adds the -mstructure-size-boundary=8 flag when
> building on ARM, but clang doesn’t support it. Couldn’t that flag added on
> ARM only when the compiler is GCC?
>
> Should be fixed in master.  Please check.
>

It doesn’t work for me. The configure output says:
checking alignment of struct{char}... 0

and configure.log:
configure:16748: /Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain/usr/bin/clang -c -arch armv7 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iP
conftest.c:65:37: error: expected member name or ';' after declaration
specifiers
typedef struct { char x; struct{char} y; } ac__type_alignof_;
                                ~~~~^
conftest.c:65:37: warning: expected ';' at end of declaration list
typedef struct { char x; struct{char} y; } ac__type_alignof_;
                                    ^
                                    ;
conftest.c:69:12: error: variable length array declaration can not have
'static' storage duration
static int test_array [1 - 2 * !(((long int) offsetof (ac__type_alignof_,
y)) >= 0)];
           ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.

And of course if I run *make* the compilation tries to use the
-mstructure-size-boundary=8 flag.

But I made it work adding just a semicolon to your code (and updating the
shell variable name):
diff --git a/configure.ac b/configure.ac
index fc64be1..ef71edf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ AC_CHECK_HEADERS(unistd.h sys/mman.h)

 # Compiler flags
 AC_CANONICAL_HOST
-AC_CHECK_ALIGNOF([struct{char}])
+AC_CHECK_ALIGNOF([struct{char;}])
 if test "x$GCC" = "xyes"; then

        # Make symbols link locally
@@ -95,7 +95,7 @@ if test "x$GCC" = "xyes"; then

        case "$host" in
                arm-*-*)
-                       if test "x$ac_cv_alignof_struct_char_" != x1; then
+                       if test "x$ac_cv_alignof_struct_char__" != x1; then
                                # Request byte alignment
                                CXXFLAGS="$CXXFLAGS
-mstructure-size-boundary=8"
                        fi

With that change I get:
checking alignment of struct{char;}... 1
and the compilation works fine.


> > - use of UCDN is disabled when building HarfBuzz with glib support, but
> why is it not when building HarfBuzz with ICU support?
>
> Because ICU is built into harfbuzz-icu.so, which is not accessible from
>
> harfbuzz.so.  Note that because of how ICU is discovered (fallback to
>
> icu-config), you might be getting the system (not iPhone SDK's) ICU
> detected.
>  Try --without-icu if that's the case.
>

Yes *configure* tends to want to use the system's pkg-config and similar
tools, not what you generally want when cross-compiling. I set for instance
the PKG_CONFIG environment variable to an empty value, but that doesn't
always work very well.

HarfBuzz is pretty small and simple so in fact I ended up building it
without using *configure* :P.

Thanks,
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20140607/c6d6816a/attachment.html>


More information about the HarfBuzz mailing list