Skip to content

Parts of libcompiler_builtins are compiled as WX #183

@djc

Description

@djc

Similar to rust-lang/rust#34482, I still see a number of warnings like this when compiling rust-1.19.0:

 * !WX --- --- usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-701380125126dfef.rlib:chkstk.o
 * !WX --- --- usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-701380125126dfef.rlib:chkstk2.o
 * !WX --- --- usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-701380125126dfef.rlib:floatundidf.o
 * !WX --- --- usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-701380125126dfef.rlib:floatundisf.o
 * !WX --- --- usr/lib64/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-701380125126dfef.rlib:floatundixf.o

Activity

alexcrichton

alexcrichton commented on Jul 24, 2017

@alexcrichton
Member

Oh dear definitely seems like something to fix! @djc would you be up for submitting a patch for at least the easy piece, removing compilation of chkstk files on non-windows platforms?

djc

djc commented on Jul 25, 2017

@djc
Author

Uh, I guess. Do you mean like this?

diff --git a/build.rs b/build.rs
index 25cc520..787906f 100644
--- a/build.rs
+++ b/build.rs
@@ -4172,8 +4172,6 @@ mod c {
                     &[
                         "i386/ashldi3.S",
                         "i386/ashrdi3.S",
-                        "i386/chkstk.S",
-                        "i386/chkstk2.S",
                         "i386/divdi3.S",
                         "i386/floatdidf.S",
                         "i386/floatdisf.S",
@@ -4188,6 +4186,14 @@ mod c {
                         "i386/umoddi3.S",
                     ],
                 );
+                if target_os == "windows" {
+                    sources.extend(
+                        &[
+                            "i386/chkstk.S",
+                            "i386/chkstk2.S",
+                        ],
+                    );
+                }
             }
         }
alexcrichton

alexcrichton commented on Jul 25, 2017

@alexcrichton
Member

I think that should do it yeah!

If you'd like as well, it'd be awesome to add a test into this repo to ensure that we don't regress this.

djc

djc commented on Jul 25, 2017

@djc
Author

I have no clue how I'd test that, but if you can guide me along maybe I can come up with something.

alexcrichton

alexcrichton commented on Jul 25, 2017

@alexcrichton
Member

Right now the test script is just a shell script and has a few other examples, could that be added to?

added a commit that references this issue on Sep 16, 2017
DimitryAndric

DimitryAndric commented on Dec 24, 2017

@DimitryAndric

Indeed, those files should only be built for Windows. See also llvm-mirror/compiler-rt@1955731

added a commit that references this issue on Feb 23, 2025
5bba264
tgross35

tgross35 commented on May 30, 2025

@tgross35
Contributor

I don't believe this is an issue anymore, so I'm just attempting to add an object file check that this doesn't regress #934. However, I am not exactly clear on the logic here - @djc (or anyone) do you happen to know what scanelf is actually looking for, or what we should be trying to find? From the source it looks like scanelf finding object files without .note.GNU-stack , which is what I implemented, but there must be some more logic because I can't seem to create an object file that emits !WX locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @alexcrichton@djc@DimitryAndric@tgross35

      Issue actions

        Parts of libcompiler_builtins are compiled as WX · Issue #183 · rust-lang/compiler-builtins