Skip to content

Commit 47b4d51

Browse files
authored
Update README.md
Notes on the `compiler-rt` magic.
1 parent a912421 commit 47b4d51

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,18 @@ assembly. Examples of the later are `__clone`, `__syscall`, `setjmp` and `longjm
5757

5858
**Note Bene:** the above works for `llvm-3.5`, for `llvm-3.8` you need to `locate`
5959
your system `libgcc.a` and add that to the list. When I figure out how to use
60-
`compiler-rt` to get around that I will mention it here.
60+
`compiler-rt` to get around that I will mention it here. OK so I finally figured
61+
out the `compiler-rt` thing. I built `llvm-3.8.1` using `wllvm` and `wllvm++`
62+
together with the projects `clang`, `compiler-rt`, `libcxx`, `libcxxabi`, and `lld`, which
63+
turned out to be pretty painless. One of the build products was `libclang_rt.builtins-x86_64.a`,
64+
from which I was able to extract `libclang_rt.builtins-x86_64.bc` using the command:
65+
```
66+
extract-bc -b libclang_rt.builtins-x86_64.a
67+
```
68+
This bitcode module has definitons for those pesky instrinsics like
69+
`__mulxc3`, `__mulsc3`, and `__muldc3`.
6170

62-
Of course this is not very interesting unless you have some fun
71+
Of course all this effort is not very interesting unless you have some fun
6372
with the bitcode before this final linking phase.
6473

6574
You can also do things like:

0 commit comments

Comments
 (0)