RESOLVED FIXED 108174
[GTK] Missing build flags when building with Harfbuzz
https://bugs.webkit.org/show_bug.cgi?id=108174
Summary [GTK] Missing build flags when building with Harfbuzz
Mario Sanchez Prada
Reported 2013-01-29 02:41:34 PST
I've been experiencing for some time the following kind of linking errors when building WebKitGTK+ in certain scenarios (e.g. trying to build it with build-webkit inside a jhbuild shell environment for GNOME development over a Ubuntu 12.04 64bit machine): ./.libs/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_script_to_script' Investigating a bit the issue I realized the problem was that the -lharfbuzz parameter was not present in the linking lines, which was the cause of the error. Investigating a bit further I found out that the $(FREETYPE_CFLAGS) and $(FREETYPE_LIBS) variables were not being added in most of the places in GNUMakefile.am files where binaries were built, so that's why the -lharfbuzz parameter was not added. I'm still not sure why this issue is not spotted in some other environments (doing a clean build with build-webkit script *outside* my jhbuild for GNOME does not hit the issue) but it seems interesting to me in any case to add these flags to GNUMakefile.am files where needed, since that fixes the issue in these other specific cases, while it leaves the other scenarios working properly as well.
Attachments
Patch proposal (7.73 KB, patch)
2013-01-29 02:48 PST, Mario Sanchez Prada
mrobinson: review+
Mario Sanchez Prada
Comment 1 2013-01-29 02:48:11 PST
Created attachment 185209 [details] Patch proposal This patch fixes the issue for me.
WebKit Review Bot
Comment 2 2013-01-29 02:52:01 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Martin Robinson
Comment 3 2013-01-29 08:39:29 PST
Comment on attachment 185209 [details] Patch proposal I think you might be overlinking here. You only need to add it to libraries/binaries that didn't compile.
Mario Sanchez Prada
Comment 4 2013-01-29 08:46:10 PST
(In reply to comment #3) > (From update of attachment 185209 [details]) > I think you might be overlinking here. You only need to add it to libraries/binaries that didn't compile. :-) That's precisely what I did: instead of wildly adding things in every makefile I could find, what I did was precisely to go step by step by trying to build with make -j1 V=1 (debug build) and fix every single problem I found, one after one. So, long way of saying that every single FREETYPE_LIBS line you see in this patch corresponds to an actual failure I've found while trying to build, so this is the minimum patch I got that fixes the build for this scenario.
Martin Robinson
Comment 5 2013-01-29 08:50:30 PST
Comment on attachment 185209 [details] Patch proposal Sorry! I really should converted my statement into a question, but I was only starting my first coffee. :)
Mario Sanchez Prada
Comment 6 2013-01-29 09:02:11 PST
(In reply to comment #5) > (From update of attachment 185209 [details]) > Sorry! I really should converted my statement into a question, but I was only starting my first coffee. :) No problem. Thanks in any case for reviewing it!
Mario Sanchez Prada
Comment 7 2013-01-29 09:52:25 PST
Gustavo Noronha (kov)
Comment 8 2013-01-29 10:57:47 PST
I know we do it for other libraries right now, but we shouldn't really need to explicitly link those libraries into binaries that link to webkitgtk, wonder why it's not working for you.
Martin Robinson
Comment 9 2013-01-29 11:01:25 PST
(In reply to comment #8) > I know we do it for other libraries right now, but we shouldn't really need to explicitly link those libraries into binaries that link to webkitgtk, wonder why it's not working for you. That's a really good point.
Mario Sanchez Prada
Comment 10 2013-01-30 02:01:31 PST
(In reply to comment #8) > I know we do it for other libraries right now, but we shouldn't really need to > explicitly link those libraries into binaries that link to webkitgtk, wonder > why it's not working for you. It's working for me as long as I call build-webkit --gtk from a normal shell but it fails when I invoke that script from a -already present- jhbuild shell (e.g. GNOME's jhbuild shell). For some reason, the -lharfbuzz flag is missing in this case and so the libharfbuzz.so file is not being added to the linking, resulting in the failure shown above. In any case, please feel free to rollback the patch if you don't feel comfortable with it. If it's just me (or very rare cases) who is getting this trouble I can certainly work it around in some other (local) way.
Gustavo Noronha (kov)
Comment 11 2013-02-01 10:44:06 PST
Nah, I'm just wondering. Like I said, we do it for other libraries and I don't care about purity, tbh.
Techlive Zheng
Comment 12 2013-05-30 02:54:45 PDT
(In reply to comment #10) > (In reply to comment #8) > > I know we do it for other libraries right now, but we shouldn't really need to > explicitly link those libraries into binaries that link to webkitgtk, wonder > > why it's not working for you. > > It's working for me as long as I call build-webkit --gtk from a normal shell but it fails when I invoke that script from a -already present- jhbuild shell (e.g. GNOME's jhbuild shell). > > For some reason, the -lharfbuzz flag is missing in this case and so the libharfbuzz.so file is not being added to the linking, resulting in the failure shown above. > > In any case, please feel free to rollback the patch if you don't feel comfortable with it. If it's just me (or very rare cases) who is getting this trouble I can certainly work it around in some other (local) way. Hey, I got the same error while linking webkit2gtk against Gnome's gitg using jhbuild, can you guys help me out? /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_script_to_script' /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_get_unicode_funcs' collect2: error: ld returned 1 exit status
Alberto Garcia
Comment 13 2013-05-30 03:53:50 PDT
(In reply to comment #12) > Hey, I got the same error while linking webkit2gtk against Gnome's > gitg using jhbuild, can you guys help me out? Looks like you're talking about bug 116978
Martin Robinson
Comment 14 2013-05-30 05:51:00 PDT
(In reply to comment #12) > /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_script_to_script' > /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_get_unicode_funcs' > collect2: error: ld returned 1 exit status It sounds like the version of harfbuzz you are using was not compiled with ICU support.
Alberto Garcia
Comment 15 2013-05-30 06:06:49 PDT
(In reply to comment #14) > > /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_script_to_script' > > /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_get_unicode_funcs' > > collect2: error: ld returned 1 exit status > > It sounds like the version of harfbuzz you are using was not > compiled with ICU support. Yes, that's because the latest HarfBuzz moved ICU to a separate library. Details in bug 116978.
Techlive Zheng
Comment 16 2013-05-30 06:07:23 PDT
(In reply to comment #14) > (In reply to comment #12) > > > /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_script_to_script' > > /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib/libwebkit2gtk-3.0.so: undefined reference to `hb_icu_get_unicode_funcs' > > collect2: error: ld returned 1 exit status > > It sounds like the version of harfbuzz you are using was not compiled with ICU support. It's the bug 116978, after downgrade harfbuzz, get it working. Now need to wait webkit to fix it.
Note You need to log in before you can comment on or make changes to this bug.