Skip to content

Commit

Permalink
gcc: only disable aligned_alloc for darwin build/host/target platforms
Browse files Browse the repository at this point in the history
Before this change a Darwin gcc would output binaries that avoid
aligned_alloc, regardless of target platform. That's fine for Darwin
targets, but not for non-darwin targets such as pkgsCross.raspberryPi.

This change replaces the single configure flag with a flag for
each of build, host, target.

Idea by @trofi.
  • Loading branch information
eliasnaur committed Apr 16, 2023
1 parent ff3ba4b commit b9aabd8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkgs/development/compilers/gcc/common/pre-configure.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ in lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''
# - If GCC allowed implicit declaration of symbols, it would not fail during
# compilation even if the configure scripts did not check header presence.
#
+ lib.optionalString (hostPlatform.isDarwin) ''
export ac_cv_func_aligned_alloc=no
+ lib.optionalString (buildPlatform.isDarwin) ''
export build_configargs=ac_cv_func_aligned_alloc=no
'' + lib.optionalString (hostPlatform.isDarwin) ''
export host_configargs=ac_cv_func_aligned_alloc=no
'' + lib.optionalString (targetPlatform.isDarwin) ''
export target_configargs=ac_cv_func_aligned_alloc=no
''

# In order to properly install libgccjit on macOS Catalina, strip(1)
Expand Down

0 comments on commit b9aabd8

Please sign in to comment.