This is an archive of the discontinued LLVM Phabricator instance.

Allow packager to provide a default configuration file for clang
AcceptedPublic

Authored by serge-sans-paille on Nov 17 2020, 1:21 AM.

Details

Summary

Such file can be set at configuration time through -DCLANG_DEFAULT_CONFIG_FILE
and is used if no other configuration is provided.

It allows package maintainer to provide per-distribution default flags like
default gcc toolchain, linker error script etc.

Diff Detail

Event Timeline

serge-sans-paille requested review of this revision.Nov 17 2020, 1:21 AM
serge-sans-paille created this revision.
sylvestre.ledru added a comment.EditedNov 17 2020, 3:22 AM

Great idea. Do you have an example of what the configuration could look like on a distro?
Merci!

I was thinking of `-Wl,--error-handling-script=/etc/clang/linker-script.sh` or something along the line. The initial goal would be to suggest installing the asan runtime if some asan symbols are missing.

@sylvestre.ledru Can you drop the picture?

Can you give an example of how this would be used to select the gcc-toolchain?

Can you give an example of how this would be used to select the gcc-toolchain?

That would mean shipping a configuration file with a

--gcc-toolchain=/path/to/the/toolchain

@sylvestre.ledru Can you drop the picture?

Sure, this is one of the phab macro and I wasn't expecting it to be that big :)

sylvestre.ledru accepted this revision.Apr 4 2021, 9:18 AM

It would be great to:

  • provide examples
  • mention it in the release notes
  • have some tests
This revision is now accepted and ready to land.Apr 4 2021, 9:18 AM