Bug 99683

Summary: JavaScriptCore uses PLATFORM(MAC) when it means OS(DARWIN)
Product: WebKit Reporter: Jeremy Huddleston Sequoia <jeremyhu>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, berto, cgarcia, ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 126492    
Attachments:
Description Flags
Patch andersca: review+

Description Jeremy Huddleston Sequoia 2012-10-17 22:27:45 PDT
Source/JavaScriptCore/heap/VTableSpectrum.cpp uses PLATFORM(MAC) for some dladdr-foo, but that is valid based on OS(DARWIN) rather than PLATFORM(MAC) ... ie, it's valid for darwin/qt, darwin/gtk, etc.
Comment 1 Jeremy Huddleston Sequoia 2012-10-17 22:31:11 PDT
It looks like the same mis-use is occurring in:

Source/JavaScriptCore/jit/ThunkGenerators.cpp
Source/JavaScriptCore/tools/CodeProfile.cpp
Comment 2 Alberto Garcia 2014-01-03 08:24:11 PST
(In reply to comment #0)
> Source/JavaScriptCore/heap/VTableSpectrum.cpp uses PLATFORM(MAC) for
> some dladdr-foo, but that is valid based on OS(DARWIN) rather than
> PLATFORM(MAC) ... ie, it's valid for darwin/qt, darwin/gtk, etc.

That file does not exist anymore, I would propose to close this bug
but you mention other files that might be affected by the same
problem.

Is this still relevant? Are there other files to take care of?
Comment 3 Jeremy Huddleston Sequoia 2014-01-03 08:42:59 PST
(In reply to comment #2)
> (In reply to comment #0)
> > Source/JavaScriptCore/heap/VTableSpectrum.cpp uses PLATFORM(MAC) for
> > some dladdr-foo, but that is valid based on OS(DARWIN) rather than
> > PLATFORM(MAC) ... ie, it's valid for darwin/qt, darwin/gtk, etc.
> 
> That file does not exist anymore, I would propose to close this bug
> but you mention other files that might be affected by the same
> problem.
> 
> Is this still relevant? Are there other files to take care of?

It still exists in the latest released version of webkit-gtk (2.2.3).  I'll try updating our Portfile to use 2.3.x to see if anything else falls out with that beta release.

As of 2.2.3, we still needed to do the following changes:

    # https://bugs.webkit.org/show_bug.cgi?id=99683
    reinplace "s:PLATFORM(MAC):OS(DARWIN):g" \
        ${worksrcpath}/Source/JavaScriptCore/heap/VTableSpectrum.cpp \
        ${worksrcpath}/Source/JavaScriptCore/jit/ThunkGenerators.cpp \
        ${worksrcpath}/Source/JavaScriptCore/tools/CodeProfile.cpp

    # https://bugs.webkit.org/show_bug.cgi?id=58737
    reinplace "s:OS(MAC_OS_X):PLATFORM(MAC):" \
        ${worksrcpath}/Source/WTF/wtf/ThreadingPthreads.cpp
Comment 4 Alberto Garcia 2014-01-15 22:59:00 PST
Created attachment 221336 [details]
Patch

(In reply to comment #3)
> As of 2.2.3, we still needed to do the following changes:
>
>     # https://bugs.webkit.org/show_bug.cgi?id=99683
>     reinplace "s:PLATFORM(MAC):OS(DARWIN):g" \
>         ${worksrcpath}/Source/JavaScriptCore/heap/VTableSpectrum.cpp \
>         ${worksrcpath}/Source/JavaScriptCore/jit/ThunkGenerators.cpp \
>         ${worksrcpath}/Source/JavaScriptCore/tools/CodeProfile.cpp

VTableSpectrum.cpp no longer exists, but else it's fine.

Here's the updated patch.
Comment 5 Alberto Garcia 2014-01-18 11:37:48 PST
Committed r162266: <http://trac.webkit.org/changeset/162266>