Invalid ELF header (0.7.0 Beta built from source)


I get error when using ccall in 0.7.0 built from source:

0.7.0-beta.65> ccall((:clock, "libc"), Int32, ())
ERROR: error compiling top-level scope: could not load library "libc"
/usr/lib/x86_64-linux-gnu/ invalid ELF header

Although 0.6.1 downloaded binary is working:

0.6.1> ccall((:clock, "libc"), Int32, ())

I am on Ubuntu 18.04…
I did just:

git pull
make clean


You now need to provide the full name of the library (not the full path, just the full name). In this case though, just get rid of the "libc" should work.

The linker lookup function is moved to BinDeps I believe. I’ve got very mixed feeling about where this function should be so I’m not going to comment about it…


Thanks for answer! :slight_smile: is GNU ld script:

shell> cat /usr/lib/x86_64-linux-gnu/
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
GROUP ( /lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/libc_nonshared.a  AS_NEEDED ( /lib/x86_64-linux-gnu/ ) )

Could it be problem in 0.7?

If I use full target it works on Julia 0.7 too:

0.7.0-beta.65> ccall((:clock, "/lib/x86_64-linux-gnu/"), Int32, ())

Using just full name (as you said) is working too:

0.7.0-beta.65> ccall((:clock, ""), Int32, ())


That’s what I meant by “You now need to …”


And is it feature or bug?