[RFC] Adding a default file location to config file support

As a general update: after some more updates, main branch now features more complete config support that should remain roughly compatible with existing use cases and at the same time gives Gentoo the flexibility it needs.

Config files are now loaded by default (unless --no-default-config is passed on the command-line or CLANG_NO_DEFAULT_CONFIG envvar is set to a non-empty value), also for plain clang, clang++, etc. calls without explicit triple in filename.

The default config lookup starts by trying <triple>-<driver>.cfg. If such a file is not found, it falls back to loading <triple>.cfg and <driver>.cfg, where neither has to exist.

I think the changes are too intrusive for an upstream 15.x backport but I’m planning to backport them into the next 15.x release in Gentoo via our patchset, given that we haven’t enabled config file support before, so there’s nothing to be broken ;-).

What I’d still like to happen is proper support for specifying user configuration directory — one that can account for XDG_CONFIG_HOME and the home directory. However, I don’t have a good idea how to support that.

1 Like