From cfc50d81ad0b8e8026df58cf41e0b5e089b2a3db Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 5 Jul 2018 21:20:08 +0200 Subject: [PATCH] Backport two regression fixes from upstream --- ...y-on-non-x86-archs-with-64-bit-reals.patch | 35 +++++++++++++++++++ ...ine-upstream-regression-in-v-predefs.patch | 26 ++++++++++++++ ldc.spec | 4 +++ 3 files changed, 65 insertions(+) create mode 100644 0001-Fix-compilability-on-non-x86-archs-with-64-bit-reals.patch create mode 100644 0002-Fix-missing-newline-upstream-regression-in-v-predefs.patch diff --git a/0001-Fix-compilability-on-non-x86-archs-with-64-bit-reals.patch b/0001-Fix-compilability-on-non-x86-archs-with-64-bit-reals.patch new file mode 100644 index 0000000..316d7ef --- /dev/null +++ b/0001-Fix-compilability-on-non-x86-archs-with-64-bit-reals.patch @@ -0,0 +1,35 @@ +From 036e3d63037e7f8d9403526501ba95b741babc6f Mon Sep 17 00:00:00 2001 +From: Martin Kinkelin +Date: Thu, 5 Jul 2018 22:02:01 +0200 +Subject: [PATCH 1/2] Fix compilability on non-x86 archs with 64-bit reals + +--- + dmd/root/longdouble.d | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/dmd/root/longdouble.d b/dmd/root/longdouble.d +index ba6cff0..c1cbc2b 100644 +--- a/dmd/root/longdouble.d ++++ b/dmd/root/longdouble.d +@@ -10,10 +10,15 @@ + + module dmd.root.longdouble; + +-static if (real.sizeof > 8) +- alias longdouble = real; ++version(CRuntime_Microsoft) ++{ ++ static if (real.sizeof > 8) ++ alias longdouble = real; ++ else ++ alias longdouble = longdouble_soft; ++} + else +- alias longdouble = longdouble_soft; ++ alias longdouble = real; + + // longdouble_soft needed when building the backend with + // Visual C or the frontend with LDC on Windows +-- +2.17.1 + diff --git a/0002-Fix-missing-newline-upstream-regression-in-v-predefs.patch b/0002-Fix-missing-newline-upstream-regression-in-v-predefs.patch new file mode 100644 index 0000000..d8bc11e --- /dev/null +++ b/0002-Fix-missing-newline-upstream-regression-in-v-predefs.patch @@ -0,0 +1,26 @@ +From 9f5c3897e6657b8cb8bfc04b1bd55f1ec5d7446e Mon Sep 17 00:00:00 2001 +From: Martin Kinkelin +Date: Thu, 5 Jul 2018 22:04:18 +0200 +Subject: [PATCH 2/2] Fix missing newline (upstream) regression in -v predefs + output + +--- + dmd/mars.d | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dmd/mars.d b/dmd/mars.d +index 031782b..8056c04 100644 +--- a/dmd/mars.d ++++ b/dmd/mars.d +@@ -1627,7 +1627,7 @@ private void printPredefinedVersions(FILE* stream) + buf.writeByte(' '); + buf.writestring(str.toChars()); + } +- stream.fprintf("predefs %s", buf.peekString()); ++ stream.fprintf("predefs %s\n", buf.peekString()); + } + } + +-- +2.17.1 + diff --git a/ldc.spec b/ldc.spec index 6ebdca2..5b93deb 100644 --- a/ldc.spec +++ b/ldc.spec @@ -34,6 +34,10 @@ Source1: ldc-0.17.6-gita1a8a84-src.tar.gz %endif Source3: macros.%{name} +# Backported from upstream +Patch0: 0001-Fix-compilability-on-non-x86-archs-with-64-bit-reals.patch +Patch1: 0002-Fix-missing-newline-upstream-regression-in-v-predefs.patch + ExclusiveArch: %{ldc_arches} %if ! 0%{?bootstrap}