Skip to content

imagemagick: Allow compilation without --with-gcc-arch#125150

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
zhaofengli:imagemagick-gcc-arch
Jun 1, 2021
Merged

imagemagick: Allow compilation without --with-gcc-arch#125150
Mic92 merged 1 commit intoNixOS:masterfrom
zhaofengli:imagemagick-gcc-arch

Conversation

@zhaofengli
Copy link
Member

Motivation for this change

The --with-gcc-arch flag is used to specify the value used for --march and --mtune [1], therefore it does not make sense to fail the evaluation simply because it's not enumerated by us. However, it's necessary to specify --without-gcc-arch, otherwise the config script will try to guess the values which leads to incompatible/non-determinstic artifacts.

I also have doubts whether some of the current values in the if arms are even correct. For example, aarch64 is not a valid value for -march/-mtune in aarch64 GCC. They "work" because the config script gracefully falls back (search for "whether C compiler accepts").

Tested by compiling imagemagick7 natively on riscv64 (with #115406 and #125132 for dependencies). A dependency of imagemagick6 does not build on riscv64 but that's a separate issue. This should not affect currently "supported" targets.

[1] https://github.com/ImageMagick/ImageMagick/blob/850d5a9fc5d8d6ae7534421737a1709efe164a77/m4/ax_gcc_archflag.m4

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/)
  • Added a release notes entry if the change is major or breaking
  • Fits CONTRIBUTING.md.

The --with-gcc-arch flag is used to specify the value used for
--march and --mtune [1], therefore it does not make sense to fail the
evaluation simply because it's not enumerated by us. However,
it's necessary to specify --without-gcc-arch, otherwise the config
script will guess the values and lead to incompatible / non-determinstic
artifacts.

[1] https://github.com/ImageMagick/ImageMagick/blob/850d5a9fc5d8d6ae7534421737a1709efe164a77/m4/ax_gcc_archflag.m4
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 1, 2021
@zhaofengli zhaofengli requested a review from dotlambda June 1, 2021 02:20
@Mic92 Mic92 merged commit f40605d into NixOS:master Jun 1, 2021
@zhaofengli zhaofengli deleted the imagemagick-gcc-arch branch June 1, 2021 05:08
@zhaofengli zhaofengli mentioned this pull request Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants