Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build HarfBuzz 5.3.1 with emscripten >=3.1.25 (libharfbuzz_la-hb-ft.lo) #154

Open
jimbojw opened this issue Dec 19, 2022 · 1 comment
Labels

Comments

@jimbojw
Copy link

jimbojw commented Dec 19, 2022

Trying to build using regular make (no docker, no buildah). Fails when compiling HarfBuzz.

Tried popping back to 4.1.0, 4.0.0, same issue. What am I doing wrong?

make: make -j 16 install-libLTLIBRARIES install-pkgincludeHEADERS install-pkgconfigDATA
make[1]: Entering directory '/<PATH_OMITTED>/JavascriptSubtitlesOctopus/build/lib/harfbuzz/src'
  CXX      libharfbuzz_la-hb-aat-layout.lo
  CXX      libharfbuzz_la-hb-aat-map.lo
  CXX      libharfbuzz_la-hb-blob.lo
  CXX      libharfbuzz_la-hb-buffer-verify.lo
  CXX      libharfbuzz_la-hb-buffer-serialize.lo
  CXX      libharfbuzz_la-hb-buffer.lo
  CXX      libharfbuzz_la-hb-draw.lo
  CXX      libharfbuzz_la-hb-common.lo
  CXX      libharfbuzz_la-hb-face.lo
  CXX      libharfbuzz_la-hb-fallback-shape.lo
  CXX      libharfbuzz_la-hb-font.lo
  CXX      libharfbuzz_la-hb-map.lo
  CXX      libharfbuzz_la-hb-number.lo
  CXX      libharfbuzz_la-hb-ot-cff1-table.lo
  CXX      libharfbuzz_la-hb-ot-cff2-table.lo
  CXX      libharfbuzz_la-hb-ot-color.lo
  CXX      libharfbuzz_la-hb-ot-face.lo
  CXX      libharfbuzz_la-hb-ot-font.lo
  CXX      libharfbuzz_la-hb-ot-layout.lo
  CXX      libharfbuzz_la-hb-ot-map.lo
  CXX      libharfbuzz_la-hb-ot-math.lo
  CXX      libharfbuzz_la-hb-ot-meta.lo
  CXX      libharfbuzz_la-hb-ot-metrics.lo
  CXX      libharfbuzz_la-hb-ot-name.lo
  CXX      libharfbuzz_la-hb-ot-shaper-arabic.lo
  CXX      libharfbuzz_la-hb-ot-shaper-default.lo
  CXX      libharfbuzz_la-hb-ot-shaper-hangul.lo
  CXX      libharfbuzz_la-hb-ot-shaper-hebrew.lo
  CXX      libharfbuzz_la-hb-ot-shaper-indic-table.lo
  CXX      libharfbuzz_la-hb-ot-shaper-indic.lo
  CXX      libharfbuzz_la-hb-ot-shaper-khmer.lo
  CXX      libharfbuzz_la-hb-ot-shaper-myanmar.lo
  CXX      libharfbuzz_la-hb-ot-shaper-syllabic.lo
  CXX      libharfbuzz_la-hb-ot-shaper-thai.lo
  CXX      libharfbuzz_la-hb-ot-shaper-use.lo
  CXX      libharfbuzz_la-hb-ot-shaper-vowel-constraints.lo
  CXX      libharfbuzz_la-hb-ot-shape-fallback.lo
  CXX      libharfbuzz_la-hb-ot-shape-normalize.lo
  CXX      libharfbuzz_la-hb-ot-shape.lo
  CXX      libharfbuzz_la-hb-ot-tag.lo
  CXX      libharfbuzz_la-hb-ot-var.lo
  CXX      libharfbuzz_la-hb-set.lo
  CXX      libharfbuzz_la-hb-shape-plan.lo
  CXX      libharfbuzz_la-hb-shape.lo
  CXX      libharfbuzz_la-hb-shaper.lo
  CXX      libharfbuzz_la-hb-static.lo
  CXX      libharfbuzz_la-hb-style.lo
  CXX      libharfbuzz_la-hb-ucd.lo
  CXX      libharfbuzz_la-hb-unicode.lo
  CXX      libharfbuzz_la-hb-ft.lo
  CXX      libharfbuzz_subset_la-hb-number.lo
  CXX      libharfbuzz_subset_la-hb-ot-cff1-table.lo
  CXX      libharfbuzz_subset_la-hb-ot-cff2-table.lo
  CXX      libharfbuzz_subset_la-hb-static.lo
  CXX      libharfbuzz_subset_la-hb-subset-cff-common.lo
  CXX      libharfbuzz_subset_la-hb-subset-cff1.lo
  CXX      libharfbuzz_la-hb-ot-shaper-use.lo
  CXX      libharfbuzz_la-hb-ot-shaper-vowel-constraints.lo
  CXX      libharfbuzz_la-hb-ot-shape-fallback.lo
  CXX      libharfbuzz_la-hb-ot-shape-normalize.lo
  CXX      libharfbuzz_la-hb-ot-shape.lo
  CXX      libharfbuzz_la-hb-ot-tag.lo
  CXX      libharfbuzz_la-hb-ot-var.lo
  CXX      libharfbuzz_la-hb-set.lo
  CXX      libharfbuzz_la-hb-shape-plan.lo
  CXX      libharfbuzz_la-hb-shape.lo
  CXX      libharfbuzz_la-hb-shaper.lo
  CXX      libharfbuzz_la-hb-static.lo
  CXX      libharfbuzz_la-hb-style.lo
  CXX      libharfbuzz_la-hb-ucd.lo
  CXX      libharfbuzz_la-hb-unicode.lo
  CXX      libharfbuzz_la-hb-ft.lo
  CXX      libharfbuzz_subset_la-hb-number.lo
  CXX      libharfbuzz_subset_la-hb-ot-cff1-table.lo
  CXX      libharfbuzz_subset_la-hb-ot-cff2-table.lo
  CXX      libharfbuzz_subset_la-hb-static.lo
  CXX      libharfbuzz_subset_la-hb-subset-cff-common.lo
  CXX      libharfbuzz_subset_la-hb-subset-cff1.lo
  CXX      libharfbuzz_subset_la-hb-subset-cff2.lo
  CXX      libharfbuzz_subset_la-hb-subset-input.lo
  CXX      libharfbuzz_subset_la-hb-subset-plan.lo
  CXX      libharfbuzz_subset_la-hb-subset-repacker.lo
  CXX      libharfbuzz_subset_la-hb-subset.lo
hb-ft.cc:790:5: error: cast from 'int (*)(const FT_Vector *, hb_draw_session_t *)' (aka 'int (*)(const FT_Vector_ *, hb_draw_session_t *)') to 'FT_Outline_MoveToFunc' (aka 'int (*)(const FT_Vector_ *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (FT_Outline_MoveToFunc) _hb_ft_move_to,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hb-ft.cc:791:5: error: cast from 'int (*)(const FT_Vector *, hb_draw_session_t *)' (aka 'int (*)(const FT_Vector_ *, hb_draw_session_t *)') to 'FT_Outline_LineToFunc' (aka 'int (*)(const FT_Vector_ *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (FT_Outline_LineToFunc) _hb_ft_line_to,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hb-ft.cc:792:5: error: cast from 'int (*)(const FT_Vector *, const FT_Vector *, hb_draw_session_t *)' (aka 'int (*)(const FT_Vector_ *, const FT_Vector_ *, hb_draw_session_t *)') to 'FT_Outline_ConicToFunc' (aka 'int (*)(const FT_Vector_ *, const FT_Vector_ *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (FT_Outline_ConicToFunc) _hb_ft_conic_to,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hb-ft.cc:793:5: error: cast from 'int (*)(const FT_Vector *, const FT_Vector *, const FT_Vector *, hb_draw_session_t *)' (aka 'int (*)(const FT_Vector_ *, const FT_Vector_ *, const FT_Vector_ *, hb_draw_session_t *)') to 'FT_Outline_CubicToFunc' (aka 'int (*)(const FT_Vector_ *, const FT_Vector_ *, const FT_Vector_ *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (FT_Outline_CubicToFunc) _hb_ft_cubic_to,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hb-ft.cc:1005:73: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  if (unlikely (!ft_face->generic.data || ft_face->generic.finalizer != (FT_Generic_Finalizer) hb_ft_face_finalize))
                                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./hb.hh:248:46: note: expanded from macro 'unlikely'
#define unlikely(expr) (__builtin_expect (!!(expr), 0))
                                             ^~~~
hb-ft.cc:1011:34: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hb-ft.cc:1274:32: error: cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 errors generated.
em++: error: '/<PATH_OMITTED>/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -DEMSCRIPTEN -I/<PATH_OMITTED>/emsdk/upstream/emscripten/cache/sysroot/include/SDL --sysroot=/<PATH_OMITTED>/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DHAVE_CONFIG_H -I. -I.. -I/<PATH_OMITTED>/JavascriptSubtitlesOctopus/dist/libraries/include -I/<PATH_OMITTED>/JavascriptSubtitlesOctopus/build/lib/freetype/build_hb/dist_hb/include/freetype2 -fno-rtti -DHB_NO_MT -O3 -flto -fno-exceptions -fno-threadsafe-statics -fvisibility-inlines-hidden -MT libharfbuzz_la-hb-ft.lo -MD -MP -MF .deps/libharfbuzz_la-hb-ft.Tpo -c hb-ft.cc -o libharfbuzz_la-hb-ft.o' failed (returned 1)
make[1]: *** [Makefile:2702: libharfbuzz_la-hb-ft.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/<PATH_OMITTED>/JavascriptSubtitlesOctopus/build/lib/harfbuzz/src'
emmake: error: 'make -j 16 install-libLTLIBRARIES install-pkgincludeHEADERS install-pkgconfigDATA' failed (returned 2)
make: *** [Makefile:88: /<PATH_OMITTED>/JavascriptSubtitlesOctopus/dist/libraries/lib/libharfbuzz.a] Error 1
@dmitrylyzo
Copy link
Contributor

Starting from Emscripten 3.1.25

Clang's function pointer cast warnings (enabled with -Wcast-function-type)
are now stricter. This warning is intended to help with CFI errors but also
helps wasm builds since wasm traps on such type mismatches in indirect calls.
We recommend that users enable it to prevent such errors (which can be hard to
debug otherwise). The older (less strict) behavior is also still possible with
-Wcast-function-type -Wno-cast-funtion-type-strict (or
-Wno-error=cast-function-type-strict if you want the warnings to be visible
but not errors). See https://reviews.llvm.org/D134831

Fixed by harfbuzz/harfbuzz#3859 (in harfbuzz 6.0.0)

@TheOneric TheOneric changed the title Failure to build libharfbuzz_la-hb-ft.lo Failure to build HarfBuzz 5.3.1 with emscripten >=3.1.25 (libharfbuzz_la-hb-ft.lo) Jan 11, 2023
@TheOneric TheOneric changed the title Failure to build HarfBuzz 5.3.1 with emscripten >=3.1.25 (libharfbuzz_la-hb-ft.lo) Failure to build HarfBuzz 5.3.1 with emscripten >=3.1.25 (libharfbuzz_la-hb-ft.lo) Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants