Comment 17 for bug 2049904

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

> and it's rustc itself that emits `-lc` at the wrong location.

My reading of the issue is that Meson does not specify anything regarding `-lc`, but `rustc` adds it by itself. Is this correct?

If yes and Meson starts putting `-Clink-arg=-lc` on the command line, does `rustc` still add its own `-lc` or not?

Depending on the answers to the questions above, there may be two different bugs at play:

1. `rustc` puts its own `-lc` in the wrong place
2. Meson does not tell `rustc` that the libraries it is linking against need to be linked against the C runtime lib

If the bug is the former, then it should be fixed in `rustc`. If it is the latter then it should arguably be fixed in Meson. Even in this case it would be better for `rustc` to have a compiler argument like `--link-against-system-C-library` as opposed to a plain `-lc` because it is more declarative than imperative.

In any case it would be nice to get comments from `rustc` developers or maintainers. I don't know any and I don't think they have commented on this issue.