Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading static libraries #280

Open
nikhilkalige opened this issue Jan 15, 2019 · 3 comments
Open

Loading static libraries #280

nikhilkalige opened this issue Jan 15, 2019 · 3 comments

Comments

@nikhilkalige
Copy link

How would you go about using .a library files in cling. I read that you can only load .so files, but in our project we have decided to use only static library files, so it would be nice if someone could point to some instructions on how to make this work..

Thanks.

@gracicot
Copy link

gracicot commented Feb 5, 2019

I second this, it would be incredibly useful to us too. We have many .a files on linux, and .lib file on windows. I did not found any info on this, sadly.

@mcraveiro
Copy link

mcraveiro commented Apr 19, 2019

Cling developers,

Thanks very much for a great tool. I also second the request by @nikhilkalige and @gracicot. I just tried loading a static library using .L and #pragma cling load and it was not very obvious to me this was not supported. This is what happens at present:

[cling]$ .L libmasd.dogen.utility.a
..L.L .L l.L li.L lib.L libm.L libma.L libmas.L libmasd.L libmasd..L libmasd.d.L libmasd.do.L libmasd.dog.L libmasd.doge.L libmasd.dogen.L libmasd.dogen..L libmasd.dogen.u.L libmasd.dogen.ut.L libmasd.dogen.uti.L libmasd.dogen.util.L libmasd.dogen.utili.L libmasd.dogen.utilit.L libmasd.dogen.utility.L libmasd.dogen.utility..L libmasd.dogen.utility.a.L libmasd.dogen.utility.a
In file included from input_line_3:1:
libmasd.dogen.utility.a:1:1: error: expected unqualified-id
!<arch>
^
libmasd.dogen.utility.a:3:1: warning: null character ignored [-Wnull-character]
<U+0000>
^
libmasd.dogen.utility.a:3:2: warning: null character ignored [-Wnull-character]
<U+0000><U+0000>
<snip>
libmasd.dogen.utility.a:4:58: warning: null character ignored [-Wnull-character]
  ...<U+0000><U+0003><E9>&<U+0000><U+0003><E9>&<U+0000><U+0003><E9>&<U+0000><U+0003><E9>&<U+0000><U+0003><E9>&<U+0000>...
     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

If these are indeed not supported, it would be better to get a "static libraries not supported at present". But, all and all, it would be really nice to be able to load static libraries.

Cheers

@Axel-Naumann
Copy link
Member

This is actually "supportable" without too much of an effort: llvm's JIT has the notion of static libs, and can load them / link them in. We "just" need a volunteer to implement his!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants