[clang] [clang-repl] Fixing vulnerabilities with respect to orc runtime (PR #165852)

Anutosh Bhat via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 31 04:16:08 PDT 2025


anutosh491 wrote:

No 3 : (proposing a fix through upcoming commits)

I see that the orc runtime on a linux machine would end up somewhere here (as in my case)
```
(test) anutosh491 at vv-nuc:/build/anutosh491/llvm-project/build/lib/clang/22/lib/x86_64-unknown-linux-gnu$ ls
liborc_rt.a
```

But on a mac machine, it might end up here (as in @kr-2003 's case)
```
/Users/abhinav/Desktop/Coding/CERN/llvm-project/build/lib/clang/20/lib/darwin/liborc_rt_osx.a
```

So we have access to these two location in the `getOrcRuntimePath` function 
https://github.com/llvm/llvm-project/blob/8ea447b4c4b007ea1c736f71e569fda621f4fdc8/clang/lib/Interpreter/Interpreter.cpp#L395-L399

`getCompilerRTPath` equates to `<ResourceDir>/lib/<OSLibName>` 
`getRuntimePath` equates to `<ResourceDir>/lib/<triple>/`

And the orc runtime can be present in one of these 2 locations but `getOrcRuntimePath` just searches `getCompilerRTPath` for now !

https://github.com/llvm/llvm-project/blob/8ea447b4c4b007ea1c736f71e569fda621f4fdc8/clang/lib/Interpreter/Interpreter.cpp#L405-L415

We need to update this to prioritise both !

https://github.com/llvm/llvm-project/pull/165852


More information about the cfe-commits mailing list