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

j: fix build on darwin #97525

Merged
merged 1 commit into from Sep 9, 2020
Merged

j: fix build on darwin #97525

merged 1 commit into from Sep 9, 2020

Conversation

Luflosi
Copy link
Contributor

@Luflosi Luflosi commented Sep 9, 2020

Motivation for this change

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

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

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
@Luflosi
Copy link
Contributor Author

Luflosi commented Sep 9, 2020

I changed the condition from stdenv.isDarwin to stdenv.cc.isClang because this does not depend on the platform but on the compiler (clang).

Copy link
Member

@Synthetica9 Synthetica9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Built this on NixOS with clangStdenv. It did indeed fail before, and this commit fixes that. LGTM.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Result of nixpkgs-review pr 97525 1

1 package built:
  • j

@jonringer jonringer merged commit fbefec0 into NixOS:master Sep 9, 2020
@Synthetica9
Copy link
Member

Doesn't this still need a backport to 20.09?

@Luflosi Luflosi mentioned this pull request Sep 11, 2020
10 tasks
@Luflosi Luflosi deleted the fix-j branch September 11, 2020 09:47
@Luflosi
Copy link
Contributor Author

Luflosi commented Sep 11, 2020

Yes, indeed, I just made a PR.

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

Successfully merging this pull request may close these issues.

None yet

3 participants