Skip to content

Instantly share code, notes, and snippets.

@metacritical
Last active September 6, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metacritical/a09678edd7fda8b6cba2df4189801b12 to your computer and use it in GitHub Desktop.
Save metacritical/a09678edd7fda8b6cba2df4189801b12 to your computer and use it in GitHub Desktop.
Clang compilation commands.

CLang -> llvm

  • clang -S -emit-llvm program.c

llvm -> assembly

  • llc program.ll -o program.s

Evaluate llvm bit code

  • lli struct.ll

Make So files from C in clang

  • clang -O3 -dynamiclib -undefined dynamic_lookup runtime.c program.s -o program.so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment