[MacPorts] #54135: clang-4.0 error building software on 10.6 (or less) due to #include_next <float.h>
MacPorts
noreply at macports.org
Mon May 8 13:14:04 UTC 2017
#54135: clang-4.0 error building software on 10.6 (or less) due to #include_next
<float.h>
-------------------------+-----------------------
Reporter: kencu | Owner:
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: SnowLeopard | Port: clang-4.0
-------------------------+-----------------------
Jeremy identified this bug six months ago or so, but it's still in the
clang-4.0 source tree.
<https://bugs.llvm.org//show_bug.cgi?id=31504>
Gestos (ftp83) recently came across this error
<https://pastebin.com/dmNJFQKU> while building glib2 with clang-4.0, and
asked for help:
{{{
:info:build In file included from
/opt/local/libexec/llvm-4.0/bin/../lib/clang/4.0.0/include/float.h:36:
:info:build /usr/include/float.h:8:15: fatal error: 'float.h' file not
found
:info:build #include_next <float.h>
:info:build ^~~~~~~~~
:info:build 1 error generated.
}}}
I generated this bit for the Portfile:
{{{
platform darwin {
# float.h broken on clang (file doesn't exist when building llvm only)
# only for < SnowLeopard
if {${subport} eq "clang-${llvm_version}" && ${os.major} < 11 } {
# https://bugs.llvm.org//show_bug.cgi?id=31504
patchfiles-append 998-patch-tools-clang-lib-headers-float-fix-
SL.diff
}
}
}}}
and this patchfile
{{{
--- ./tools/clang/lib/Headers/float.h.orig 2017-05-06
10:27:32.000000000 -0700
+++ ./tools/clang/lib/Headers/float.h 2017-05-06 10:28:08.000000000
-0700
@@ -31,7 +31,7 @@
* Also fall back on Darwin to allow additional definitions and
* implementation-defined values.
*/
-#if (defined(__APPLE__) || (defined(__MINGW32__) || defined(_MSC_VER)))
&& \
+#if ((defined(__MINGW32__) || defined(_MSC_VER))) && \
__STDC_HOSTED__ && __has_include_next(<float.h>)
# include_next <float.h>
}}}
and with this I've had no such issues so far building ports with clang-4.0
on SnowLeopard.
I hesitate to generate a PR for such a complex port as clang-4.0.
--
Ticket URL: <https://trac.macports.org/ticket/54135>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list