# Is there an equivalent to cross-language link time optimization via LLVM?

**URL:** <https://discourse.julialang.org/t/is-there-an-equivalent-to-cross-language-link-time-optimization-via-llvm/135625>\
**Category:** General Usage\
**Created:** [February 13, 2026, 7:15pm UTC](https://discourse.julialang.org/t/is-there-an-equivalent-to-cross-language-link-time-optimization-via-llvm/135625 "2026-02-13T19:15:48Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [March 5, 2026, 8:37am UTC](https://discourse.julialang.org/t/is-there-an-equivalent-to-cross-language-link-time-optimization-via-llvm/135625/18 "2026-03-05T08:37:54Z")

</div>

I did a prototype ages ago, which is what the Enzyme capabilities are based off [LibBC.jl/src/LibBC.jl at master · vchuravy/LibBC.jl · GitHub](https://github.com/vchuravy/LibBC.jl/blob/master/src/LibBC.jl)

The general gist is that yes once you compile with Clang and `-fembed-bitcode` the shared library will contain a bit code section that you can read and parse.

The big challenge here is that you need to match Clang and Julia (LLVM bit code is version dependent) and you need to correctly implement the expected semantics of C/C++ (global variables being uniques).

It is something that currently works for simple libraries, but for anything large and complex it would take significant amount of work and then additional work on the infrastructure (to get shared libraries with the right bitcode). Personally I see better C++ interoperability through something like ClangCompiler.jl as a more impactful improvement.

---

_[View the full topic](https://discourse.julialang.org/t/is-there-an-equivalent-to-cross-language-link-time-optimization-via-llvm/135625)._
