Merge pull request #33532 from ThomasMader/ldc1.7.0

ldc: 1.5.0 -> 1.7.0
This commit is contained in:
Joachim F 2018-01-10 19:51:37 +00:00 committed by GitHub
commit 3b4ebab230
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,8 +2,8 @@
, python, libconfig, lit, gdb, unzip, darwin, bash , python, libconfig, lit, gdb, unzip, darwin, bash
, callPackage , callPackage
, bootstrapVersion ? false , bootstrapVersion ? false
, version ? "1.5.0" , version ? "1.7.0"
, ldcSha256 ? "1150sgns03vplni2wd4afk3rgw3rap8rsiipspw0rzxgki5rlr83" , ldcSha256 ? "1g8qvmlzvsp030z2rw6lis4kclsd9mlmnbim5kas0k1yr9063m3w"
}: }:
let let
@ -58,9 +58,9 @@ let
rm tests/d2/dmd-testsuite/runnable/variadic.d rm tests/d2/dmd-testsuite/runnable/variadic.d
'' ''
+ stdenv.lib.optionalString (!bootstrapVersion) '' + stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && !bootstrapVersion) ''
# https://github.com/NixOS/nixpkgs/issues/29611 # http://forum.dlang.org/thread/xtbbqthxutdoyhnxjhxl@forum.dlang.org
rm tests/sanitizers/asan_* rm -r tests/dynamiccompile
''; '';
ROOT_HOME_DIR = "$(echo ~root)"; ROOT_HOME_DIR = "$(echo ~root)";
@ -71,9 +71,6 @@ let
"phobos/std/datetime/timezone.d"; "phobos/std/datetime/timezone.d";
postPatch = '' postPatch = ''
substituteInPlace cmake/Modules/FindLLVM.cmake \
--replace "llvm_set(LIBRARY_DIRS" "#llvm_set(LIBRARY_DIRS"
substituteInPlace runtime/${datetimePath} \ substituteInPlace runtime/${datetimePath} \
--replace "import core.time;" "import core.time;import std.path;" --replace "import core.time;" "import core.time;import std.path;"
@ -97,7 +94,7 @@ let
substituteInPlace runtime/phobos/std/path.d \ substituteInPlace runtime/phobos/std/path.d \
--replace "\"/root" "\"${ROOT_HOME_DIR}" --replace "\"/root" "\"${ROOT_HOME_DIR}"
# TODO # Can be remove with front end version >= 2.078.0
substituteInPlace runtime/druntime/src/core/memory.d \ substituteInPlace runtime/druntime/src/core/memory.d \
--replace "assert(z is null);" "//assert(z is null);" --replace "assert(z is null);" "//assert(z is null);"
'' ''
@ -108,14 +105,9 @@ let
substituteInPlace gen/programs.cpp \ substituteInPlace gen/programs.cpp \
--replace "gcc" "clang" --replace "gcc" "clang"
# Was not able to compile on darwin due to "__inline_isnanl" # Was not able to compile on darwin due to "__inline_isnanl"
# being undefined. # being undefined.
substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan
''
+ stdenv.lib.optionalString (stdenv.hostPlatform.isLinux && bootstrapVersion) ''
substituteInPlace dmd2/root/port.c \
--replace "#include <bits/mathdef.h>" "#include <complex.h>"
'' ''
+ stdenv.lib.optionalString (bootstrapVersion) '' + stdenv.lib.optionalString (bootstrapVersion) ''
@ -147,7 +139,6 @@ let
"-DLDC_WITH_LLD=OFF" "-DLDC_WITH_LLD=OFF"
# Xcode 9.0.1 fixes that bug according to ldc release notes # Xcode 9.0.1 fixes that bug according to ldc release notes
"-DRT_ARCHIVE_WITH_LDC=OFF" "-DRT_ARCHIVE_WITH_LDC=OFF"
"-DLLVM_LIBRARY_DIRS=${llvm}/lib"
) )
''; '';
@ -214,7 +205,6 @@ let
"-DLDC_WITH_LLD=OFF" "-DLDC_WITH_LLD=OFF"
# Xcode 9.0.1 fixes that bug according to ldc release notes # Xcode 9.0.1 fixes that bug according to ldc release notes
"-DRT_ARCHIVE_WITH_LDC=OFF" "-DRT_ARCHIVE_WITH_LDC=OFF"
"-DLLVM_LIBRARY_DIRS=${llvm}/lib"
"-DD_COMPILER=${ldcBuild}/bin/ldmd2" "-DD_COMPILER=${ldcBuild}/bin/ldmd2"
) )
''; '';