Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I compile code from multiple languages together with LLVM?

Can I write a program in two different languages and compile them together in one LLVM executable?

For example, part of my program is in C++, and part of it is in D.

like image 915
Victor Lyuboslavsky Avatar asked Nov 25 '25 20:11

Victor Lyuboslavsky


1 Answers

Not in the general case. Only if the languages are ABI-compatible. This is true for C and C++ to a very limited degree (extern "C" code from the C++ side), and much less so for other languages.

like image 85
Eli Bendersky Avatar answered Nov 28 '25 17:11

Eli Bendersky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!