A new version of harfbuzz is requires -lgraphite2 but graphite2 mingw package dont have libgraphite2.a.
Please rebuild. Thanks!
it contain lib graphite.dll.a
It's link to dll file, and have error (or requires libgraphite2.dll) when i try to build static soft.
checking for GRAPHITE2... yes
...
Additional shapers (the more the better):
Graphite2: true
Compiled fine shared, static harfbuzz for both i686 and x86_64.
You should provide some logs.
Yes, example build static mpv. It's woking good of harfbuzz 1.2.6-1 (package doesn't requires graphite2). With harfbuzz 1.2.6-2, error return is : ld.exe: cannot find -lgraphite2
Check config.log:
Checking for SSA/ASS support
out: ..... -lgraphite2
Check pkg-config HarfBuzz.pc: requires graphite2.
Check pkg-config graphite2.pc : Libs: -L/mingw64/lib -lgraphite2
And i can't find any libgraphite2.a in msys2 folder.
Thank for help!
Most important question did you use makepkg-mingw with -s argument?
I've compiled harfbuzz 1.2.6-2 without problems.
Since it is mingw package it's lib are in /mingw64/lib or /mingw64/lib. There you can find libgraphite2.dll.a and libgraphite2.dll. You can try to copy libgraphite2.dll.a and rename to libgraphite2.a.
Default mpv:
Checking for SSA/ASS support
['/usr/bin/pkg-config', 'libass >= 0.12.1', '--libs', '--cflags', 'libass']
out: -mms-bitfields -I/mingw64/include -I/mingw64/include/freetype2 -I/mingw64/include/libpng16 -I/mingw64/include/harfbuzz -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include -I/mingw64/include/fribidi -I/mingw64/include/freetype2 -I/mingw64/include -I/mingw64/include/libpng16 -I/mingw64/include/harfbuzz -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include -L/mingw64/lib -LC:/building/msys64/mingw64/lib -L/mingw64/lib -lass -lm -liconv -lfontconfig -lexpat -lfreetype -liconv -lexpat -lfribidi -lfreetype -lz -lbz2 -lpng16 -lz -lharfbuzz -lglib-2.0 -lintl -pthread -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -lpcre -lgraphite2
yes
Now compiling static mpv.
dll.a is import library for dll. @mati865 don't rename it. Need to see graphite2 build system why not static library generated
@mati865 lib.a is linked to static library. Lib.dll.a linked to dynamic. How possible rename it?
static mpv failed
config.log.txt:
Checking for SSA/ASS support
['/usr/bin/pkg-config', 'libass >= 0.12.1', '--libs', '--cflags', '--static', 'libass']
out: -mms-bitfields -I/mingw64/include -I/mingw64/include/freetype2 -I/mingw64/include/libpng16 -I/mingw64/include/harfbuzz -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include -I/mingw64/include/fribidi -I/mingw64/include/freetype2 -I/mingw64/include -I/mingw64/include/libpng16 -I/mingw64/include/harfbuzz -I/mingw64/include/glib-2.0 -I/mingw64/lib/glib-2.0/include -I/mingw64/include -L/mingw64/lib -LC:/building/msys64/mingw64/lib -L/mingw64/lib -lass -lm -liconv -lfontconfig -lexpat -lfreetype -liconv -lexpat -lfribidi -lfreetype -lz -lbz2 -lpng16 -lz -lharfbuzz -lglib-2.0 -lintl -pthread -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -lpcre -lgraphite2
yes
And here is error http://pastebin.com/miWQu59R related to https://github.com/mpv-player/mpv/issues/2841
@mati865
Your build (or my build) error because compile environment is not enough necessary library.
It's not exactly an mpv bug!
Mpv is just an example. If dont have libgraphite2.a, some another source can be error when compile static.
But I'm wondering why it didn't fail on libgraphite.
libharfbuzz.a depends on libgraphite2. You should rebuild static lib of harfbuzz.
Fix graphite2 PKGBUILD to build static library
this patch should fix it (sorry didn't want to create PR)
--- graphite2-1.3.8/src/CMakeLists.txt 2016-04-19 13:37:40.827235400 +0300
+++ graphite2-1.3.8/src/CMakeLists.txt 2016-04-19 13:38:04.274591900 +0300
@@ -106,6 +106,48 @@
LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
LT_VERSION_AGE ${GRAPHITE_API_AGE})
+add_library(graphite2_static STATIC
+ ${GRAPHITE2_VM_TYPE}_machine.cpp
+ gr_char_info.cpp
+ gr_features.cpp
+ gr_face.cpp
+ gr_font.cpp
+ gr_logging.cpp
+ gr_segment.cpp
+ gr_slot.cpp
+ CachedFace.cpp
+ CmapCache.cpp
+ Code.cpp
+ Collider.cpp
+ Decompressor.cpp
+ Face.cpp
+ FeatureMap.cpp
+ Font.cpp
+ GlyphFace.cpp
+ GlyphCache.cpp
+ Intervals.cpp
+ Justifier.cpp
+ NameTable.cpp
+ Pass.cpp
+ Position.cpp
+ Segment.cpp
+ Silf.cpp
+ Slot.cpp
+ Sparse.cpp
+ TtfUtil.cpp
+ UtfCodec.cpp
+ ${FILEFACE}
+ ${SEGCACHE}
+ ${TRACING})
+
+set_target_properties(graphite2_static PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}"
+ SOVERSION ${GRAPHITE_SO_VERSION}
+ VERSION ${GRAPHITE_VERSION}
+ LT_VERSION_CURRENT ${GRAPHITE_API_CURRENT}
+ LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
+ LT_VERSION_AGE ${GRAPHITE_API_AGE}
+ OUTPUT_NAME graphite2)
+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set_target_properties(graphite2 PROPERTIES
COMPILE_FLAGS "-Wall -Wextra -Wno-unknown-pragmas -Wendif-labels -Wshadow -Wctor-dtor-privacy -Wnon-virtual-dtor -fno-rtti -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -fno-stack-protector"
@igv, well who will test it then?
Please try the new packages that have been checked in. A lot of it came from your work. This will not completely help with your static build issues with mpv but that is some other issues.
I'm trying to build a project that depends on harfbuzz, and I'm getting this error (and a bunch like it):
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x158): undefined reference to `__imp_gr_make_face'
This is with -lharfbuzz -lgraphite2 -lglib-2.0.
Installing harfbuzz-1.2.6-1-any fixes it.
I am also experiencing this problems when trying to compile mpv with --enable-static-build flags, i have recompile and reinstall graphite2 & harfbuzz from the Alexpux repo.
[468/472] Linking build/mpv-1.dll
[469/472] Linking build/mpv.exe
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x158): undefined reference to `__imp_gr_make_face'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x1f5): undefined reference to `__imp_gr_face_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x314): undefined reference to `__imp_gr_make_font_with_advance_fn'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x3b3): undefined reference to `__imp_gr_font_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x433): undefined reference to `__imp_gr_font_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x52c): undefined reference to `__imp_gr_face_featureval_for_lang'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x53f): undefined reference to `__imp_gr_fref_set_feature_value'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x546): undefined reference to `__imp_gr_face_find_fref'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x638): undefined reference to `__imp_gr_make_seg'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x651): undefined reference to `__imp_gr_seg_n_slots'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x6f4): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x6ff): undefined reference to `__imp_gr_seg_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x741): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x74c): undefined reference to `__imp_gr_seg_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x7ff): undefined reference to `__imp_gr_seg_first_slot'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x82d): undefined reference to `__imp_gr_slot_next_in_segment'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x851): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x86d): undefined reference to `__imp_gr_slot_before'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x878): undefined reference to `__imp_gr_slot_after'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x884): undefined reference to `__imp_gr_slot_gid'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x900): undefined reference to `__imp_gr_slot_can_insert_before'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x982): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xa0f): undefined reference to `__imp_gr_seg_advance_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xaf4): undefined reference to `__imp_gr_slot_next_in_segment'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xb01): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xb08): undefined reference to `__imp_gr_slot_origin_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xb0f): undefined reference to `__imp_gr_slot_advance_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc59): undefined reference to `__imp_gr_seg_advance_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc7d): undefined reference to `__imp_gr_slot_next_in_segment'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc88): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc8f): undefined reference to `__imp_gr_slot_origin_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc9c): undefined reference to `__imp_gr_slot_advance_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xd72): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xd7d): undefined reference to `__imp_gr_seg_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xdb3): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xdc9): undefined reference to `__imp_gr_seg_first_slot'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xde5): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xe15): undefined reference to `__imp_gr_seg_advance_X'
collect2.exe: error: ld returned 1 exit status
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x158): undefined reference to `__imp_gr_make_face'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x1f5): undefined reference to `__imp_gr_face_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x314): undefined reference to `__imp_gr_make_font_with_advance_fn'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x3b3): undefined reference to `__imp_gr_font_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x433): undefined reference to `__imp_gr_font_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x52c): undefined reference to `__imp_gr_face_featureval_for_lang'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x53f): undefined reference to `__imp_gr_fref_set_feature_value'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x546): undefined reference to `__imp_gr_face_find_fref'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x638): undefined reference to `__imp_gr_make_seg'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x651): undefined reference to `__imp_gr_seg_n_slots'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x6f4): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x6ff): undefined reference to `__imp_gr_seg_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x741): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x74c): undefined reference to `__imp_gr_seg_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x7ff): undefined reference to `__imp_gr_seg_first_slot'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x82d): undefined reference to `__imp_gr_slot_next_in_segment'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x851): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x86d): undefined reference to `__imp_gr_slot_before'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x878): undefined reference to `__imp_gr_slot_after'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x884): undefined reference to `__imp_gr_slot_gid'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x900): undefined reference to `__imp_gr_slot_can_insert_before'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0x982): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xa0f): undefined reference to `__imp_gr_seg_advance_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xaf4): undefined reference to `__imp_gr_slot_next_in_segment'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xb01): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xb08): undefined reference to `__imp_gr_slot_origin_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xb0f): undefined reference to `__imp_gr_slot_advance_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc59): undefined reference to `__imp_gr_seg_advance_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc7d): undefined reference to `__imp_gr_slot_next_in_segment'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc88): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc8f): undefined reference to `__imp_gr_slot_origin_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xc9c): undefined reference to `__imp_gr_slot_advance_Y'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xd72): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xd7d): undefined reference to `__imp_gr_seg_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xdb3): undefined reference to `__imp_gr_featureval_destroy'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xdc9): undefined reference to `__imp_gr_seg_first_slot'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xde5): undefined reference to `__imp_gr_slot_origin_X'
C:/msys64/mingw64/lib\libharfbuzz.a(libharfbuzz_la-hb-graphite2.o):(.text+0xe15): undefined reference to `__imp_gr_seg_advance_X'
collect2.exe: error: ld returned 1 exit status