[webkit-gtk] Compiling webkitgtk on OSX (10.9.4)

Devon Stewart blast at hardchee.se
Mon Sep 1 00:49:12 PDT 2014


Good catch!

Applying the following patch enabled it to start compiling using the system-bundled clang:

> diff --git a/./Source/autotools/CheckSystemAndBasicDependencies.m4 b/./Source/autotools/CheckSystemAndBasicDependencies.m4-orig
> index 012ffed..6ba892d 100644
> --- a/./Source/autotools/CheckSystemAndBasicDependencies.m4
> +++ b/./Source/autotools/CheckSystemAndBasicDependencies.m4-orig
> @@ -92,7 +92,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
> #endif
> ])], [c_compiler="gcc"], [])
> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
> -#if !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 3)
> +#if !(defined(__clang__) && (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ >= 3))
> #error Not a supported Clang compiler
> #endif
> ])], [c_compiler="clang"], [])
> @@ -111,7 +111,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
> #endif
> ])], [cxx_compiler="g++"], [])
> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
> -#if !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 3)
> +#if !(defined(__clang__) && (__clang_major__ > 3) || (__clang_major__ == 3 && __clang_minor__ >= 3))
> #error Not a supported Clang++ compiler
> #endif
> ])], [cxx_compiler="clang++"], [])

-Devon

On Aug 31, 2014, at 11:33 PM, Žan Doberšek <zandobersek at gmail.com> wrote:

> Hi,
> 
> On Sun, Aug 31, 2014 at 3:15 PM, Devon Stewart <blast at hardchee.se> wrote:
> I'm getting a strange compilation failure trying to build webkitgtk 2.4.5 with gcc-4.7 (which is stated as the low-end of the compiler requirement, and is already packaged in Homebrew). The error is as follows:
> 
> > rawrbookpro:webkitgtk-2.4.5 blast$ make
> >   CXX      Source/WTF/wtf/libWTF_la-PrintStream.lo
> >   CXX      Source/WTF/wtf/libWTF_la-RandomNumber.lo
> >   CXX      Source/WTF/wtf/libWTF_la-FastMalloc.lo
> >   CXX      Source/WTF/wtf/libWTF_la-RefCountedLeakCounter.lo
> >   CXX      Source/WTF/wtf/libWTF_la-RunLoop.lo
> >   CXX      Source/WTF/wtf/libWTF_la-SHA1.lo
> >   CXX      Source/WTF/wtf/libWTF_la-SixCharacterHash.lo
> >   CXX      Source/WTF/wtf/libWTF_la-StackBounds.lo
> >   CXX      Source/WTF/wtf/libWTF_la-StringPrintStream.lo
> >   CXX      Source/WTF/wtf/libWTF_la-TCSystemAlloc.lo
> >   CXX      Source/WTF/wtf/libWTF_la-ThreadIdentifierDataPthreads.lo
> > Source/WTF/wtf/FastMalloc.cpp: In member function 'void WTF::TCMalloc_PageHeap::initializeScavenger()':
> > Source/WTF/wtf/FastMalloc.cpp:1953:56: error: expected primary-expression before '^' token
> > Source/WTF/wtf/FastMalloc.cpp:1953:57: error: expected primary-expression before '{' token
> > Source/WTF/wtf/FastMalloc.cpp:1953:80: error: 'dispatch_source_set_event_handler' was not declared in this scope
> >   CXX      Source/WTF/wtf/libWTF_la-ThreadSpecificWin.lo
> >   CXX      Source/WTF/wtf/libWTF_la-Threading.lo
> > make: *** [Source/WTF/wtf/libWTF_la-FastMalloc.lo] Error 1
> > make: *** Waiting for unfinished jobs....
> 
> Now, I know dispatch.h is being found and used, because line 1952 is
> 
> >     dispatch_source_set_timer(m_scavengeTimer, startTime, scavengeDelayInNanoseconds, scavengeDelayInNanoseconds / 10);
> 
> and dispatch_source_set_timer is defined in the same header as dispatch_source_set_event_handler.
> 
> jfpoole on Freenode's #macdev suggested gcc-4.7 might not understand blocks, but there doesn't seem to be anything in gcc-4.7's configure script that references blocks at all. I'm out of my element here, looking for other ideas.
> 
> Does GCC also require the -fblocks compiler flag to be specified? The few examples that I found use that flag when compiling code with Clang.
>  
> 
> Thanks!
> -Devon
> 
> PS: Apple's version of clang fails the clang >= 3.3 version test, despite being based on clang 3.4... kind of strange.
> 
> > rawrbookpro:~ blast$ clang --version
> > Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
> > Target: x86_64-apple-darwin13.3.0
> > Thread model: posix
> 
> The __clang_major__ and __clang_minor__ macros are used to check the Clang version in Source/autotools/CheckSystemAndBasicDependencies.m4.
> The logic there is really specific to upstream Clang versions, so it's obvious why the 5.1 version would fail the check.
> 
> Cheers,
> Zan
>  
> 
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-gtk
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20140901/ecb276c8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20140901/ecb276c8/attachment-0001.sig>


More information about the webkit-gtk mailing list