Changes between Initial Version and Version 5 of Ticket #61775


Ignore:
Timestamp:
Dec 8, 2020, 1:06:52 AM (3 years ago)
Author:
mascguy (Christopher Nielsen)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61775

    • Property Priority changed from High to Normal
    • Property Summary changed from mame: 0.226 build fails on 10.8, due to host libstdc++ bug (_DARWIN_C_SOURCE needs to be defined) to mame: 0.226 build fails on 10.8; libc++ issue?
  • Ticket #61775 – Description

    initial v5  
    1616}}}
    1717
    18 In short, the issue relates to a bug in the host libstdc++: When '_XOPEN_SOURCE' is defined, certain items aren't declared unless '_DARWIN_C_SOURCE' is also defined. So far, this bug seems to be isolated to MacOS 10.8.x.
     18The issue appears to relate to the libc++ headers: When '_XOPEN_SOURCE' is defined, certain items aren't declared unless '_DARWIN_C_SOURCE' is also defined. So far, this bug seems to be isolated to MacOS 10.8.x.
    1919
    20 Proposed immediate-term solution: Patch the source file(s) in question, adding the following at the appropriate place:
     20Note that the Mame port is presently using MacPorts Clang 9. However, the same failures also occur with MacPorts Clang 10.
     21
     22Potential solution: Patch the source file(s) in question, adding the following at the appropriate place:
    2123
    2224{{{
    23 // MacPorts: Fix for libstdc++ bug in MacOS 10.8.x, which causes compilation errors
     25// MacPorts: Fix for libc++ compilation errors on MacOS 10.8
    2426#if defined(__APPLE__)
    2527#define _DARWIN_C_SOURCE
     
    2729}}}
    2830
    29 In parallel, I'll also discuss the fixes with the Mame project. And ultimately submit a pull request, to permanently fix this for future releases.
    30 
    31 Note: While we could certainly define '_DARWIN_C_SOURCE' globally, that seems more risky. And unnecessary, if only a small number of source files are involved.
     31While we could certainly define '_DARWIN_C_SOURCE' globally, that seems more risky. And unnecessary, if only a small number of source files are involved.
    3232
    3333Currently building on a 10.8 VM, to verify the latter.