-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling against libcore with a soft-float target appears to require sin/cos/sqrt since recently #52301
Comments
I think we just have to fix this in To test this upstream, maybe we could try to add some soft float targets that reproduce the issue, and then commit a fix. We will probably need a Or in other words, the real issue here is that floats are part of the language, but some operations on float require library support on some targets, and therefore those operations cannot be part of |
I believe this isn't the first of its kind for |
We're not using gc-sections, we used to, but then we ran into some issues
so we stopped :-)
…On Thu, Jul 12, 2018, 11:59 AM Alex Crichton ***@***.***> wrote:
I believe this isn't the first of its kind for libm intrinsics in
libcore, but the general story around them is "if you use --gc-sections
and don't use the code that uses the intrinsics it doesn't matter" . @alex
<https://github.com/alex> do you know if you're compiling with
--gc-sections and/or enabling that sort of flag in the linker?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52301 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAADBOYG9x15GpkF0tqkASiF9lj5ZAjLks5uF3JsgaJpZM4VMsWH>
.
|
Ah ok, in general Rust code is designed to be compiled with |
@alexcrichton I haven't dug in any depth, but adding |
@alex hm is it possible to get the full linker command line printed out by the makefiles? If these symbols are still being referenced when |
Yes, this seems right - while digging into this I noticed that Rethinking that and saying "use Also |
@alexcrichton For what it's worth,
On Travis, the corresponding command is the same except without I wonder if libcore isn't being compiled with |
@geofft FWIW it's always been the case that While items like That linker command looks like it's doing a relocatable link (producing another object file with |
I think I'm also running up against this issue, although my circumstances are slightly different:
|
@reynoldsbd I wonder if that's maybe a bug in LLD? Or maybe a version of LLD which didn't have it implemented? |
@alexcrichton I've tried a few different versions of LLD, including version 7, but the issue does not go away. Could definitely be a bug, but I'm also wondering if PE/COFF linking just has different semantics when it comes to GC'ing. According to the docs linked in my previous comment, That being said, @gnzlbg's solution of just removing the references when building via |
Can you try with the latest nightly again? The modules causing this issue have been removed, so this should have been fixed. |
@gnzlbg that did it! My issue has disappeared on the latest nightly. Thank you! |
@reynoldsbd it would be nice if you could point us to an example repo reproducing the issue, so that we can prevent it from reappearing in the future. I tried with the |
@gnzlbg not exactly a minimal repro, but I have this crate which I have confirmed is impacted by this issue. Just clone, install dependencies listed in the Readme, and I tested with |
Triage: it seems to me that maybe there's not actually a bug here, or if there is, it's much much larger than the original report. That is, designing rust codgen to not rely on |
@steveklabnik IIUC the bug was fixed more or less around here: #52301 (comment) Maybe we could add some testing to make sure that libcore compiles with |
This issue has been resolved for the purposes of building linux kernel modules for a while, so I'm fine with closing. |
Since #51695 (I believe), the project I have for compiling linux kernel modules has started failing due to
sin
/cos
/sqrt
symbols not being available: fishinabarrel/linux-kernel-module-rust#61 (comment)This uses a custom target file which is
x86_64
with+soft-float
.I believe the issue is that
stdsimd
uses thellvm.sin.*
intrinsics, and LLVM will emit a call tolibm
if the platform issoft-float
(this is speculation, but well founded I think :-)).Being able to depend on libcore without needing any additional runtime libraries is a hard requirement for compiling for targets like kernel modules. I'm not sure what the right direction for resolving this is.
The text was updated successfully, but these errors were encountered: