[cfe-dev] Driver::GetProgramPath is unable to find programs with file extension in name
llvm.mail.list at gmail.com
Thu May 21 08:55:04 PDT 2015
We are having a problem with linker lookup on Windows.
When the driver tries to locate a program by its name, e.g. a linker, it
scans the paths provided by the toolchain using ScanDirForExecutable and
then, if fails, uses llvm::sys::findProgramByName, which on Windows
searches the CWD and system path. ScanDirForExecutable disregards file
extensions, so search in the toolchain-provided dirs on Windows fails.
llvm::sys::findProgramByName is aware of extensions via the "PATHEXT"
env variable (it also has ".exe" hardcoded). However, our linker is not
in the CWD or system path, thus search fails.
ScanDirForExecutable should respect file extenstions like
findProgramByName does. One way of doing so is to make the system
dependent llvm::sys::path::access function aware of extensions similarly
to findProgramByName. Or the whole ScanDirForExecutable can be made
system dependent and add an extension on Windows before passing the path
Does such a patch look reasonable? Any opinions / ideas will be much
More information about the cfe-dev