Qt embedded compile error => undefined reference to `__sync_fetch_and_add_4'



  • Hi guys,

    I am trying to cross compile Qt Embedded for an ARM architecture using shared libraries. But I receive this error:

    ...
    const&)]+0x1a0): more undefined references to __sync_fetch_and_add_4' follow collect2: ld returned 1 exit status make[1]: *** [../../lib/libQtScript.so.4.7.3] Error 1 make[1]: Leaving directory/home/ubuntu/Downloads/qt-everywhere-opensource-src-4.7.3/src/script'
    make: *** [sub-script-make_default-ordered] Error 2
    ubuntu@ubuntu-AMILO-Pro-Edition-V3545:~/Downloads/qt-everywhere-opensource-src-4.7.3$

    I am using the arm-angstrom-linux-gnueabi toolchain for cross compliling. Compiling Qt for x86 or VFB is not a problem. The strange thing is when I add the option -static to the configuration command of Qt, it compiles without any errors.

    Does anybody know how I can fix this problem?

    Thanks



  • I want to know why too. I use arm-none-linux-gnueabi toolchain for cross compiling. I shows error at ../3rdparty/webkit/JavaScriptCore section.



  • If I add option '-no-webkit' to my ./configure, make error disappered.



  • I am also trying to recompile QtWebKit 2.2.0 for iMax53 using arm-none-linux-gnueabi-g++ (GCC) 4.5.3 20110311 (prerelease) tool-chain with --netscape-plugin since i want NPAPI plugin enabled.

    But its giving me below error :
    @pectorBackendStub.o -L../../WebCore/release -L../../JavaScriptCore/release -L/home/tushar/HTML5/X11_rootfs/media/DISK/CREATE_ROOTFS/rootfs_kivix_iMX51_20111214/usr/lib -lwebcore -ljscore -lsqlite3 -lgio-2.0 -lgstapp-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -pthread -lgstvideo-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0 -lQtGuiE -lQtNetworkE -lQtCoreE -lpthread
    obj/release/JSWebKitBlobBuilder.o: In function __gnu_cxx::__exchange_and_add(int volatile*, int)': JSWebKitBlobBuilder.cpp:(.text._ZN9__gnu_cxxL18__exchange_and_addEPVii+0x20): undefined reference to__sync_fetch_and_add_4'
    obj/release/JSDOMWindow.o: In function __gnu_cxx::__exchange_and_add(int volatile*, int)': JSDOMWindow.cpp:(.text._ZN9__gnu_cxxL18__exchange_and_addEPVii+0x20): undefined reference to__sync_fetch_and_add_4'
    ../../WebCore/release/libwebcore.a(PluginPackageQt.o): In function WebCore::initializeGtk(QLibrary*)': PluginPackageQt.cpp:(.text._ZN7WebCoreL13initializeGtkEP8QLibrary+0x48): undefined reference toXSetIOErrorHandler'
    PluginPackageQt.cpp:(.text._ZN7WebCoreL13initializeGtkEP8QLibrary+0x6c): undefined reference to XSetIOErrorHandler' ../../WebCore/release/libwebcore.a(PluginViewQt.o): In functionWebCore::PluginView::updatePluginWidget()':
    PluginViewQt.cpp:(.text._ZN7WebCore10PluginView18updatePluginWidgetEv+0x2e0): undefined reference to XFreePixmap' PluginViewQt.cpp:(.text._ZN7WebCore10PluginView18updatePluginWidgetEv+0x348): undefined reference toXCreatePixmap'
    ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function WebCore::PluginView::paintUsingXPixmap(QPainter*, QRect const&)': PluginViewQt.cpp:(.text._ZN7WebCore10PluginView17paintUsingXPixmapEP8QPainterRK5QRect+0x2bc): undefined reference toXDefaultGC'
    PluginViewQt.cpp:(.text._ZN7WebCore10PluginView17paintUsingXPixmapEP8QPainterRK5QRect+0x3d0): undefined reference to XCopyArea' PluginViewQt.cpp:(.text._ZN7WebCore10PluginView17paintUsingXPixmapEP8QPainterRK5QRect+0x520): undefined reference toXSync'
    ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function WebCore::setXKeyEventSpecificFields(_XEvent*, WebCore::KeyboardEvent*)': PluginViewQt.cpp:(.text._ZN7WebCore26setXKeyEventSpecificFieldsEP7_XEventPNS_13KeyboardEventE+0x184): undefined reference toXStringToKeysym'
    PluginViewQt.cpp:(.text._ZN7WebCore26setXKeyEventSpecificFieldsEP7_XEventPNS_13KeyboardEventE+0x194): undefined reference to XKeysymToKeycode' ../../WebCore/release/libwebcore.a(PluginViewQt.o): In functionWebCore::getVisualAndColormap(int, Visual**, unsigned long*)':
    PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x130): undefined reference to XGetVisualInfo' PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x194): undefined reference toXRenderFindVisualFormat'
    PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x234): undefined reference to XFree' PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x27c): undefined reference toXCreateColormap'
    ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function WebCore::PluginView::platformDestroy()': PluginViewQt.cpp:(.text._ZN7WebCore10PluginView15platformDestroyEv+0x8c): undefined reference toXFreePixmap'
    PluginViewQt.cpp:(.text._ZN7WebCore10PluginView15platformDestroyEv+0xbc): undefined reference to XFreeColormap' ../../WebCore/release/libwebcore.a(PluginContainerQt.o): In functionWebCore::PluginContainerQt::redirectWheelEventsToParent(bool)':
    PluginContainerQt.cpp:(.text._ZN7WebCore17PluginContainerQt27redirectWheelEventsToParentEb+0x98): undefined reference to XGrabButton' PluginContainerQt.cpp:(.text._ZN7WebCore17PluginContainerQt27redirectWheelEventsToParentEb+0xd8): undefined reference toXUngrabButton'
    ../../JavaScriptCore/release/libjscore.a(StringImpl.o): In function WTF::StringImpl::~StringImpl()': StringImpl.cpp:(.text+0x1648): undefined reference to__sync_fetch_and_add_4'
    ../../JavaScriptCore/release/libjscore.a(StringImpl.o): In function WTF::StringImpl::crossThreadString()': StringImpl.cpp:(.text+0x1aec): undefined reference to__sync_fetch_and_add_4'
    ../../JavaScriptCore/release/libjscore.a(StringImpl.o): In function void WTF::derefIfNotNull<WTF::CrossThreadRefCounted<WTF::OwnFastMallocPtr<unsigned short const> > >(WTF::CrossThreadRefCounted<WTF::OwnFastMallocPtr<unsigned short const> >*)': StringImpl.cpp:(.text._ZN3WTF14derefIfNotNullINS_21CrossThreadRefCountedINS_16OwnFastMallocPtrIKtEEEEEEvPT_[void WTF::derefIfNotNull<WTF::CrossThreadRefCounted<WTF::OwnFastMallocPtr<unsigned short const> > >(WTF::CrossThreadRefCounted<WTF::OwnFastMallocPtr<unsigned short const> >*)]+0x38): undefined reference to__sync_fetch_and_add_4'
    ../../JavaScriptCore/release/libjscore.a(JSValueRef.o): In function JSValueToStringCopy': JSValueRef.cpp:(.text+0x5ae8): undefined reference to__sync_fetch_and_add_4'
    ../../JavaScriptCore/release/libjscore.a(JSValueRef.o): In function void WTF::derefIfNotNull<OpaqueJSString>(OpaqueJSString*)': JSValueRef.cpp:(.text._ZN3WTF14derefIfNotNullI14OpaqueJSStringEEvPT_[void WTF::derefIfNotNull<OpaqueJSString>(OpaqueJSString*)]+0x10): undefined reference to__sync_fetch_and_add_4'
    ../../JavaScriptCore/release/libjscore.a(JSClassRef.o):JSClassRef.cpp:(.text+0x5b4): more undefined references to __sync_fetch_and_add_4' follow collect2: ld returned 1 exit status make[1]: *** [../../lib/libQtWebKit.so.4.9.0] Error 1 make[1]: Leaving directory/home/tushar/HTML5/QtWebKit-2.2.0/WebKitBuild/Release/WebKit/qt'
    make: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2
    @

    Please give some pointers to solve the issue...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.