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/libc.so: invalid ELF header

Although 0.6.1 downloaded binary is working:

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

I am on Ubuntu 18.04…
I did just:

git pull
make clean
make

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:

libc.so is GNU ld script:

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

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/libc.so.6"), Int32, ())
6759930

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

0.7.0-beta.65> ccall((:clock, "libc.so.6"), Int32, ())
6900937
1 Like

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

And is it feature or bug?

Feature