Closed mrhota closed 7 years ago
I had some issues with weak linkage for these symbols before (as well as malloc, free, etc) when compiling on a much older nightly. If you're able to make this work, I'd certainly be happy. Although we'd want some way to test the weak linkage on Travis now that libc-test has been submodule'd.
I'm not really sure it matters how link args are handled on Windows or Mac -- (m|r)usl only supports Linux, and even if cross compiling is useful we wouldn't want the symbols to stop being weak when cross compiling. I guess this also gets at a broader question of platform compatibility, but since Linux is the only environment I'm aware of with a stable syscall ABI, I don't see it being very useful to compile rusl for other platforms. Your thoughts?
I think the linkage feature is broken in rustc. I annotated all the symbols, just like in rlibc
, but nothing came out with weak linkage. I think there's an issue in the rust repo indicating that linkage is broken, but I can't find it now
Looks like the progress here is being tracked in https://github.com/rust-lang/rust/issues/29603, although that doesn't reference any issues which explicitly list it as broken.
Closed by #15
Musl makes the linkage of some symbols weak (using
weak_alias(foo, bar)
). Currently, the list of symbols which don't have weak linkage attributes looks like this:clock_gettime
madvise
__vm_wait
mmap
mmap64
mremap
munmap
stpcpy
Weak linkage is a feature of ELF binaries, so it's not supported in Windows or Mac OS X. It should be as simple as an attribute like so on the above functions:
And an attribute like so to enable the
linkage
feature:See the Rust reference and
rlibc
repository for more.