Skip to content

Commit

Permalink
compiler-rt{6..10}: fix compilation on Darwin
Browse files Browse the repository at this point in the history
addendum to NixOS#85945
  • Loading branch information
ggreif authored and rvem committed Nov 8, 2022
1 parent 0a65477 commit c5b942a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/6/compiler-rt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ stdenv.mkDerivation {
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build.
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace cmake/config-ix.cmake \
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
'' + stdenv.lib.optionalString (useLLVM) ''
Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/7/compiler-rt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ stdenv.mkDerivation {
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build.
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace cmake/config-ix.cmake \
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
'' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/compilers/llvm/8/compiler-rt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ stdenv.mkDerivation {
# can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
# get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
# a flag and turn the flag off during the stdenv build.
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace cmake/builtin-config-ix.cmake \
--replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
'' + stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace cmake/config-ix.cmake \
--replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
'' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
Expand Down

0 comments on commit c5b942a

Please sign in to comment.