[clang] Driver: Accept the --gcc-install-dir option multiple times (PR #71446)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 15:30:29 PST 2023


MaskRay wrote:

> The downside of the --gcc-install-dir is that you are required to specify a path that includes the gcc major version. This makes it hard to use for distributions in configuration files, because an upgrade of gcc would cause clang to stop working.

--gcc-install-dir specifying the version is by design, as otherwise there is no way to use an older GCC when the system has a newer GCC.

This proposal makes the option's semantic special, and I haven't seen a precedent before.
Usually, either the last option wins, or the all values of the "list" option apply.
This option's probing from the last semantic is quite unusual.

When your system GCC moves 12 to 13, do you remove `/usr/lib/gcc/x86_64-linux-gnu/12` and add `/usr/lib/gcc/x86_64-linux-gnu/13` atomically?

Gentoo doesn't seem to have more driver option requirement. Perhaps @mgorny @thesamesam can talk about they upgrade GCC and update Clang configuration files.


https://github.com/llvm/llvm-project/pull/71446


More information about the cfe-commits mailing list