Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modefilefree: RFC: Get C flags from toolchain
Summary: Alrighty, so I'm starting with what may be the most ambitious proposal. Haskell compilation requires passing approximately all of the C compiler flags to ghc, prefixed with `-optl`, `-optc`, or `-opta`. That was previously implemented in gen_modes.py by just using the compiler flags there. This diff proposes to instead depend on the CXX toolchain directly from the haskell toolchain and get access to the flags that way. The first problem with this is that the flags we need are just exposed in the cxx toolchain as a `cmd_args`, but that doesn't provide a convenient way to filter out the subset of the flags that we want to remove, so we have to do some `dynamic_outputs` shenanigans. Not super correct, but not the biggest problem either. The bigger issue though is that I don't actually know what the right plan for handling this is. Specifically, it's obvious that "just pass all of the C flags to ghc" is not correct (especially since this is using gcc even on clang toolchains if I'm reading things right). But I don't know how I'm supposed to distinguish either. This is particularly concerning since we expect to move more things to the toolchain in the future - what happens if sanitizer flags start showing up here? How do we make sure that people changing cxx toolchain flags in the future don't have to start learning about ghc oddities? So if there's a better suggestion for how to do this than "assume everything from the C++ toolchain works and then filter a couple things out," I'm all ears. This is just the first proposal. Reviewed By: scottcao Differential Revision: D68888352 fbshipit-source-id: 1a2aa8442f341078436745f882d8250fa514b2e5
- Loading branch information