www/webkit-gtk3 build broken on FreeBSD 8.4 and general c++ library conflicts
Don Lewis
truckman at FreeBSD.org
Tue Dec 9 11:05:37 UTC 2014
On 3 Dec, Don Lewis wrote:
> When attempting to build webkit-gtk3 on FreeBSD 8.4, it fails like this:
>
> CXXLD Programs/LLIntOffsetsExtractor
> /usr/local/lib/libc++.so.1: undefined reference to `iswalpha_l'
> /usr/local/lib/libc++.so.1: undefined reference to `wctob_l'
> /usr/local/lib/libc++.so.1: undefined reference to `snprintf_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswprint_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswlower_l'
> /usr/local/lib/libc++.so.1: undefined reference to `mbrtowc_l'
> /usr/local/lib/libc++.so.1: undefined reference to `towlower_l'
> /usr/local/lib/libc++.so.1: undefined reference to `mbsrtowcs_l'
> /usr/local/lib/libc++.so.1: undefined reference to `tolower_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswxdigit_l'
> /usr/local/lib/libc++.so.1: undefined reference to `strxfrm_l'
> /usr/local/lib/libc++.so.1: undefined reference to `strftime_l'
> /usr/local/lib/libc++.so.1: undefined reference to `toupper_l'
> /usr/local/lib/libc++.so.1: undefined reference to `isxdigit_l'
> /usr/local/lib/libc++.so.1: undefined reference to `wcsxfrm_l'
> /usr/local/lib/libc++.so.1: undefined reference to `__mb_cur_max_l'
> /usr/local/lib/libc++.so.1: undefined reference to `newlocale'
> /usr/local/lib/libc++.so.1: undefined reference to `iswdigit_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswctype_l'
> /usr/local/lib/libc++.so.1: undefined reference to `mbrlen_l'
> /usr/local/lib/libc++.so.1: undefined reference to `btowc_l'
> /usr/local/lib/libc++.so.1: undefined reference to `wcrtomb_l'
> /usr/local/lib/libc++.so.1: undefined reference to `mbsnrtowcs_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswcntrl_l'
> /usr/local/lib/libc++.so.1: undefined reference to `localeconv_l'
> /usr/local/lib/libc++.so.1: undefined reference to `asprintf_l'
> /usr/local/lib/libc++.so.1: undefined reference to `mbtowc_l'
> /usr/local/lib/libc++.so.1: undefined reference to `strcoll_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswpunct_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswspace_l'
> /usr/local/lib/libc++.so.1: undefined reference to `towupper_l'
> /usr/local/lib/libc++.so.1: undefined reference to `iswupper_l'
> /usr/local/lib/libc++.so.1: undefined reference to `wcsnrtombs_l'
> /usr/local/lib/libc++.so.1: undefined reference to `freelocale'
> /usr/local/lib/libc++.so.1: undefined reference to `isdigit_l'
> /usr/local/lib/libc++.so.1: undefined reference to `wcscoll_l'
> /usr/local/lib/libc++.so.1: undefined reference to `sscanf_l'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> GNUmakefile:40531: recipe for target 'Programs/LLIntOffsetsExtractor' failed
> gmake: *** [Programs/LLIntOffsetsExtractor] Error 1
> *** Error code 1
>
> Stop in /usr/ports/www/webkit-gtk3.
>
>
> which indicates that trying to use the ports version of libc++ is now
> pretty much a lost cause on FreeBSD 8.4.
>
> The webkit-gtk3 port tests OSVERSION and forces the use of clang and
> libc++ from ports if it thinks that the system doesn't have clang in
> base (and gets it wrong on newer systems that are configured to build
> base with gcc instead of clang). The Makefile hackery for this has the
> following comment:
>
> # We need clang + libc++ or gcc 4.7+. gcc has libstdc++ conflict between
> # gcc port and base. This originates from icu
>
> I'm assuming that this is supposed to mean that gcc 4.7+ won't work
> because it will drag in the matching version of libstdc++ from the gcc
> port, which will conflict with the version of libstdc++ from base that
> icu is linked against, because icu is always built with the compiler
> from base. If so, I don't see how this could possibly work by using
> clang and libc++ from ports because any binary that gets linked to both
> libc++ and libstdc++ is pretty much guaranteed to croak when executed.
>
> It seems to be that webkit-gtk3 needs to be compiled with gcc 4.7+, at
> least on FreeBSD 8.4. Clang might be another a possibility on FreeBSD
> 9.x if its libc has the necessary symbols. To avoid the c++ library
> conflict, icu needs to be compiled with the same compiler and c++
> library as webkit-gtk3. Any other ports that depend on either of these
> two ports will also need to use the same same compiler and c++ library
> *and* any c++ dependencies of these ports will also need to do the same,
> and so forth.
>
> Maybe the cleanest thing to do is avoid using c++ (GCC) 4.2.1 when
> building any (nontrivial?) ports and force the use of a compiler from
> ports instead.
It looks like my suspicion is correct about consumers of webkit-gtk3
getting liked with both c++ libraries is correct. I ran and interactive
poudriere testport -o devel/seed
with a 9.3-RELEASE jail and got the following list of shared libraries
being used by the seed executable in the jail:
# ldd /usr/local/bin/seed
/usr/local/bin/seed:
libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x80081b000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x800a1c000)
libintl.so.8 => /usr/local/lib/libintl.so.8 (0x800d1c000)
libseed-gtk3.so.0 => /usr/local/lib/libseed-gtk3.so.0 (0x800f27000)
libwebkitgtk-3.0.so.0 => /usr/local/lib/libwebkitgtk-3.0.so.0 (0x801148000)
libthr.so.3 => /lib/libthr.so.3 (0x8032ca000)
libc.so.7 => /lib/libc.so.7 (0x8034ed000)
libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x803848000)
libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x803b44000)
libgirepository-1.0.so.1 => /usr/local/lib/libgirepository-1.0.so.1 (0x803dab000)
libgtk-3.so.0 => /usr/local/lib/libgtk-3.so.0 (0x803fdc000)
libgdk-3.so.0 => /usr/local/lib/libgdk-3.so.0 (0x804849000)
libpangocairo-1.0.so.0 => /usr/local/lib/libpangocairo-1.0.so.0 (0x804ad9000)
libpango-1.0.so.0 => /usr/local/lib/libpango-1.0.so.0 (0x804ce5000)
libatk-1.0.so.0 => /usr/local/lib/libatk-1.0.so.0 (0x804f2e000)
libcairo-gobject.so.2 => /usr/local/lib/libcairo-gobject.so.2 (0x805153000)
libcairo.so.2 => /usr/local/lib/libcairo.so.2 (0x80535b000)
libgdk_pixbuf-2.0.so.0 => /usr/local/lib/libgdk_pixbuf-2.0.so.0 (0x805654000)
libsoup-2.4.so.1 => /usr/local/lib/libsoup-2.4.so.1 (0x805874000)
libjavascriptcoregtk-3.0.so.0 => /usr/local/lib/libjavascriptcoregtk-3.0.so.0 (0x805b3f000)
libgio-2.0.so.0 => /usr/local/lib/libgio-2.0.so.0 (0x806340000)
libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x8066a4000)
libffi.so.6 => /usr/local/lib/libffi.so.6 (0x8068f1000)
libenchant.so.1 => /usr/local/lib/libenchant.so.1 (0x806af8000)
libharfbuzz-icu.so.0 => /usr/local/lib/libharfbuzz-icu.so.0 (0x806d03000)
libharfbuzz.so.0 => /usr/local/lib/libharfbuzz.so.0 (0x806f05000)
libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0 (0x807173000)
libgstapp-1.0.so.0 => /usr/local/lib/libgstapp-1.0.so.0 (0x807376000)
libgstaudio-1.0.so.0 => /usr/local/lib/libgstaudio-1.0.so.0 (0x807582000)
libgstfft-1.0.so.0 => /usr/local/lib/libgstfft-1.0.so.0 (0x8077ce000)
libgstpbutils-1.0.so.0 => /usr/local/lib/libgstpbutils-1.0.so.0 (0x8079d7000)
libgstvideo-1.0.so.0 => /usr/local/lib/libgstvideo-1.0.so.0 (0x807bfc000)
libgstbase-1.0.so.0 => /usr/local/lib/libgstbase-1.0.so.0 (0x807e44000)
libgstreamer-1.0.so.0 => /usr/local/lib/libgstreamer-1.0.so.0 (0x80809d000)
libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x808399000)
libsecret-1.so.0 => /usr/local/lib/libsecret-1.so.0 (0x8085d0000)
libxslt.so.1 => /usr/local/lib/libxslt.so.1 (0x808820000)
libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x808a5b000)
libGL.so.1 => /usr/local/lib/libGL.so.1 (0x808dbc000)
libpangoft2-1.0.so.0 => /usr/local/lib/libpangoft2-1.0.so.0 (0x80903b000)
libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1 (0x80924f000)
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x80948a000)
libpng15.so.15 => /usr/local/lib/libpng15.so.15 (0x80971c000)
libsqlite3.so.0 => /usr/local/lib/libsqlite3.so.0 (0x80994b000)
libicui18n.so.53 => /usr/local/lib/libicui18n.so.53 (0x809c01000)
libicuuc.so.53 => /usr/local/lib/libicuuc.so.53 (0x80a083000)
libicudata.so.53 => /usr/local/lib/libicudata.so.53 (0x80a418000)
libwebp.so.5 => /usr/local/lib/libwebp.so.5 (0x80bb07000)
libXcomposite.so.1 => /usr/local/lib/libXcomposite.so.1 (0x80bd69000)
libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x80bf6b000)
libXfixes.so.3 => /usr/local/lib/libXfixes.so.3 (0x80c16d000)
libXrender.so.1 => /usr/local/lib/libXrender.so.1 (0x80c372000)
libXt.so.6 => /usr/local/lib/libXt.so.6 (0x80c57b000)
libX11.so.6 => /usr/local/lib/libX11.so.6 (0x80c7dd000)
libz.so.6 => /lib/libz.so.6 (0x80cb13000)
libc++.so.1 => /usr/local/lib/libc++.so.1 (0x80cd27000)
libcxxrt.so => /usr/local/lib/libcxxrt.so (0x80cfe7000)
libm.so.5 => /lib/libm.so.5 (0x80d203000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x80d424000)
libXinerama.so.1 => /usr/local/lib/libXinerama.so.1 (0x80d632000)
libXrandr.so.2 => /usr/local/lib/libXrandr.so.2 (0x80d834000)
libXcursor.so.1 => /usr/local/lib/libXcursor.so.1 (0x80da3d000)
libXext.so.6 => /usr/local/lib/libXext.so.6 (0x80dc47000)
libXi.so.6 => /usr/local/lib/libXi.so.6 (0x80de58000)
libatk-bridge-2.0.so.0 => /usr/local/lib/libatk-bridge-2.0.so.0 (0x80e067000)
libpixman-1.so.0 => /usr/local/lib/libpixman-1.so.0 (0x80e297000)
libxcb-shm.so.0 => /usr/local/lib/libxcb-shm.so.0 (0x80e537000)
libxcb-render.so.0 => /usr/local/lib/libxcb-render.so.0 (0x80e739000)
libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x80e942000)
libgraphite2.so.3 => /usr/local/lib/libgraphite2.so.3 (0x80eb61000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x80ed8e000)
libgsttag-1.0.so.0 => /usr/local/lib/libgsttag-1.0.so.0 (0x80f095000)
liborc-0.4.so.0 => /usr/local/lib/liborc-0.4.so.0 (0x80f2cd000)
libgcrypt.so.20 => /usr/local/lib/libgcrypt.so.20 (0x80f554000)
libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x80f800000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x80fa10000)
libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x80fc33000)
libX11-xcb.so.1 => /usr/local/lib/libX11-xcb.so.1 (0x80fe88000)
libxcb-glx.so.0 => /usr/local/lib/libxcb-glx.so.0 (0x810089000)
libxcb-dri2.so.0 => /usr/local/lib/libxcb-dri2.so.0 (0x8102a1000)
libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x8104a5000)
libdrm.so.2 => /usr/local/lib/libdrm.so.2 (0x8106aa000)
libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x8108b5000)
libbz2.so.4 => /usr/lib/libbz2.so.4 (0x810ad9000)
libSM.so.6 => /usr/local/lib/libSM.so.6 (0x810ce9000)
libICE.so.6 => /usr/local/lib/libICE.so.6 (0x810ef0000)
librpcsvc.so.5 => /usr/lib/librpcsvc.so.5 (0x81110b000)
librt.so.1 => /usr/lib/librt.so.1 (0x811314000)
libatspi.so.0 => /usr/local/lib/libatspi.so.0 (0x811519000)
libdbus-1.so.3 => /usr/local/lib/libdbus-1.so.3 (0x811747000)
libXau.so.6 => /usr/local/lib/libXau.so.6 (0x81199a000)
libpthread-stubs.so.0 => /usr/local/lib/libpthread-stubs.so.0 (0x811b9c000)
libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x811d9d000)
Linking both
libc++.so.1 => /usr/local/lib/libc++.so.1
and
libstdc++.so.6 => /usr/lib/libstdc++.so.6
into the same executable is generally a way to generate crashes in
my experience.
More information about the freebsd-ports
mailing list