Bug 86835 - Webkit fails to build on sparc64/gcc, missing implementation of atomic{In,De}crement
Summary: Webkit fails to build on sparc64/gcc, missing implementation of atomic{In,De}...
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-18 02:54 PDT by Landry Breuil
Modified: 2014-03-08 01:16 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Landry Breuil 2012-05-18 02:54:07 PDT
WebkitGtk 1.8.0 built fine on OpenBSD/sparc64/gcc 4.2.1, 1.8.1 started failing with the following :

Source/WebCore/platform/network/DNSResolveQueue.h: In member function 'void WebCore::DNSResolveQueue::decrementRequestCount()':
Source/WebCore/platform/network/DNSResolveQueue.h:49: error: 'atomicDecrement' was not declared in this scope
Source/WebCore/platform/network/DNSResolveQueue.cpp: In member function 'void WebCore::DNSResolveQueue::add(const WTF::String&)':
Source/WebCore/platform/network/DNSResolveQueue.cpp:57: error: 'atomicIncrement' was not declared in this scope
Source/WebCore/platform/network/DNSResolveQueue.cpp:61: error: 'atomicDecrement' was not declared in this scope
Source/WebCore/platform/network/DNSResolveQueue.cpp: In member function 'virtual void WebCore::DNSResolveQueue::fired()':
Source/WebCore/platform/network/DNSResolveQueue.cpp:83: error: 'atomicIncrement' was not declared in this scope

I traced it back to WTF/Atomics.h not providing an implem for atomicIncrement/atomicDecrement on sparc64/gcc.

Providing a simple implementation based on builtin __sync_fetch_and_add() allows me to build WebkitGtk 1.8.1 on sparc64.
See http://www.openbsd.org/cgi-bin/cvsweb/ports/www/webkit/patches/patch-Source_JavaScriptCore_wtf_Atomics_h?rev=1.1

inline int atomicIncrement(int volatile* addend) { return __sync_fetch_and_add(addend, 1) + 1; }
inline int atomicDecrement(int volatile* addend) { return __sync_fetch_and_add(addend, -1) - 1; }

If this can be considered a valid solution i'll provide a patch for trunk.
Comment 1 Landry Breuil 2013-03-30 07:35:18 PDT
Still apparently needed for webkitgtk 2.0.0, even if code moved to Source/WTF/wtf/Atomics.h
Comment 2 Landry Breuil 2013-10-20 02:07:19 PDT
Starting with webkit 2.2, i also need to provide int64_t based atomicImplement/Decrement ops..