Skip to content

-Zthreads changes compiled binary #117635

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Nov 6, 2023 · 6 comments
Closed

-Zthreads changes compiled binary #117635

matthiaskrgr opened this issue Nov 6, 2023 · 6 comments
Labels
A-parallel-compiler Area: parallel compiler C-bug Category: This is a bug.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Nov 6, 2023

rustc 1.75.0-nightly (e1fcecb1b 2023-11-06)
binary: rustc
commit-hash: e1fcecb1b9930f109a8c1cf2b690e03483a41289
commit-date: 2023-11-06
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.4

reproducible with both cargo and oxipng

  1. cargo build --release
    => 1816 target/release/oxipng (du -sk)
  2. RUSTFLAGS="-Zthreads=1" cargo build --release
    => 1692 target/release/oxipng

seems that Zthreads on/off has an effect on the generated binary 🤔

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. A-parallel-compiler Area: parallel compiler labels Nov 6, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 6, 2023
@lqd
Copy link
Member

lqd commented Nov 6, 2023

(note: the default is -Zthreads=1)

@saethlin
Copy link
Member

saethlin commented Nov 6, 2023

I cannot reproduce this with oxipng. I get exactly the same binary with or without -Zthreads=1.

@lqd
Copy link
Member

lqd commented Nov 6, 2023

@matthiaskrgr do you have global flags / cargo configs, that would be turned off when manually overriding RUSTFLAGS in your second example ?

@matthiaskrgr
Copy link
Member Author

OOoh yes, I totally forgot I had RUSTFLAGS="-march=native" exported via my bash rc. :D

@matthiaskrgr
Copy link
Member Author

I was already wondering why I could not reproduce this when calling rustc via a script (where RUSTFLAGS is always overridden...) lol

Sorry for the noise :D

@lqd
Copy link
Member

lqd commented Nov 6, 2023

my disappointment is immeasurable and my day is ruined :3

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-parallel-compiler Area: parallel compiler C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants