Configure CPP into settings
There is a distinction to be made between the Haskell Preprocessor and the C preprocessor. The former is used to preprocess Haskell files, while the latter is used in C preprocessing such as Cmm files. In practice, they are both the same program (usually the C compiler) but invoked with different flags. Previously we would, at configure time, configure the haskell preprocessor and save the configuration in the settings file, but, instead of doing the same for CPP, we had hardcoded in GHC that the CPP program was either `cc -E` or `cpp`. This commit fixes that asymmetry by also configuring CPP at configure time, and tries to make more explicit the difference between HsCpp and Cpp (see Note [Preprocessing invocations]). Note that we don't use the standard CPP and CPPFLAGS to configure Cpp, but instead use the non-standard --with-cpp and --with-cpp-flags. The reason is that autoconf sets CPP to "$CC -E", whereas we expect the CPP command to be configured as a standalone executable rather than a command. These are symmetrical with --with-hs-cpp and --with-hs-cpp-flags. Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP to be C99 compatible through -optP, since we now configure that into settings. Closes #23422
parent
6abf3648
No related branches found
No related tags found
Pipeline #78799 failed
Stage: tool-lint
Stage: quick-build
Stage: full-build
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Driver/Pipeline/Execute.hs 2 additions, 2 deletionscompiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs 5 additions, 2 deletionscompiler/GHC/Driver/Session.hs
- compiler/GHC/Settings.hs 7 additions, 1 deletioncompiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs 8 additions, 5 deletionscompiler/GHC/Settings/IO.hs
- compiler/GHC/StgToJS/Linker/Linker.hs 1 addition, 1 deletioncompiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/SysTools/Cpp.hs 29 additions, 7 deletionscompiler/GHC/SysTools/Cpp.hs
- compiler/GHC/SysTools/Tasks.hs 46 additions, 32 deletionscompiler/GHC/SysTools/Tasks.hs
- configure.ac 13 additions, 1 deletionconfigure.ac
- distrib/configure.ac.in 11 additions, 1 deletiondistrib/configure.ac.in
- hadrian/bindist/Makefile 2 additions, 0 deletionshadrian/bindist/Makefile
- hadrian/cfg/system.config.in 4 additions, 5 deletionshadrian/cfg/system.config.in
- hadrian/src/Oracles/Setting.hs 4 additions, 3 deletionshadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs 2 additions, 0 deletionshadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Builders/Ghc.hs 0 additions, 2 deletionshadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/Hsc2Hs.hs 0 additions, 1 deletionhadrian/src/Settings/Builders/Hsc2Hs.hs
- m4/fp_cpp_cmd_with_args.m4 36 additions, 76 deletionsm4/fp_cpp_cmd_with_args.m4
- m4/fp_hs_cpp_cmd_with_args.m4 98 additions, 0 deletionsm4/fp_hs_cpp_cmd_with_args.m4
- m4/fp_settings.m4 6 additions, 0 deletionsm4/fp_settings.m4
Loading
Please register or sign in to comment