[PATCH] D34158: to support gcc 4.8 (and newer) compatibility on Linux, preinclude <stdc-predef.h>
Melanie Blower via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 13 11:57:49 PDT 2017
mibintc created this revision.
mibintc created this object with visibility "All Users".
Herald added subscribers: fedor.sergeev, arichardson, Anastasia, sdardis, klimek.
As reported in llvm bugzilla 32377.
Here’s a patch to add preinclude of stdc-predef.h for gcc >= 4.8
The gcc documentation says “On GNU/Linux, <stdc-predef.h> is pre-included.” See https://gcc.gnu.org/gcc-4.8/porting_to.html
The preinclude is inhibited with –ffreestanding.
I’m not sure what other toolchains, if any, should support it. I put in some changes for Solaris or MipsLinux but I didn’t debug them and not sure the changes that i slapped in for MipsLinux and Solaris will, or should, work. I could just omit those and let folks interested in the other toolchains to do that, what’s your recommendation for supporting gcc on other platforms besides Linux? I only debugged and verified on Linux. Also, what's the mechanism to restrict the test case to run only on Linux?
Basically I fixed the failing test cases by adding either –ffreestanding or –nostdinc which inhibits this behavior. Some of the tests didn't support -ffreestanding but they did accept -nostdinc. Also, I have a few lit tests failing in my sandbox, they'll need to be updated to accomodate the change in the preprocessing. Anyway, hoping for some feedback on this patch.
in my sandbox, these tests are failing on Linux so currently it's not ready:
Failing Tests (7):
Clang Tools :: clang-tidy/llvm-include-order.cpp
Clang Tools :: clang-tidy/readability-implicit-bool-cast.cpp
Clang Tools :: pp-trace/pp-trace-pragma-general.cpp
Clang Tools :: pp-trace/pp-trace-pragma-opencl.cpp
Extra Tools Unit Tests :: clangd/ClangdTests/ClangdVFSTest.Parse
Extra Tools Unit Tests :: clangd/ClangdTests/ClangdVFSTest.ParseWithHeader
Extra Tools Unit Tests :: clangd/ClangdTests/ClangdVFSTest.Reparse
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 24975 bytes
Desc: not available
More information about the cfe-commits