Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Building with --cfg disable_float still generates SSE error #3

Closed
hawkw opened this issue Jan 13, 2016 · 5 comments
Closed

Building with --cfg disable_float still generates SSE error #3

hawkw opened this issue Jan 13, 2016 · 5 comments

Comments

@hawkw
Copy link

hawkw commented Jan 13, 2016

I'm trying to build libcore from this repo using a target that disables SSE. When I run rustc with --cfg disable_float, I still get LLVM ERROR: SSE register return with SSE disabled.

Here's the whole command:

$ rustc --verbose --target x86_64-unknown-none-gnu --cfg disable_float -Z no-landing-pads lib/libcore/src/lib.rs
LLVM ERROR: SSE register return with SSE disabled

And here's my x86_64-unknown-none-gnu target:

{
    "llvm-target": "x86_64-unknown-none-gnu",
    "target-endian": "little",
    "target-pointer-width": "64",
    "os": "none",
    "arch": "x86_64",
    "data-layout": "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128",
    "pre-link-args": [ "-m64" ],
    "cpu": "x86-64",
    "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2",
    "disable-redzone": true,
    "eliminate-frame-pointer": true,
    "linker-is-gnu": true,
    "no-compiler-rt": true,
    "archive-format": "gnu"
}

It's quite possible that I'm doing something wrong and this is my fault, but I'm really not sure what. Otherwise, it seems to me that there must be some floating-point code somewhere in libcore that the disable_float config doesn't disable. It's possible that something was added after the version of libcore that the patch was written against, I suppose?

Any help with this issue would be greatly appreciated. Thanks!

@phil-opp
Copy link
Owner

I'm on mobile right now, so just a guess:

Try building it using cargo, see the Readme for instructions. Config flags of rustc are different to cargo features. I think the correct flag for rustc would be something like --cfg "feature = disable_float".

@hawkw
Copy link
Author

hawkw commented Jan 13, 2016

Oh, thank you so much, that fixes it. Building with cargo works just fine. For rustc, the option you gave is almost correct, but the "disable_float" needs (escaped) quotes, so it's actually --cfg "feature = \"disable_float\"". Thank you!

@hawkw hawkw closed this as completed Jan 13, 2016
@phil-opp
Copy link
Owner

Great! Thanks for the rustc flag, maybe I should add it to the Readme.

@phil-opp
Copy link
Owner

Btw, I created the same thing for liballoc and libcollections as well. Maybe it's useful.

I plan to add some scripts to automate the needed steps. But I'm pretty busy at the moment, so it will take some time

@hawkw
Copy link
Author

hawkw commented Jan 13, 2016

Oh, neat, I hadn't realised that. I'm currently including submodules for both nightly-libcore and the main Rust repo for liballoc, libcollections, and librustc_unicode, but my project might clone much faster if I just included your repos for those libraries, since I wouldn't need to clone the entire Rust repository....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants