# Invalid ELF header (0.7.0 Beta built from source)

**URL:** <https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054>\
**Category:** General Usage\
**Created:** [June 29, 2018, 8:01am UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054 "2018-06-29T08:01:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [June 29, 2018, 8:01am UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054/1 "2018-06-29T08:01:53Z")

</div>

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

```julia
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:

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

```

I am on Ubuntu 18.04…  
I did just:

```julia
git pull
make clean
make

```

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [June 29, 2018, 11:41am UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054/2 "2018-06-29T11:41:37Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [June 29, 2018, 12:04pm UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054/3 "2018-06-29T12:04:29Z")

</div>

Thanks for answer! 🙂

libc.so is GNU ld script:

```julia
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:

```julia
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:

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

```

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [June 29, 2018, 1:02pm UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054/4 "2018-06-29T13:02:00Z")

</div>

> [@Liso](#):
>
> Could it be problem in 0.7?

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

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [June 30, 2018, 8:47am UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054/5 "2018-06-30T08:47:35Z")

</div>

And is it feature or bug?

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [June 30, 2018, 9:49am UTC](https://discourse.julialang.org/t/invalid-elf-header-0-7-0-beta-built-from-source/12054/6 "2018-06-30T09:49:52Z")

</div>

Feature
