Opened 6 years ago
Closed 6 years ago
#57130 closed defect (fixed)
clang-7.0: build fails in compiler-rt/lib/xray on darwin < 15 due to several issues
Reported by: | kencu (Ken) | Owned by: | kencu (Ken) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | tehcog (tehcog) | |
Port: | clang-7.0 |
Description
there are three issues building XRAY on older systems (that I have found so far).
- It needs thread local storage, which results in systems < darwin 11 failing.
- MAP_ANONYMOUS is used but undefined on older systems. This is fixed easily enough by replacing the definition with -DMAP_ANONYMOUS=MAP_ANON. I did it by adding the definition in compiler-rt/CMakeLists.txt to cover all the instances at once.
- error: use of undeclared identifier 'CLOCK_REALTIME'. This one may be harder to fix. There are some example replacement functions <https://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x> but I'm not sure if any of them truly offer a suitable replacement.
These issues may result in XRAY being disabled on all the non-building systems (currently darwin < 15).
When XRAY is disabled on darwin10 clang-7.0 builds through to completion (this fix is already in the Portfile restricted to darwin 10 or less <https://github.com/macports/macports-ports/commit/3f03093e264ea484508dbbcc6f8cbc14b18a23df> ).
Attachments (1)
Change History (13)
comment:1 Changed 6 years ago by kencu (Ken)
Port: | clang-7.0 added; clang-5.0 removed |
---|
comment:2 Changed 6 years ago by kencu (Ken)
Changed 6 years ago by kencu (Ken)
Attachment: | patch-map-anonymous-replacement.diff added |
---|
comment:3 Changed 6 years ago by kencu (Ken)
if XRAY is disabled, clang-7.0
builds through on 10.9 without further modifications (and without the map_anonymous patch):
$ port -v installed clang-7.0 The following ports are currently installed: clang-7.0 @7.0.0rc2_0+analyzer+libstdcxx (active) platform='darwin 13' archs='x86_64' date='2018-09-13T23:47:36-0700'
comment:4 Changed 6 years ago by kencu (Ken)
A moderately complex replacement for clock_gettime() with an MIT license: <https://gist.github.com/alfwatt/3588c5aa1f7a1ef7a3bb>.
comment:5 Changed 6 years ago by kencu (Ken)
Here's a clock_gettime() replacement that is currently used in MacPorts, courtesy of Jeremy from 2016 (so presumably acceptable): <https://github.com/macports/macports-ports/blob/master/graphics/cogl/files/patch-clock_gettime.diff>
comment:6 Changed 6 years ago by kencu (Ken)
Upstream bug report for MAP_ANONYMOUS issue <https://bugs.llvm.org/show_bug.cgi?id=38958>.
comment:7 Changed 6 years ago by kencu (Ken)
Upstream bug report for clock_gettime()
issue <https://bugs.llvm.org/show_bug.cgi?id=38959>
comment:8 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Thanks for filing the upstream radars. We should just disable in on < 10.9 for now unless someone speaks up that they need it.
comment:9 Changed 6 years ago by jeremyhu (Jeremy Huddleston Sequoia)
Owner: | changed from jeremyhu to kencu |
---|
Re-assigning to Ken, so he can just update his existing patch for <10.6 instead.
comment:10 Changed 6 years ago by kencu (Ken)
Will do. To avoid commit conflicts, I'll wait until <https://github.com/macports/macports-ports/pull/2614> lands shortly.
comment:11 Changed 6 years ago by tehcog (tehcog)
Cc: | tehcog added |
---|
comment:12 Changed 6 years ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
On
10.9
: