OiO.lk Blog C# How would I use a C function from LLVM IR?
C#

How would I use a C function from LLVM IR?


What would be the correct way of writing a C function which then I link to my llvm IR program.

This is how I currently compile my program:

clang -c out.ll -o out.o
clang out.o -o out

This is roughly my C function:

void __write(char *s)

which I declare in llvm like this:

declare void @__write(i8*)

I don’t really know how to link these two as I am quite the begginer with Clang and LLVM.

I’ve searched for this topic plenty but found no clear answers so far.



You need to sign in to view this answers

Exit mobile version