[libvoikko] Libreoffice Voikko+HFST standalone extension for Mac issue

Sjur Moshagen sjurnm at mac.com
Mon Sep 12 20:56:28 EEST 2011


Den 12. sep. 2011 kl. 19.08 skrev Harri Pitkänen:

>> Linking the file $(LIBVOIKKO_PATH)/lib/libvoikko.a caused a linking error:
>> 
>> ld: warning: in build/voikko.map, file was built for unsupported file
>> format which is not the architecture being linked (i386)
> 
> This appears to be just a warning, maybe because LibreOffice is not built
> as an universal binary.

I saw this warning earlier when trying to build hfst-ospell as a universal binary - it turned out that some binaries were 64 bit only. Now I know that all dependent binaries are universal (both 32 and 64 bit), and as long as the correct architecture is there, there should be no reason to complain.

>> Undefined symbols:
>>  "hfst_ol::ZHfstOspeller::read_legacy(std::basic_string<char,
>> std::char_traits<char>, std::allocator<char> > const&)", referenced
>> from:
>>      libvoikko::spellchecker::suggestion::HfstSuggestion::HfstSuggestion(std::basic_string<char,
>> std::char_traits<char>, std::allocator<char> > const&,
>> libvoikko::voikko_options_t*)in libvoikko.a(HfstSuggestion.o)
> 
> This is an error and means ZHfstOspeller is not linked into libvoikko.a.
> Try rebuilding everything with --disable-shared --enable-static and see if
> that helps.

I did, and nothing has changed, I still get the same warning + errors as long as I am using the *.a file. If I instead reference the *.dylib file (as the rest of the libraries linked with the *.oxt library), the error disappears, but the resulting *.oxt is non-functional on other systems than my own:(

Here's the output of some library debugging tools:

$ otool -L build/oxt/voikko.dylib 
build/oxt/voikko.dylib:
	build/oxt/voikko.dylib (compatibility version 0.0.0, current version 0.0.0)
	@executable_path/urelibs/libuno_cppuhelpergcc3.dylib.3 (compatibility version 0.0.0, current version 0.0.0)
	@executable_path/urelibs/libuno_cppu.dylib.3 (compatibility version 0.0.0, current version 0.0.0)
	@executable_path/urelibs/libuno_sal.dylib.3 (compatibility version 0.0.0, current version 0.0.0)
	/usr/local/lib/libvoikko.1.dylib (compatibility version 14.0.0, current version 14.2.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 152.0.0)
	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

$ file build/oxt/voikko.dylib 
build/oxt/voikko.dylib: Mach-O dynamically linked shared library i386

$ file /usr/local/lib/libvoikko.a
/usr/local/lib/libvoikko.a: Mach-O universal binary with 2 architectures
/usr/local/lib/libvoikko.a (for architecture i386):	current ar archive random library
/usr/local/lib/libvoikko.a (for architecture x86_64):	current ar archive random library

$ file /usr/local/lib/libvoikko.1.dylib 
/usr/local/lib/libvoikko.1.dylib: Mach-O universal binary with 2 architectures
/usr/local/lib/libvoikko.1.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/usr/local/lib/libvoikko.1.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64

Is there something else that is needed to build a static & standalone voikko.oxt?

Sjur




More information about the Libvoikko mailing list