[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
Wed Jul 5 13:19:20 PDT 2017


mibintc added a comment.

In https://reviews.llvm.org/D34158#797968, @Hahnfeld wrote:

> In https://reviews.llvm.org/D34158#797170, @mibintc wrote:
>
> > The other test that fails is my own new test! It fails because I don't know how to set it up so the test thinks it has a gcc toolchain with version > 4.8. I tried using gcc-toolchain set to various other Linux toolchains that i see in the test/Driver/Inputs - none of them cause the gcc version to be in the range. I also tried using -ccc-installation=Inputs/ which I see being used for gcc version parsing. How can I set up the test so that the GCCInstallation has a Version >= 4.8?  I test the new functionality from the console on Linux and can confirm it's working.
>
>
> You could try adding a completely new directory in `Inputs/`. Add the directory `usr/lib/gcc/x86_64-unknown-linux/4.9.0` underneath which //should// be recognized as the version. Maybe you have to add some more files, I'm not really familiar with the detection mechanism...


Thanks. I did that by copying the directory from fake_install_tree into a new install directory named stdc-predef.  However, this modification didn't result in altering the macro values for gnu-major and gnu-minor.  On the other hand, it is necessary to have a gcc installation in the --sysroot directory.  The test didn't pass if the gcc installation wasn't present in the Inputs directory. I used the method you suggested and modified the test to use -### and check for the presence or absence of -include stdc-predef.h. Now these new tests are passing. Thank you very much for the suggestion.


Repository:
  rL LLVM

https://reviews.llvm.org/D34158





More information about the cfe-commits mailing list