Skip to content

Commit 0adf2c3

Browse files
vepadulanochrisburr
authored andcommitted
Use resolved executable path for clang Driver
When ROOT passes "cling4root" as argv[0] to cling, the clang Driver computes InstalledDir as empty, causing GCC installation detection to scan "/" instead of the actual prefix. This prevents automatic sysroot detection on conda-forge, where the GCC installation and sysroot are at predictable locations relative to the binary. Use the resolved executable path (ClingBin, obtained via GetExecutablePath/proc/self/exe) for the Driver constructor so it can correctly find the GCC installation and compute the sysroot. This is an upstream of patch https://github.com/conda-forge/root-feedstock/blob/main/recipe/patches/0018-Use-resolved-executable-path-for-clang-Driver.patch Credits go to Chris Burr Co-authored-by: Chris Burr <christopher.burr@cern.ch>
1 parent 61e7f5b commit 0adf2c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Interpreter/CIFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ namespace {
14781478
}
14791479

14801480
llvm::Triple TheTriple(llvm::sys::getProcessTriple());
1481-
clang::driver::Driver Drvr(argv[0], TheTriple.getTriple(), *Diags);
1481+
clang::driver::Driver Drvr(ClingBin, TheTriple.getTriple(), *Diags);
14821482
//Drvr.setWarnMissingInput(false);
14831483
Drvr.setCheckInputsExist(false); // think foo.C(12)
14841484
llvm::ArrayRef<const char*>RF(&(argvCompile[0]), argvCompile.size());

0 commit comments

Comments
 (0)