构建xulrunner时未定义的引用

时间:2015-01-22 15:20:40

标签: linker mozilla undefined-reference xulrunner freetype2

我正在尝试构建xulrunner版本2.0(从mozilla ftp站点下载的源代码),但在尝试创建libxul.so时,我不断获取一些未定义的引用。我尝试了10.0版,但结果相同。

我在Archlinux上构建,但我也从我从mozilla网站下载的VM上获得了与Ubuntu相同的错误。

在构建xulrunner之前,需要进行一些修改才能构建:

.mozconfig我正在使用:

mk_add_options AUTOCONF=autoconf-2.13
mk_add_options PYTHON=/usr/bin/python2
mk_add_options MOZ_CO_PROJECT=xulrunner
mk_add_options MOZ_OBJDIR=@topsrcdir@/obj-xulrunner
ac_add_options --enable-application=xulrunner
ac_add_options --disable-javaxpcom

大约30分钟后,我在尝试构建libxul.so时遇到了这些错误:

...
rm -f libxul.so
c++  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fomit-frame-pointer  -fPIC -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so  nsStaticXULComponents.o nsUnicharUtils.o nsBidiUtils.o nsRDFResource.o     -lpthread   -Wl,-rpath-link,/disk2/mozilla/buildtmp/obj-xulrunner/dist/bin -Wl,-rpath-link,/usr/local/lib  -Wl,--whole-archive ../../embedding/browser/gtk/src/libgtkembedmoz.a ../../toolkit/xre/libxulapp_s.a  ../../staticlib/components/libnecko.a ../../staticlib/components/libuconv.a ../../staticlib/components/libi18n.a ../../staticlib/components/libchardet.a ../../staticlib/components/libjar50.a ../../staticlib/components/libstartupcache.a ../../staticlib/components/libpref.a ../../staticlib/components/libhtmlpars.a ../../staticlib/components/libimglib2.a ../../staticlib/components/libgklayout.a ../../staticlib/components/libdocshell.a ../../staticlib/components/libembedcomponents.a ../../staticlib/components/libwebbrwsr.a ../../staticlib/components/libnsappshell.a ../../staticlib/components/libtxmgr.a ../../staticlib/components/libcommandlines.a ../../staticlib/components/libtoolkitcomps.a ../../staticlib/components/libpipboot.a ../../staticlib/components/libpipnss.a ../../staticlib/components/libappcomps.a ../../staticlib/components/libjetpack_s.a ../../staticlib/components/libjsctypes.a ../../staticlib/components/libjsperf.a ../../staticlib/components/libgkplugin.a ../../staticlib/components/libunixproxy.a ../../staticlib/components/libjsd.a ../../staticlib/components/libautoconfig.a ../../staticlib/components/libauth.a ../../staticlib/components/libcookie.a ../../staticlib/components/libpermissions.a ../../staticlib/components/libuniversalchardet.a ../../staticlib/components/libcomposer.a ../../staticlib/components/librdf.a ../../staticlib/components/libwindowds.a ../../staticlib/components/libfileview.a ../../staticlib/components/libstoragecomps.a ../../staticlib/components/libplaces.a ../../staticlib/components/libtkautocomplete.a ../../staticlib/components/libsatchel.a ../../staticlib/components/libpippki.a ../../staticlib/components/libwidget_gtk2.a ../../staticlib/components/libsystem-pref.a ../../staticlib/components/libimgicon.a ../../staticlib/components/libgkgfxthebes.a ../../staticlib/components/libaccessibility.a ../../staticlib/components/libremoteservice.a ../../staticlib/components/libspellchecker.a ../../staticlib/components/libzipwriter.a ../../staticlib/components/libservices-crypto.a ../../staticlib/libjsipc_s.a ../../staticlib/libdomipc_s.a ../../staticlib/libdomplugins_s.a ../../staticlib/libmozipc_s.a ../../staticlib/libmozipdlgen_s.a ../../staticlib/libipcshell_s.a ../../staticlib/libgfxipc_s.a ../../staticlib/libxpcom_core.a ../../staticlib/libucvutil_s.a ../../staticlib/libgkgfx.a ../../staticlib/libchromium_s.a ../../staticlib/libmozreg_s.a ../../staticlib/libmorkreader_s.a ../../staticlib/libgtkxtbin.a ../../staticlib/libthebes.a ../../staticlib/libycbcr.a ../../staticlib/libangle.a  -Wl,--no-whole-archive -L../../dist/lib -lmozsqlite3 -L../../dist/bin -L../../dist/lib -L../../jpeg -lmozjpeg -L../../modules/libimg/png -lmozpng -L../../gfx/qcms -lmozqcms -L/disk2/mozilla/buildtmp/obj-xulrunner/dist/bin -ljs_static -L../../dist/bin -L../../dist/lib -lcrmf -lsmime3 -lssl3 -lnss3 -lnssutil3 -L../../gfx/cairo/cairo/src -lmozcairo  -L../../gfx/cairo/libpixman/src -lmozlibpixman  -lXrender -lfreetype -lfontconfig ../../gfx/harfbuzz/src/libmozharfbuzz.a ../../gfx/ots/src/libmozots.a   -L../../modules/zlib/src -lmozz -lasound  -lrt -L../../dist/bin -L../../dist/lib  -L/disk2/mozilla/buildtmp/obj-xulrunner/dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl -L../../dist/lib -lmozalloc -ldbus-1  -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0   -lX11  -lXext  -lpangoft2-1.0 -lfontconfig -lfreetype -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo  -lgtk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lfontconfig -lfreetype -lgdk-x11-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0  -lXt -lgthread-2.0 -lfreetype -lz -lbz2 -lpng16 -lharfbuzz -ldl  -lrt   
../../staticlib/libthebes.a(gfxPangoFonts.o): In function `gfxDownloadedFcFontEntry::~gfxDownloadedFcFontEntry()':
gfxPangoFonts.cpp:(.text+0x1a63): undefined reference to `FT_Done_Face'
../../staticlib/libthebes.a(gfxPangoFonts.o): In function `gfxPangoFontGroup::NewFontEntry(gfxProxyFontEntry const&, unsigned char const*, unsigned int)':
gfxPangoFonts.cpp:(.text+0x3a61): undefined reference to `FT_New_Memory_Face'
../../staticlib/libthebes.a(gfxFT2Utils.o): In function `gfxFT2LockedFace::GetGlyph(unsigned int)':
gfxFT2Utils.cpp:(.text+0x6b): undefined reference to `FT_Select_Charmap'
../../staticlib/libthebes.a(gfxFT2Utils.o): In function `gfxFT2LockedFace::GetMetrics(gfxFont::Metrics*, unsigned int*)':
gfxFT2Utils.cpp:(.text+0x216): undefined reference to `FT_Get_Sfnt_Table'
gfxFT2Utils.cpp:(.text+0x450): undefined reference to `FT_Get_Sfnt_Table'
../../staticlib/libthebes.a(gfxFT2Utils.o): In function `gfxFT2LockedFace::FindCharVariantFunction()':
gfxFT2Utils.cpp:(.text+0x78e): undefined reference to `FT_Library_Version'
../../staticlib/libthebes.a(gfxFT2Utils.o): In function `gfxFT2LockedFace::GetUVSGlyph(unsigned int, unsigned int)':
gfxFT2Utils.cpp:(.text+0x84c): undefined reference to `FT_Select_Charmap'
../../staticlib/libthebes.a(gfxFT2Utils.o): In function `gfxFT2LockedFace::GetFontTable(unsigned int, FallibleTArray<unsigned char>&)':
gfxFT2Utils.cpp:(.text+0x8ba): undefined reference to `FT_Load_Sfnt_Table'
gfxFT2Utils.cpp:(.text+0x951): undefined reference to `FT_Load_Sfnt_Table'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_unscaled_font_map_lock':
cairo-ft-font.c:(.text+0x7c): undefined reference to `FT_Init_FreeType'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_unscaled_font_set_scale':
cairo-ft-font.c:(.text+0x347): undefined reference to `FT_Set_Transform'
cairo-ft-font.c:(.text+0x3af): undefined reference to `FT_Set_Char_Size'
cairo-ft-font.c:(.text+0x445): undefined reference to `FT_Set_Char_Size'
cairo-ft-font.c:(.text+0x462): undefined reference to `FT_Set_Pixel_Sizes'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_scaled_glyph_vertical_layout_bearing_fix':
cairo-ft-font.c:(.text+0xa25): undefined reference to `FT_Vector_Transform'
cairo-ft-font.c:(.text+0xa3a): undefined reference to `FT_Outline_Translate'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_unscaled_font_map_pluck_entry':
cairo-ft-font.c:(.text+0x11e9): undefined reference to `FT_Done_Face'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_unscaled_font_destroy':
cairo-ft-font.c:(.text+0x16ba): undefined reference to `FT_Done_Face'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_unscaled_font_lock_face':
cairo-ft-font.c:(.text+0x1aee): undefined reference to `FT_New_Face'
cairo-ft-font.c:(.text+0x1b11): undefined reference to `FT_Done_Face'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_index_to_ucs4':
cairo-ft-font.c:(.text+0x1b8c): undefined reference to `FT_Get_First_Char'
cairo-ft-font.c:(.text+0x1baf): undefined reference to `FT_Get_Next_Char'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_scaled_glyph_init':
cairo-ft-font.c:(.text+0x1ce6): undefined reference to `FT_Load_Glyph'
cairo-ft-font.c:(.text+0x1e9a): undefined reference to `FT_Outline_Transform'
cairo-ft-font.c:(.text+0x1eac): undefined reference to `FT_Outline_Decompose'
cairo-ft-font.c:(.text+0x2012): undefined reference to `FT_Render_Glyph'
cairo-ft-font.c:(.text+0x20ac): undefined reference to `FT_Load_Glyph'
cairo-ft-font.c:(.text+0x2114): undefined reference to `FT_GlyphSlot_Embolden'
cairo-ft-font.c:(.text+0x21f3): undefined reference to `FT_Outline_Get_CBox'
cairo-ft-font.c:(.text+0x291e): undefined reference to `FT_Outline_Transform'
cairo-ft-font.c:(.text+0x29b1): undefined reference to `FT_Outline_Translate'
cairo-ft-font.c:(.text+0x29d3): undefined reference to `FT_Outline_Get_Bitmap'
cairo-ft-font.c:(.text+0x2be4): undefined reference to `FT_GlyphSlot_Embolden'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_load_truetype_table':
cairo-ft-font.c:(.text+0x2d70): undefined reference to `FT_Load_Sfnt_Table'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-ft-font.o): In function `_cairo_ft_font_reset_static_data':
cairo-ft-font.c:(.text+0x358f): undefined reference to `FT_Done_FreeType'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-type1-subset.o): In function `cairo_type1_font_subset_get_glyph_names_and_widths':
cairo-type1-subset.c:(.text+0x379): undefined reference to `FT_Load_Glyph'
cairo-type1-subset.c:(.text+0x3b1): undefined reference to `FT_Get_Glyph_Name'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-type1-subset.o): In function `_cairo_type1_subset_init':
cairo-type1-subset.c:(.text+0xa8e): undefined reference to `FT_Get_PS_Font_Info'
../../gfx/cairo/cairo/src/libmozcairo.a(cairo-type1-subset.o): In function `_cairo_type1_scaled_font_is_type1':
cairo-type1-subset.c:(.text+0x1924): undefined reference to `FT_Get_PS_Font_Info'
/usr/bin/ld: libxul.so: hidden symbol `FT_Outline_Get_Bitmap' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
/disk2/mozilla/sources/10.0/mozilla-2.0/config/rules.mk:1291: recipe for target 'libxul.so' failed
make[4]: *** [libxul.so] Error 1
make[4]: Leaving directory '/disk2/mozilla/buildtmp/obj-xulrunner/toolkit/library'
/disk2/mozilla/sources/10.0/mozilla-2.0/config/rules.mk:783: recipe for target 'libs_tier_platform' failed
make[3]: *** [libs_tier_platform] Error 2
make[3]: Leaving directory '/disk2/mozilla/buildtmp/obj-xulrunner'
/disk2/mozilla/sources/10.0/mozilla-2.0/config/rules.mk:793: recipe for target 'tier_platform' failed
make[2]: *** [tier_platform] Error 2
make[2]: Leaving directory '/disk2/mozilla/buildtmp/obj-xulrunner'
/disk2/mozilla/sources/10.0/mozilla-2.0/config/rules.mk:746: recipe for target 'default' failed
make[1]: *** [default] Error 2
make[1]: Leaving directory '/disk2/mozilla/buildtmp/obj-xulrunner'
client.mk:345: recipe for target 'build' failed
make: *** [build] Error 2

用于创建libxul.so的命令行确实包含&#39; -lfreetype&#39;,当我在libfreetype.so中查找FT_Done_Face函数时,它存在:

[dev400t@arch mozilla-2.0]$ nm --dynamic /usr/lib/libfreetype.so | grep FT_Done_Face
000000000001b300 T FT_Done_Face

我确实添加了&#34; -Wl,-t&#34;命令行的选项,以确保找到libfreetype.so:找到它。

我错过了什么?

1 个答案:

答案 0 :(得分:1)

您的freetype2版本是&gt; = 2.5.1。它包含此更改http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=fae382076409db198dfbff36ac4cbb97b05b30a1,就Firefox而言,它是向后兼容的。

您需要将修复程序从此错误反向移植到源代码树:https://bugzilla.mozilla.org/show_bug.cgi?id=944454或降级您的libfreetype2。

Firefox 26及更高版本(包括24 ESR)的源代码已包含修复程序。

相关问题