[llvm-dev] Expanding response file's base directory

Jack Andersen via llvm-dev llvm-dev at lists.llvm.org
Sat Dec 11 15:48:31 PST 2021


I am looking for thoughts on how feasible it would be to have
CommandLine.cpp's ExpandResponseFiles generate paths relative to the
response file itself. Essentially, this involves transforming a
reserved character sequence into the base path of the response file.
Of course this would be trivial to implement, but the main
consideration here is to avoid breakage for existing users. The
reserved character sequence could contain shell operator characters,
thereby eliminating the vast majority of accidental transformations. A
reserved word would reduce this probability even further.

I would like to propose "<cfgdir>" as a possibility.

This would be a valuable feature for deploying portable, non-installed
directories containing clang .cfg files and items for the toolchain to
use without further search path arguments from the user.

Use case:

```sample_target_sdk.cfg
--target=sample_target
-isystem <cfgdir>/include
-L <cfgdir>/lib
```


More information about the llvm-dev mailing list