[webkit-gtk] FW: webkitgtk-2.0.4 compilation fails

John Frankish j-frankish at slb.com
Wed Sep 25 21:00:48 PDT 2013


On Wed, Sep 25, 2013 at 7:13 AM, John Frankish <j-frankish at slb.com> wrote:
On Tue, Sep 24, 2013 at 8:58 PM, John Frankish <j-frankish at slb.com> wrote:
When trying to compile webkitgtk-2.0.4 with gtk+-3.8.4 and gcc-4.7.2, the compilation fails with:

  CXXLD  Programs/WebKit2APITests/TestBackForwardList
./.libs/libwebkit2gtk-3.0.so: undefined reference to `__sync_add_and_fetch_8'
collect2: error: ld returned 1 exit status
./.libs/libwebkit2gtk-3.0.so: undefined reference to `__sync_add_and_fetch_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Programs/WebKit2APITests/TestBackForwardList] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Programs/WebKit2APITests/TestContextMenu] Error 1
./.libs/libwebkit2gtk-3.0.so: undefined reference to `__sync_add_and_fetch_8'

Is this an illegal processor instruction? Webkitgtk and gtk+-3 are being compiled for i486.

Regards
John
_______________________________________________
From: Žan Doberšek [mailto:zandobersek at gmail.com]
Sent: Wednesday, 25 September, 2013 08:20
To: John Frankish
Cc: webkit-gtk at lists.webkit.org
Subject: Re: [webkit-gtk] webkitgtk-2.0.4 compilation fails Are you specifying the architecture properly through the compiler flags, by setting CFLAGS/CXXFLAGS envs to appropriate values?
http://stackoverflow.com/questions/2566167/where-to-find-sync-add-and-fetch-8
--------

Thanks for the reply - things were configured as follows:

CFLAGS="-march=i486 -mtune=i686 -Os -pipe  -fno-exceptions -fno-rtti " CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe " ./configure --prefix=/usr/local --enable-shared --libexecdir=/usr/lib/webkitgtk3 --enable-introspection --disable-geolocation --disable-webkit1 --enable-web-audio _______________________________________________

From: Žan Doberšek [mailto:zandobersek at gmail.com]
Sent: Wednesday, 25 September, 2013 11:54
To: John Frankish
Cc: webkit-gtk at lists.webkit.org
Subject: Re: [webkit-gtk] webkitgtk-2.0.4 compilation fails

Could you check whether the CFLAGS and CXXFLAGS in the generated GNUmakefile contain the options you've additionally specified?

There are at least two ways of doing this:
- `cat GNUmakefile | grep "^CFLAGS"; cat GNUmakefile | grep "^CXXFLAGS"`,
- run `make V=1` and see that the compiler invocations are using the specified options.

----------
Thanks:

$ grep "O2" /usr/src/webkitgtk-2.0.4/GNUmakefile
CFLAGS = -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti -std=c99 -O2 CXXFLAGS = -march=i486 -mtune=i686 -Os -pipe -Wno-c++11-compat -O2

make V=1
...
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -DBUILDING_CAIRO__ -DBUILDING_GTK__ -DBUILDING_WEBKIT2__ -I./Source -I./Source/WTF -I./Source/WTF/wtf -fno-rtti -fstrict-aliasing -O3 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -D_REENTRANT -I/usr/local/include -march=i486 -mtune=i686 -Os -pipe -Wno-c++11-compat -O2 -MT Source/WTF/wtf/libWTF_la-ArrayBuffer.lo -MD -MP -MF Source/WTF/wtf/.deps/libWTF_la-ArrayBuffer.Tpo -c Source/WTF/wtf/ArrayBuffer.cpp  -fPIC -DPIC -o Source/WTF/wtf/.libs/libWTF_la-ArrayBuffer.o

..so my CFLAGS/CXXFLAGS are being used to compile (as is often the case, -O2 and -O3 are also thrown in).

I've just noticed that libgpg-error and libgcrypt where compiled for i686, so I need to check if the error came from there first.

----------

Recompiling libgpg-error and libgcrypt for i486 did not fix the problem, but re-compiling webkitgtk like this did fix the problem:

CFLAGS="-march=i686 -Os -pipe" CXXFLAGS="-march=i686 -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --enable-shared --libexecdir=/usr/lib/webkitgtk3 --enable-introspection --disable-geolocation --disable-webkit1 --enable-web-audio

find . -name GNUmakefile -type f -exec sed -i 's/-O2/ /g' {} \;
find . -name GNUmakefile -type f -exec sed -i 's/-O3/ /g' {} \;

Thanks for the help

Could I suggest that either the code is fixed to be i486 compatible or the ./configure script halts if it detects compiling for i486?

Regards
John


More information about the webkit-gtk mailing list