September 5, 2011

Qt_imx25 Qt_imx25
Lab Rat
1 posts

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&)]+0×1a0): more undefined references to `__sync_fetch_and_add_4’ follow
collect2: ld returned 1 exit status
make1: *** [../../lib/libQtScript.so.4.7.3] Error 1
make1: 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

3 replies

November 9, 2011

Weilly Weilly
Lab Rat
32 posts

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

November 11, 2011

Weilly Weilly
Lab Rat
32 posts

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

December 19, 2011

tusharforever tusharforever
Lab Rat
1 posts

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 :

  1. 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  
  2. obj/release/JSWebKitBlobBuilder.o: In function `__gnu_cxx::__exchange_and_add(int volatile*, int)':
  3. JSWebKitBlobBuilder.cpp:(.text._ZN9__gnu_cxxL18__exchange_and_addEPVii+0x20): undefined reference to `__sync_fetch_and_add_4'
  4. obj/release/JSDOMWindow.o: In function `__gnu_cxx::__exchange_and_add(int volatile*, int)':
  5. JSDOMWindow.cpp:(.text._ZN9__gnu_cxxL18__exchange_and_addEPVii+0x20): undefined reference to `__sync_fetch_and_add_4'
  6. ../../WebCore/release/libwebcore.a(PluginPackageQt.o): In function `WebCore::initializeGtk(QLibrary*)':
  7. PluginPackageQt.cpp:(.text._ZN7WebCoreL13initializeGtkEP8QLibrary+0x48): undefined reference to `XSetIOErrorHandler'
  8. PluginPackageQt.cpp:(.text._ZN7WebCoreL13initializeGtkEP8QLibrary+0x6c): undefined reference to `XSetIOErrorHandler'
  9. ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function `WebCore::PluginView::updatePluginWidget()':
  10. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView18updatePluginWidgetEv+0x2e0): undefined reference to `XFreePixmap'
  11. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView18updatePluginWidgetEv+0x348): undefined reference to `XCreatePixmap'
  12. ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function `WebCore::PluginView::paintUsingXPixmap(QPainter*, QRect const&)':
  13. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView17paintUsingXPixmapEP8QPainterRK5QRect+0x2bc): undefined reference to `XDefaultGC'
  14. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView17paintUsingXPixmapEP8QPainterRK5QRect+0x3d0): undefined reference to `XCopyArea'
  15. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView17paintUsingXPixmapEP8QPainterRK5QRect+0x520): undefined reference to `XSync'
  16. ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function `WebCore::setXKeyEventSpecificFields(_XEvent*, WebCore::KeyboardEvent*)':
  17. PluginViewQt.cpp:(.text._ZN7WebCore26setXKeyEventSpecificFieldsEP7_XEventPNS_13KeyboardEventE+0x184): undefined reference to `XStringToKeysym'
  18. PluginViewQt.cpp:(.text._ZN7WebCore26setXKeyEventSpecificFieldsEP7_XEventPNS_13KeyboardEventE+0x194): undefined reference to `XKeysymToKeycode'
  19. ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function `WebCore::getVisualAndColormap(int, Visual**, unsigned long*)':
  20. PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x130): undefined reference to `XGetVisualInfo'
  21. PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x194): undefined reference to `XRenderFindVisualFormat'
  22. PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x234): undefined reference to `XFree'
  23. PluginViewQt.cpp:(.text._ZN7WebCoreL20getVisualAndColormapEiPP6VisualPm+0x27c): undefined reference to `XCreateColormap'
  24. ../../WebCore/release/libwebcore.a(PluginViewQt.o): In function `WebCore::PluginView::platformDestroy()':
  25. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView15platformDestroyEv+0x8c): undefined reference to `XFreePixmap'
  26. PluginViewQt.cpp:(.text._ZN7WebCore10PluginView15platformDestroyEv+0xbc): undefined reference to `XFreeColormap'
  27. ../../WebCore/release/libwebcore.a(PluginContainerQt.o): In function `WebCore::PluginContainerQt::redirectWheelEventsToParent(bool)':
  28. PluginContainerQt.cpp:(.text._ZN7WebCore17PluginContainerQt27redirectWheelEventsToParentEb+0x98): undefined reference to `XGrabButton'
  29. PluginContainerQt.cpp:(.text._ZN7WebCore17PluginContainerQt27redirectWheelEventsToParentEb+0xd8): undefined reference to `XUngrabButton'
  30. ../../JavaScriptCore/release/libjscore.a(StringImpl.o): In function `WTF::StringImpl::~StringImpl()':
  31. StringImpl.cpp:(.text+0x1648): undefined reference to `__sync_fetch_and_add_4'
  32. ../../JavaScriptCore/release/libjscore.a(StringImpl.o): In function `WTF::StringImpl::crossThreadString()':
  33. StringImpl.cpp:(.text+0x1aec): undefined reference to `__sync_fetch_and_add_4'
  34. ../../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> >*)':
  35. 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'
  36. ../../JavaScriptCore/release/libjscore.a(JSValueRef.o): In function `JSValueToStringCopy':
  37. JSValueRef.cpp:(.text+0x5ae8): undefined reference to `__sync_fetch_and_add_4'
  38. ../../JavaScriptCore/release/libjscore.a(JSValueRef.o): In function `void WTF::derefIfNotNull<OpaqueJSString>(OpaqueJSString*)':
  39. JSValueRef.cpp:(.text._ZN3WTF14derefIfNotNullI14OpaqueJSStringEEvPT_[void WTF::derefIfNotNull<OpaqueJSString>(OpaqueJSString*)]+0x10): undefined reference to `__sync_fetch_and_add_4'
  40. ../../JavaScriptCore/release/libjscore.a(JSClassRef.o):JSClassRef.cpp:(.text+0x5b4): more undefined references to `__sync_fetch_and_add_4' follow
  41. collect2: ld returned 1 exit status
  42. make[1]: *** [../../lib/libQtWebKit.so.4.9.0] Error 1
  43. make[1]: Leaving directory `/home/tushar/HTML5/QtWebKit-2.2.0/WebKitBuild/Release/WebKit/qt'
  44. make: *** [sub-WebKit-qt-QtWebKit-pro-make_default-ordered] Error 2

Please give some pointers to solve the issue…

 
  ‹‹ Cross compiling Qt 4.7.4 with directfb support for SH4 on 64 bit platform      [SOLVED] Installing both 64bit and 32bit Qt libraries on Ubuntu ››

You must log in to post a reply. Not a member yet? Register here!