Stream: general

Topic: crate-type="staticlib" is broken for linux?


Luca Barbato (Dec 08 2018 at 15:22, on Zulip):

I tried currently with the stable build and the .a produced seems bogus, on macos it works as intended, anybody willing to point me where I should look at?

Luca Barbato (Dec 08 2018 at 15:24, on Zulip):
$ nm target/release/librav1e.a | grep rav1e_
0000000000000000 T rav1e_config_default
0000000000000000 T rav1e_config_parse
0000000000000000 T rav1e_config_unref
0000000000000000 T rav1e_container_sequence_header
0000000000000000 T rav1e_container_sequence_header_unref
0000000000000000 T rav1e_context_new
0000000000000000 T rav1e_context_unref
0000000000000000 T rav1e_frame_fill_plane
0000000000000000 T rav1e_frame_new
0000000000000000 T rav1e_frame_unref
0000000000000000 T rav1e_packet_unref
0000000000000000 T rav1e_receive_packet
0000000000000000 T rav1e_send_frame

vs

$ nm target/release/librav1e.so | grep rav1e_
0000000000011340 T rav1e_config_default
0000000000011440 T rav1e_config_parse
0000000000011430 T rav1e_config_unref
0000000000011a20 T rav1e_container_sequence_header
0000000000011a70 T rav1e_container_sequence_header_unref
0000000000011550 T rav1e_context_new
0000000000011600 T rav1e_context_unref
0000000000011a80 T rav1e_frame_fill_plane
00000000000117d0 T rav1e_frame_new
0000000000011810 T rav1e_frame_unref
0000000000011a10 T rav1e_packet_unref
00000000000118c0 T rav1e_receive_packet
0000000000011830 T rav1e_send_frame
nagisa (Dec 08 2018 at 16:54, on Zulip):

Seems good to me. Are you complaining about offset being shown as 0?

Luca Barbato (Dec 08 2018 at 18:15, on Zulip):

the linker complains

nagisa (Dec 08 2018 at 18:18, on Zulip):

complains how? Are you sure you pass your libraries to the linker in the right order?

Luca Barbato (Dec 08 2018 at 18:18, on Zulip):

I'm sure, the same code on macos works

Luca Barbato (Dec 08 2018 at 18:19, on Zulip):

switching from staticlib to cdylib works as well

Luca Barbato (Dec 08 2018 at 18:20, on Zulip):

it is only 1 library and the linker complains only about those symbols

Luca Barbato (Dec 08 2018 at 18:23, on Zulip):

dropping lto seems to fix it

nagisa (Dec 08 2018 at 18:27, on Zulip):

using LTO would explain it, as the static library would get filled with LLVM bytecode rather than actual machine code

nagisa (Dec 08 2018 at 18:27, on Zulip):

but the code’s there nevertheless

Luca Barbato (Dec 08 2018 at 18:37, on Zulip):

and the linker in use would not use it ^^;

Luca Barbato (Dec 08 2018 at 18:37, on Zulip):

let see if travis now is happy and I can go back chasing other funny bugs ^^

Luca Barbato (Dec 10 2018 at 10:32, on Zulip):

This is getting quite strange, I cannot it to link again and the lto is still off...

Luca Barbato (Dec 10 2018 at 10:32, on Zulip):
simple_encoding.c:(.text+0x3e): undefined reference to `rav1e_config_default'
simple_encoding.c:(.text+0x60): undefined reference to `rav1e_config_parse'
simple_encoding.c:(.text+0x6c): undefined reference to `rav1e_context_new'
simple_encoding.c:(.text+0x7c): undefined reference to `rav1e_frame_new'
simple_encoding.c:(.text+0xa8): undefined reference to `rav1e_send_frame'
simple_encoding.c:(.text+0xda): undefined reference to `rav1e_receive_packet'
simple_encoding.c:(.text+0x102): undefined reference to `rav1e_packet_unref'
simple_encoding.c:(.text+0x118): undefined reference to `rav1e_frame_unref'
simple_encoding.c:(.text+0x124): undefined reference to `rav1e_context_unref'
simple_encoding.c:(.text+0x130): undefined reference to `rav1e_config_unref'
collect2: error: ld returned 1 exit status
Luca Barbato (Dec 10 2018 at 11:50, on Zulip):

if somebody is willing to try here is the code ^^, make examples should take care of everything

Luca Barbato (Dec 10 2018 at 12:02, on Zulip):

maybe --print native-static-libs is the problem...

Luca Barbato (Dec 10 2018 at 12:02, on Zulip):

no apparently not

Last update: Nov 22 2019 at 00:40UTC