Bug 156533 - Fix build in glibc-based BSD systems
Summary: Fix build in glibc-based BSD systems
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Other
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-13 02:48 PDT by Alberto Garcia
Modified: 2016-04-13 03:50 PDT (History)
8 users (show)

See Also:


Attachments
Patch (7.52 KB, patch)
2016-04-13 02:50 PDT, Alberto Garcia
cgarcia: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Garcia 2016-04-13 02:48:42 PDT
In MachineStackMarker.cpp there's a number of #ifdef blocks that follow this pattern:

#if OS(DARWIN)
  /* ... */
#elif OS(WINDOWS)
  /* ... */
#elif defined(__GLIBC__)
  /* ... */
#elif OS(FREEBSD)
  /* ... */
#else
#error Need a way to get the frame pointer for another thread on this platform
#endif

This works fine in most cases except in glibc-based FreeBSD systems (Debian GNU/kFreeBSD):

Source/JavaScriptCore/heap/MachineStackMarker.cpp: In member function 'void* JSC::MachineThreads::Thread::Registers::stackPointer() const':
Source/JavaScriptCore/heap/MachineStackMarker.cpp:554:68: error: 'const struct mcontext_t' has no member named 'gregs'                                        
     return reinterpret_cast<void*>((uintptr_t) regs.machineContext.gregs[REG_RSP]);

These systems should use the code inside the OS(FREEBSD) block, so this problem can be trivially solved by swapping the last two #elif blocks.
Comment 1 Alberto Garcia 2016-04-13 02:50:25 PDT
Created attachment 276313 [details]
Patch
Comment 2 Alberto Garcia 2016-04-13 03:50:50 PDT
Committed r199458: <http://trac.webkit.org/changeset/199458>