I've ported the original Java 10 codebase to @rustlang in roughly 6 days (tdd'ing all the way) and used https://github.com/emk/rust-musl-builder … to cross compile a static binary that doesn't depend on the host libc (which was too old to use)https://twitter.com/malduarte/status/1006308696211718145 …
-
Show this thread
-
Replying to @malduarte @rustlang
Note that this still depends on the host Libc as LD loader.
1 reply 0 retweets 0 likes -
What do you mean? The generated binary is as static as it gets. ldd returns "not a dynamic executable" and both hosts are X86-64. But maybe I've misunderstood your comment :)
1 reply 0 retweets 0 likes -
Replying to @malduarte @rustlang
"no dependencies" is a fallacy. you have either 1. no Address space layout randomization (ELf Type EXEC) and no plugin support 2. a dependency on libc at runtime (objdump -s -j .interp yourexe) 3. a self relocating DYN (which rust-musl-builder doesnt activate)
2 replies 0 retweets 0 likes -
Anyway, correct me if I'm wrong. if I statically link all dependencies (i.e. no shared libraries at all - which is the case as proven by ldd and objdump) I won't need the host libc for anything. That's what I originally meant and required. And worked just fine.
1 reply 0 retweets 0 likes -
Replying to @malduarte @rustlang
No. You still need the same libc you linked against at runtime for DYN relocation. Using musl static linked bins with glibc at runtime is not supported (although it works mostly)
1 reply 0 retweets 0 likes -
Replying to @arvidep @malduarte
I just statically linked a program, not huge but not trivial, and "objdump -s -j .interp" says "objdump: section '.interp' mentioned in a -j option, but not found in any input file". I don't understand why a statically linked executable would contain DYN relocations?
2 replies 0 retweets 0 likes -
Replying to @davmac314 @malduarte
Then it's a position dependant EXEC (check the elf header) which does not have ASLR or plugin loading and can't link to code compiled -fPIC (the default)
3 replies 0 retweets 0 likes -
PIE/DYN is the default on all modern OS. Some even stopped supporting EXEC, for example Android and iOS due to security and compatibility issues. DYN requires relocations to be applied before startup. The reloc is libc in .interp
1 reply 0 retweets 0 likes
Musl and OpenBSD support static PIE. No need for interp.
-
-
Linuz does too thanks to you (still requires that hack tho to make gnuld work)
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.