Displaying 6 results from an estimated 6 matches for "camlruntime__rt_puts_198".
2010 Apr 05
3
[LLVMdev] Linking with C Library
...c to
ocamlopt:
ocamlopt -cc g++ -ccopt -rdynamic -linkall $(LIBFILES) -o alpha $(OBJFILES)
I've also tried writing a dummy "puts" function in a C file and linking that
with my executable. nm -D then shows the following:
000000000054b690 T camlRuntime__rt_fputs_208
000000000054b590 T camlRuntime__rt_puts_198
U fputs
0000000000c43044 T puts
However, LLVM *still* gives me:
LLVM ERROR: Tried to execute an unknown external function: i32 (i8*)* puts
Something really wrong is happening. The following thread seems to indicate
that this should all work easily:
http://old.nabble.com/jit-with-...
2010 Apr 05
2
[LLVMdev] Linking with C Library
I tried running nm - D | grep "puts" on the binary compiled by the OCaml
compiler. It outputs the following:
08161b00 T camlRuntime__rt_fputs_208
08161a20 T camlRuntime__rt_puts_198
U fputs
I'm assuming this means that fputs is linked dynamically, and puts is
not. I tried modifying my code to use fputs instead of puts instead, but
had no success, however, I still get:
LLVM ERROR: Tried to execute an unknown external function: i32 (i8*,
i32)* fputs
There has...
2010 Apr 06
0
[LLVMdev] Linking with C Library
...g++ -ccopt -rdynamic -linkall $(LIBFILES) -o alpha $(OBJFILES)
>
> I've also tried writing a dummy "puts" function in a C file and linking that
> with my executable. nm -D then shows the following:
>
> 000000000054b690 T camlRuntime__rt_fputs_208
> 000000000054b590 T camlRuntime__rt_puts_198
> U fputs
> 0000000000c43044 T puts
>
> However, LLVM *still* gives me:
> LLVM ERROR: Tried to execute an unknown external function: i32 (i8*)* puts
>
> Something really wrong is happening. The following thread seems to indicate
> that this should all work ea...
2010 Apr 05
0
[LLVMdev] Linking with C Library
On Sun, Apr 4, 2010 at 5:24 PM, Maxime Chevalier-Boisvert
<mcheva at cs.mcgill.ca> wrote:
> I tried running nm - D | grep "puts" on the binary compiled by the OCaml
> compiler. It outputs the following:
>
> 08161b00 T camlRuntime__rt_fputs_208
> 08161a20 T camlRuntime__rt_puts_198
> U fputs
>
> I'm assuming this means that fputs is linked dynamically, and puts is not.
Don't assume; ask `man nm`.
http://www.linuxcommand.org/man_pages/nm1.html says that a 'U' in that
column means "The symbol is undefined." (It's there so the dynam...
2010 Apr 04
0
[LLVMdev] Linking with C Library
In C, on Linux, you would have to link your JIT compiler with
-rdynamic or -Wl,-export-dynamic (they're synonyms). I'm not sure what
the equivalent linker flag is for OCaml.
You can see what symbols are available to the JIT with `nm -D`.
On Sun, Apr 4, 2010 at 8:41 AM, Nyx <mcheva at cs.mcgill.ca> wrote:
>
> I'm coding a JIT compiler for C source in OCaml, using LLVM.
2010 Apr 04
2
[LLVMdev] Linking with C Library
I'm coding a JIT compiler for C source in OCaml, using LLVM. I'm pretty much
done with the LLVM code generation. The problem is that I can't seem to call
C library functions. I was told that all I needed to do to be able to link
with libc functions was to declare them in my module and give them external
linkage, but this does not seem to work. Please note that this is a JIT
compiler. I