Skip to content
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

'-fno-strict-overflow'-warnings litter certain builds on darwin #39687

Closed
knedlsepp opened this issue Apr 29, 2018 · 8 comments
Closed

'-fno-strict-overflow'-warnings litter certain builds on darwin #39687

knedlsepp opened this issue Apr 29, 2018 · 8 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin

Comments

@knedlsepp
Copy link
Member

knedlsepp commented Apr 29, 2018

Issue description

When building C++ on darwin, oftentimes the following warning litters the logs:

clang-5.0: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
@knedlsepp knedlsepp changed the title Disable strictoverflow hardening in clangStdenv Disable strictoverflow hardening in clangStdenv (e.g. darwin) Apr 29, 2018
@knedlsepp
Copy link
Member Author

Hm. It seems the flag should actually be accepted by clang. I don't know why these warnings keep turning up though.

@knedlsepp knedlsepp changed the title Disable strictoverflow hardening in clangStdenv (e.g. darwin) '-fno-strict-overflow'-warnings litter certain builds on darwin Apr 29, 2018
@dtzWill
Copy link
Member

dtzWill commented Apr 29, 2018

It says unused, not unsupported. I think it can happen, for example, when using clang to with assembly files and such?

@knedlsepp
Copy link
Member Author

Yes, this is mostly cosmetic, I just had a look at the current Cython darwin build (in #39576), which sports an impressive number of 1828 of those warnings: https://nix-cache.s3.amazonaws.com/log/x9ff903kpnmmvf39cdw4pbp08rl30mmh-python3.6-Cython-0.28.1.drv

@matthewbauer
Copy link
Member

LOL that is a lot. It is definitely not just Nixpkgs that is doing this though (jedisct1/libsodium#201). We can definitely set -Wno-unused-command-line-argument but that runs the risk of disregarding legitimate cases of that warning.

@athas
Copy link
Contributor

athas commented Mar 13, 2020

This is breaking packages that use -Werror. What's the solution supposed to be?

@athas athas mentioned this issue Mar 13, 2020
10 tasks
@athas
Copy link
Contributor

athas commented Mar 13, 2020

To future readers, this is the solution:

hardeningDisable = ["strictoverflow"]; 

@prusnak prusnak added the 6.topic: darwin Running or building packages on Darwin label May 9, 2020
@Luflosi Luflosi mentioned this issue Sep 9, 2020
10 tasks
Luflosi added a commit to Luflosi/nixpkgs that referenced this issue Sep 9, 2020
On darwin the compilation would fail with the following warning:
```
clang-7: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument]
```
This error happens because the `-fno-strict-overflow` is passed to the compiler. To fix this, disable the `strictoverflow` hardening feature. Also see NixOS#39687.

ZHF: NixOS#97479
jonringer pushed a commit that referenced this issue Sep 9, 2020
On darwin the compilation would fail with the following warning:
```
clang-7: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument]
```
This error happens because the `-fno-strict-overflow` is passed to the compiler. To fix this, disable the `strictoverflow` hardening feature. Also see #39687.

ZHF: #97479
@stale
Copy link

stale bot commented Nov 5, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 5, 2020
jasonrm added a commit to jasonrm/nixpkgs that referenced this issue Sep 2, 2022
Support for newer versions of GCC was added in 0.6.4 https://numcodecs.readthedocs.io/en/stable/release.html#release-0-6-4

Also disable `strictoverflow` during hardening. Ref NixOS#39687
@vcunat
Copy link
Member

vcunat commented Jul 26, 2023

Should be solved generally now, via PR #243595

@vcunat vcunat closed this as completed Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

6 participants