anp / rusl

An experimental (read: DONT USE) musl libc implementation in Rust.
Other
292 stars 12 forks source link

Indicate weak linkage for symbols #15

Closed mrhota closed 7 years ago

mrhota commented 7 years ago

The items marked weak here are exactly those marked weak in musl.

It seems like rustc doesn't actually output symbols with weak linkage: this commit is inspired by rlibc, but the symbols in that create aren't output as weak even though they are marked as such in source.

In any event, marking them weak is documentation, and when/if the regression (if that's what it is) for weak linkage gets fixed, rusl will benefit.

mrhota commented 7 years ago

Fixes #11

mrhota commented 7 years ago

cc @dikaiosune

anp commented 7 years ago

Might also be good to include a comment with a link to the Rust issue which tracks this weak linkage regression?

mrhota commented 7 years ago

@dikaiosune turns out weak linkage works if we simplify it like you suggested 😄

I updated rustfmt because of a rustfmt build error with rustfmt-0.5.0 and latest stable rustc. I think it probably had to do with stabilizing macros 1.1 or something.

anp commented 7 years ago

Thanks!