liranringel / structure

Use format strings to create strongly-typed data pack/unpack interfaces
Apache License 2.0
62 stars 4 forks source link

Using structure in a binary makes it link dynamically to libstd #5

Closed birkenfeld closed 6 years ago

birkenfeld commented 6 years ago

Not sure if this is a problem with structure or the proc-macro crates it uses, but...

$ cargo new --bin rust-test; cd rust-test; cargo build
$ ldd target/debug/rust-test
        linux-vdso.so.1 =>  (0x00007ffe588e1000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007efc9077a000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007efc90572000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efc90353000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007efc9013c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efc8fd5c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007efc90bef000)

$ cargo add structure; (add "extern crate structure;" to main.rs)
$ cargo build
$ ldd target/debug/rust-test
        linux-vdso.so.1 =>  (0x00007ffdb0dc3000)
        libstd-e02a69124d8fa918.so => not found
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9702591000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f97021b1000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f97029ab000)

System: Linux amd64, Rust: stable 1.23 or nightly.

birkenfeld commented 6 years ago

Found it: https://github.com/dtolnay/proc-macro-hack/issues/13

Please update to proc-macro-hack = "0.4" to fix it.

liranringel commented 6 years ago

Hi, thanks for the report. I'm not at home, I'll probably fix it by tomorrow.

birkenfeld commented 6 years ago

Thanks!