public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/dotnet:master commit in: dev-dotnet/dotnet-cli/, dev-dotnet/dotnet-cli/files/
@ 2016-07-14  6:29 Heather Cynede
  0 siblings, 0 replies; 4+ messages in thread
From: Heather Cynede @ 2016-07-14  6:29 UTC (permalink / raw
  To: gentoo-commits

commit:     d87c297e46e25d032b4fed630429d28f663f0028
Author:     Ben Sagal <bsagal <AT> gmail <DOT> com>
AuthorDate: Wed Jul 13 08:00:07 2016 +0000
Commit:     Heather Cynede <cynede <AT> gentoo <DOT> org>
CommitDate: Wed Jul 13 08:06:43 2016 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=d87c297e

Add dev-dotnet/dotnet-cli (bug #148)

 .../dotnet-cli-1.0.0_pre2_p003121.ebuild           | 125 +++++++++++++++++++++
 .../coreclr-1.0.0-gcc6-github-pull-5304.patch      |  28 +++++
 .../files/coreclr-1.0.0-icu57-commit-352df35.patch |  42 +++++++
 .../coreclr-1.0.0-segv-github-pull-6027.patch      |  59 ++++++++++
 dev-dotnet/dotnet-cli/metadata.xml                 |   8 ++
 5 files changed, 262 insertions(+)

diff --git a/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003121.ebuild b/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003121.ebuild
new file mode 100644
index 0000000..0211db9
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003121.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#BASED ON https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=dotnet-cli
+
+EAPI="6"
+
+BASE_PV=${PV%_p*}
+P_BUILD=${PV##*_p}
+DIST='debian-x64'
+
+MY_BASE_PV=${BASE_PV/_pre/-preview}
+
+MY_PV=${MY_BASE_PV}-${P_BUILD}
+MY_P=${PN}-${MY_PV}
+
+CORE_V=${PV%%_*}
+
+CORECLR_N=coreclr-${CORE_V}
+COREFX_N=corefx-${CORE_V}
+
+DESCRIPTION="A command line utility for building, testing, packaging and running .NET Core applications and libraries"
+HOMEPAGE="https://www.microsoft.com/net/core"
+LICENSE="MIT"
+
+IUSE=""
+SRC_URI="https://github.com/dotnet/coreclr/archive/v${CORE_V}.tar.gz -> ${CORECLR_N}.tar.gz
+    https://github.com/dotnet/corefx/archive/v${CORE_V}.tar.gz -> ${COREFX_N}.tar.gz
+    https://download.microsoft.com/download/1/5/2/1523EBE1-3764-4328-8961-D1BD8ECA9295/dotnet-dev-${DIST}.${MY_PV}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+    >=sys-devel/llvm-3.7.1-r3[lldb]
+    >=sys-libs/libunwind-1.1-r1
+    >=dev-libs/icu-57.1
+    >=dev-util/lttng-ust-2.8.1
+    >=dev-libs/openssl-1.0.2h-r2
+    >=net-misc/curl-7.49.0"
+DEPEND="${RDEPEND}
+    >=dev-util/cmake-3.3.1-r1
+    >=sys-devel/make-4.1-r1
+    >=sys-devel/clang-3.7.1-r100
+    >=sys-devel/gettext-0.19.7"
+
+PATCHES=(
+	"${FILESDIR}/${CORECLR_N}-icu57-commit-352df35.patch"
+	"${FILESDIR}/${CORECLR_N}-gcc6-github-pull-5304.patch"
+	"${FILESDIR}/${CORECLR_N}-segv-github-pull-6027.patch"
+)
+
+S=${WORKDIR}
+CLI_S="${S}/dotnet_cli"
+CORECLR_S="${S}/${CORECLR_N}"
+COREFX_S="${S}/${COREFX_N}"
+
+CORECLR_FILES=(
+    'libclrjit.so'
+    'libcoreclr.so'
+    'libcoreclrtraceptprovider.so'
+    'libdbgshim.so'
+    'libmscordaccore.so'
+    'libmscordbi.so'
+    'libsos.so'
+    'libsosplugin.so'
+    'System.Globalization.Native.so'
+)
+
+COREFX_FILES=(
+    'System.IO.Compression.Native.so'
+    'System.Native.a'
+    'System.Native.so'
+    'System.Net.Http.Native.so'
+    'System.Net.Security.Native.so'
+    'System.Security.Cryptography.Native.so'
+)
+
+src_unpack() {
+    unpack "${CORECLR_N}.tar.gz" "${COREFX_N}.tar.gz"
+    mkdir "${CLI_S}" || die
+    cd "${CLI_S}" || die
+    unpack "dotnet-dev-${DIST}.${MY_PV}.tar.gz"
+}
+
+src_prepare() {
+    for file in "${CORECLR_FILES[@]}"; do
+        rm "${CLI_S}/shared/Microsoft.NETCore.App/${CORE_V}/${file}"
+    done
+    for file in "${COREFX_FILES[@]}"; do
+        rm "${CLI_S}/shared/Microsoft.NETCore.App/${CORE_V}/${file}"
+    done
+    default_src_prepare
+}
+
+src_compile() {
+    cd "${S}/${CORECLR_N}" || die
+    ./build.sh x64 release || die
+
+    cd "${S}/${COREFX_N}" || die
+    ./build.sh native x64 release || die
+}
+
+
+src_install() {
+    
+    local dest="/opt/dotnet_cli"
+    local ddest="${D}/${dest}"
+    local ddest_core="${ddest}/shared/Microsoft.NETCore.App/${CORE_V}/"
+    
+    dodir "${dest}"
+    cp -pPR "${CLI_S}"/* "${ddest}" || die
+
+    for file in "${CORECLR_FILES[@]}"; do
+        cp -pP "${CORECLR_S}/bin/Product/Linux.x64.Release/${file}" "${ddest_core}" || die
+    done
+    
+    for file in "${COREFX_FILES[@]}"; do
+        cp -pP "${COREFX_N}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}" || die
+    done
+    
+    dosym "../../opt/dotnet_cli/dotnet" "/usr/bin/dotnet"
+    
+}

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-gcc6-github-pull-5304.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-gcc6-github-pull-5304.patch
new file mode 100644
index 0000000..872c539
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-gcc6-github-pull-5304.patch
@@ -0,0 +1,28 @@
+From 41912e3adb789b62f4cb46acffe915b6f1ab0e1e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= <juergen@hoetzel.info>
+Date: Mon, 30 May 2016 11:45:49 +0200
+Subject: [PATCH] Don't use libstdc++ wrappers for stdlib.h (#5304)
+
+This prevents #undef of min/max macros. Refs #5006.
+---
+ src/pal/src/include/pal/palinternal.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h
+index 4c01be8..fdebc8d 100644
+--- a/coreclr-1.0.0/src/pal/src/include/pal/palinternal.h
++++ b/coreclr-1.0.0/src/pal/src/include/pal/palinternal.h
+@@ -567,6 +567,10 @@ function_name() to call the system's implementation
+ #endif
+ #include <ctype.h>
+ 
++// Don't use C++ wrappers for stdlib.h
++// https://gcc.gnu.org/ml/libstdc++/2016-01/msg00025.html 
++#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 1
++
+ #define _WITH_GETLINE
+ #include <stdio.h>
+ #include <stdlib.h>
+-- 
+2.9.0
+

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-icu57-commit-352df35.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-icu57-commit-352df35.patch
new file mode 100644
index 0000000..d16369c
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-icu57-commit-352df35.patch
@@ -0,0 +1,42 @@
+From 352df35c124104586ee4c977556cb50ce720af62 Mon Sep 17 00:00:00 2001
+From: Peter Jas <necmon@yahoo.com>
+Date: Mon, 30 May 2016 12:54:02 +0300
+Subject: [PATCH] Fix ucol_setMaxVariable detection for Gentoo Linux (#5309)
+
+The issue was the symbol is exported by the ICU lib. Including headers
+was not enough. The linker requires the libraries to succeed.
+
+With this fix, CoreCLR successfully builds on Gentoo Linux 100%.
+Tested with LXC gentoo container on Ubuntu machine.
+
+Steps to configure and build:
+https://gist.github.com/jasonwilliams200OK/1a2e2c0e904ffa95faf6333fcd88d9b8
+
+Fix #5160
+---
+ src/corefx/System.Globalization.Native/configure.cmake | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/corefx/System.Globalization.Native/configure.cmake b/src/corefx/System.Globalization.Native/configure.cmake
+index 4250c7c..138127e 100644
+--- a/coreclr-1.0.0/src/corefx/System.Globalization.Native/configure.cmake
++++ b/coreclr-1.0.0/src/corefx/System.Globalization.Native/configure.cmake
+@@ -8,11 +8,18 @@ CHECK_CXX_SOURCE_COMPILES("
+     int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
+ " HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
+ 
++if(NOT CLR_CMAKE_PLATFORM_DARWIN)
++    set(CMAKE_REQUIRED_LIBRARIES ${ICUUC} ${ICUI18N})
++else()
++    set(CMAKE_REQUIRED_LIBRARIES ${ICUCORE})
++endif()
++
+ check_symbol_exists(
+     ucol_setMaxVariable
+     "unicode/ucol.h"
+     HAVE_SET_MAX_VARIABLE)
+ 
++unset(CMAKE_REQUIRED_LIBRARIES)
+ unset(CMAKE_REQUIRED_INCLUDES)
+ 
+ configure_file(

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-segv-github-pull-6027.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-segv-github-pull-6027.patch
new file mode 100644
index 0000000..5d07157
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.0-segv-github-pull-6027.patch
@@ -0,0 +1,59 @@
+From 56ab756b0e9afef24cf9151a4a43f23e8d78de29 Mon Sep 17 00:00:00 2001
+From: Jan Vorlicek <janvorli@microsoft.com>
+Date: Tue, 28 Jun 2016 21:34:04 +0200
+Subject: [PATCH] Fix Windows context to Unix context translation on AMD64
+ (#6027)
+
+There was a bug in the context translation between the Windows context
+and Unix context on AMD64 caused by the fact that the Unix context
+gregs array contains CS, GS and FS in a single field (REG_CSGSFS) and
+the MCREG_SegCs accessor macro was incorrectly written to use the
+whole field as CS. So writing the CS into the Unix context also
+cleared the GS, FS and the topmost 16 bits described as padding.
+This issue was exposed on the Linux kernel >= 4.6.0 where the padding
+for some reason was not zero, probably used by the kernel for some
+internal purposes.
+I have fixed it by changing the accessor to modify only the 16 bits
+corresponding to the CS.
+I have also changed the code in the inject_activation_handler to
+save cycles and not to copy the Windows context back to the Unix one
+in case the activation function was not called and so the context
+was not possibly changed.
+---
+ src/pal/src/exception/signal.cpp  | 5 ++---
+ src/pal/src/include/pal/context.h | 2 +-
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
+index dc26ee4..adeada1 100644
+--- a/coreclr-1.0.0/src/pal/src/exception/signal.cpp
++++ b/coreclr-1.0.0/src/pal/src/exception/signal.cpp
+@@ -464,10 +464,9 @@ static void inject_activation_handler(int code, siginfo_t *siginfo, void *contex
+         if (g_safeActivationCheckFunction(CONTEXTGetPC(&winContext), /* checkingCurrentThread */ TRUE))
+         {
+             g_activationFunction(&winContext);
++            // Activation function may have modified the context, so update it.
++            CONTEXTToNativeContext(&winContext, ucontext);
+         }
+-
+-        // Activation function may have modified the context, so update it.
+-        CONTEXTToNativeContext(&winContext, ucontext);
+     }
+     else if (g_previous_activation.sa_sigaction != NULL)
+     {
+diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h
+index 7591703..6f1b3fe 100644
+--- a/coreclr-1.0.0/src/pal/src/include/pal/context.h
++++ b/coreclr-1.0.0/src/pal/src/include/pal/context.h
+@@ -111,7 +111,7 @@ typedef ucontext_t native_context_t;
+ #define MCREG_Rax(mc)       ((mc).gregs[REG_RAX])
+ #define MCREG_Rip(mc)       ((mc).gregs[REG_RIP])
+ #define MCREG_Rsp(mc)       ((mc).gregs[REG_RSP])
+-#define MCREG_SegCs(mc)     ((mc).gregs[REG_CSGSFS])
++#define MCREG_SegCs(mc)     (*(WORD*)&((mc).gregs[REG_CSGSFS]))
+ #define MCREG_R8(mc)        ((mc).gregs[REG_R8])
+ #define MCREG_R9(mc)        ((mc).gregs[REG_R9])
+ #define MCREG_R10(mc)       ((mc).gregs[REG_R10])
+-- 
+2.9.0
+

diff --git a/dev-dotnet/dotnet-cli/metadata.xml b/dev-dotnet/dotnet-cli/metadata.xml
new file mode 100644
index 0000000..b1262f1
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>dotnet@gentoo.org</email>
+		<description>Gentoo Dotnet Project</description>
+	</maintainer>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/dotnet:master commit in: dev-dotnet/dotnet-cli/, dev-dotnet/dotnet-cli/files/
@ 2016-09-19 13:16 Mikhail Pukhlikov
  0 siblings, 0 replies; 4+ messages in thread
From: Mikhail Pukhlikov @ 2016-09-19 13:16 UTC (permalink / raw
  To: gentoo-commits

commit:     b52fa659442ac3afa6a16a1af96698cefd353e59
Author:     Ben Sagal <bsagal <AT> gmail <DOT> com>
AuthorDate: Mon Sep 19 13:02:33 2016 +0000
Commit:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
CommitDate: Mon Sep 19 13:02:33 2016 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=b52fa659

Add dontnet-cli 1.0.0-preview2-003131 for .NET core 1.0.1
closes gentoo/dotnet#242

 .../dotnet-cli-1.0.0_pre2_p003131.ebuild           | 127 +++++++++++++++++++++
 .../coreclr-1.0.4-gcc6-github-pull-5304.patch      |  28 +++++
 .../files/coreclr-1.0.4-icu57-commit-352df35.patch |  42 +++++++
 3 files changed, 197 insertions(+)

diff --git a/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003131.ebuild b/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003131.ebuild
new file mode 100644
index 0000000..fc0d624
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/dotnet-cli-1.0.0_pre2_p003131.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#BASED ON https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=dotnet-cli
+
+EAPI="6"
+
+CORE_V=1.0.1
+CORECLR_V=1.0.4
+COREFX_V=1.0.0
+
+BASE_PV=${PV%_p*}
+P_BUILD=${PV##*_p}
+DIST='debian-x64'
+
+MY_BASE_PV=${BASE_PV/_pre/-preview}
+
+MY_PV=${MY_BASE_PV}-${P_BUILD}
+MY_P=${PN}-${MY_PV}
+
+
+CORECLR=coreclr-${CORECLR_V}
+COREFX=corefx-${COREFX_V}
+
+DESCRIPTION=".NET Core cli utility for building, testing, packaging and running projects"
+HOMEPAGE="https://www.microsoft.com/net/core"
+LICENSE="MIT"
+
+IUSE=""
+SRC_URI="https://github.com/dotnet/coreclr/archive/v${CORECLR_V}.tar.gz -> ${CORECLR}.tar.gz
+	https://github.com/dotnet/corefx/archive/v${COREFX_V}.tar.gz -> ${COREFX}.tar.gz
+	https://download.microsoft.com/download/1/5/2/1523EBE1-3764-4328-8961-D1BD8ECA9295/dotnet-dev-${DIST}.${MY_PV}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	>=sys-devel/llvm-3.7.1-r3[lldb]
+	>=sys-libs/libunwind-1.1-r1
+	>=dev-libs/icu-57.1
+	>=dev-util/lttng-ust-2.8.1
+	>=dev-libs/openssl-1.0.2h-r2
+	>=net-misc/curl-7.49.0
+	>=app-crypt/mit-krb5-1.14.2
+	>=sys-libs/zlib-1.2.8-r1 "
+DEPEND="${RDEPEND}
+	>=dev-util/cmake-3.3.1-r1
+	>=sys-devel/make-4.1-r1
+	>=sys-devel/clang-3.7.1-r100
+	>=sys-devel/gettext-0.19.7"
+
+PATCHES=(
+	"${FILESDIR}/${CORECLR}-icu57-commit-352df35.patch"
+	"${FILESDIR}/${CORECLR}-gcc6-github-pull-5304.patch"
+)
+
+S=${WORKDIR}
+CLI_S="${S}/dotnet_cli"
+CORECLR_S="${S}/${CORECLR}"
+COREFX_S="${S}/${COREFX}"
+
+CORECLR_FILES=(
+	'libclrjit.so'
+	'libcoreclr.so'
+	'libcoreclrtraceptprovider.so'
+	'libdbgshim.so'
+	'libmscordaccore.so'
+	'libmscordbi.so'
+	'libsos.so'
+	'libsosplugin.so'
+	'System.Globalization.Native.so'
+)
+
+COREFX_FILES=(
+	'System.IO.Compression.Native.so'
+	'System.Native.a'
+	'System.Native.so'
+	'System.Net.Http.Native.so'
+	'System.Net.Security.Native.so'
+	'System.Security.Cryptography.Native.so'
+)
+
+src_unpack() {
+	unpack "${CORECLR}.tar.gz" "${COREFX}.tar.gz"
+	mkdir "${CLI_S}" || die
+	cd "${CLI_S}" || die
+	unpack "dotnet-dev-${DIST}.${MY_PV}.tar.gz"
+}
+
+src_prepare() {
+	for file in "${CORECLR_FILES[@]}"; do
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/${CORE_V}/${file}"
+	done
+	for file in "${COREFX_FILES[@]}"; do
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/${CORE_V}/${file}"
+	done
+	default_src_prepare
+}
+
+src_compile() {
+	cd "${S}/${CORECLR}" || die
+	./build.sh x64 release || die
+
+	cd "${S}/${COREFX}" || die
+	./build.sh native x64 release || die
+}
+
+src_install() {
+	local dest="/opt/dotnet_cli"
+	local ddest="${D}/${dest}"
+	local ddest_core="${ddest}/shared/Microsoft.NETCore.App/${CORE_V}/"
+
+	dodir "${dest}"
+	cp -pPR "${CLI_S}"/* "${ddest}" || die
+
+	for file in "${CORECLR_FILES[@]}"; do
+		cp -pP "${CORECLR}/bin/Product/Linux.x64.Release/${file}" "${ddest_core}" || die
+	done
+
+	for file in "${COREFX_FILES[@]}"; do
+		cp -pP "${COREFX}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}" || die
+	done
+
+	dosym "../../opt/dotnet_cli/dotnet" "/usr/bin/dotnet"
+
+}

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.4-gcc6-github-pull-5304.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.4-gcc6-github-pull-5304.patch
new file mode 100644
index 0000000..4455740
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.4-gcc6-github-pull-5304.patch
@@ -0,0 +1,28 @@
+From 41912e3adb789b62f4cb46acffe915b6f1ab0e1e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=BCrgen=20H=C3=B6tzel?= <juergen@hoetzel.info>
+Date: Mon, 30 May 2016 11:45:49 +0200
+Subject: [PATCH] Don't use libstdc++ wrappers for stdlib.h (#5304)
+
+This prevents #undef of min/max macros. Refs #5006.
+---
+ src/pal/src/include/pal/palinternal.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h
+index 4c01be8..fdebc8d 100644
+--- a/coreclr-1.0.4/src/pal/src/include/pal/palinternal.h
++++ b/coreclr-1.0.4/src/pal/src/include/pal/palinternal.h
+@@ -567,6 +567,10 @@ function_name() to call the system's implementation
+ #endif
+ #include <ctype.h>
+ 
++// Don't use C++ wrappers for stdlib.h
++// https://gcc.gnu.org/ml/libstdc++/2016-01/msg00025.html 
++#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 1
++
+ #define _WITH_GETLINE
+ #include <stdio.h>
+ #include <stdlib.h>
+-- 
+2.9.0
+

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.4-icu57-commit-352df35.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.4-icu57-commit-352df35.patch
new file mode 100644
index 0000000..1b4797d
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.4-icu57-commit-352df35.patch
@@ -0,0 +1,42 @@
+From 352df35c124104586ee4c977556cb50ce720af62 Mon Sep 17 00:00:00 2001
+From: Peter Jas <necmon@yahoo.com>
+Date: Mon, 30 May 2016 12:54:02 +0300
+Subject: [PATCH] Fix ucol_setMaxVariable detection for Gentoo Linux (#5309)
+
+The issue was the symbol is exported by the ICU lib. Including headers
+was not enough. The linker requires the libraries to succeed.
+
+With this fix, CoreCLR successfully builds on Gentoo Linux 100%.
+Tested with LXC gentoo container on Ubuntu machine.
+
+Steps to configure and build:
+https://gist.github.com/jasonwilliams200OK/1a2e2c0e904ffa95faf6333fcd88d9b8
+
+Fix #5160
+---
+ src/corefx/System.Globalization.Native/configure.cmake | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/corefx/System.Globalization.Native/configure.cmake b/src/corefx/System.Globalization.Native/configure.cmake
+index 4250c7c..138127e 100644
+--- a/coreclr-1.0.4/src/corefx/System.Globalization.Native/configure.cmake
++++ b/coreclr-1.0.4/src/corefx/System.Globalization.Native/configure.cmake
+@@ -8,11 +8,18 @@ CHECK_CXX_SOURCE_COMPILES("
+     int main() { UDateFormatSymbolType e = UDAT_STANDALONE_SHORTER_WEEKDAYS; }
+ " HAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS)
+ 
++if(NOT CLR_CMAKE_PLATFORM_DARWIN)
++    set(CMAKE_REQUIRED_LIBRARIES ${ICUUC} ${ICUI18N})
++else()
++    set(CMAKE_REQUIRED_LIBRARIES ${ICUCORE})
++endif()
++
+ check_symbol_exists(
+     ucol_setMaxVariable
+     "unicode/ucol.h"
+     HAVE_SET_MAX_VARIABLE)
+ 
++unset(CMAKE_REQUIRED_LIBRARIES)
+ unset(CMAKE_REQUIRED_INCLUDES)
+ 
+ configure_file(


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/dotnet:master commit in: dev-dotnet/dotnet-cli/, dev-dotnet/dotnet-cli/files/
@ 2017-06-02  8:19 Mikhail Pukhlikov
  0 siblings, 0 replies; 4+ messages in thread
From: Mikhail Pukhlikov @ 2017-06-02  8:19 UTC (permalink / raw
  To: gentoo-commits

commit:     ee52140d054d1c8b65b864c1357075707891869a
Author:     Nexie Kind <nexion.hellborn <AT> gmail <DOT> com>
AuthorDate: Mon May  1 17:23:17 2017 +0000
Commit:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
CommitDate: Mon May  1 17:23:17 2017 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=ee52140d

Compatibility with gcc6 / clang3.9

 dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r1.ebuild   |   4 +
 .../coreclr-1.0.6-clang39-commit-9db7fb1.patch     | 115 +++++++++++++++++++++
 .../files/coreclr-1.0.6-gcc6-clang39.patch         |  26 +++++
 .../coreclr-1.1.1-clang39-commit-9db7fb1.patch     | 115 +++++++++++++++++++++
 .../files/coreclr-1.1.1-exceptionhandling.patch    |  11 ++
 5 files changed, 271 insertions(+)

diff --git a/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r1.ebuild b/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r1.ebuild
index abcb719..b4bb750 100644
--- a/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r1.ebuild
+++ b/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r1.ebuild
@@ -46,7 +46,11 @@ DEPEND="${RDEPEND}
 	>=sys-devel/gettext-0.19.7"
 
 PATCHES=(
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-gcc6-clang39.patch"
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-clang39-commit-9db7fb1.patch"
 	"${FILESDIR}/coreclr-${CORECLR_V1_0}-icu57-commit-352df35.patch"
+	"${FILESDIR}/coreclr-${PV}-clang39-commit-9db7fb1.patch"
+	"${FILESDIR}/coreclr-${PV}-exceptionhandling.patch"
 	"${FILESDIR}/corefx-${PV}-init-tools-script.patch"
 	"${FILESDIR}/corefx-${PV}-run-script.patch"
 )

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-clang39-commit-9db7fb1.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-clang39-commit-9db7fb1.patch
new file mode 100644
index 0000000..5f243bb
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-clang39-commit-9db7fb1.patch
@@ -0,0 +1,115 @@
+diff --git a/coreclr-1.0.6/src/debug/daccess/dacdbiimpl.cpp b/coreclr-1.0.6/src/debug/daccess/dacdbiimpl.cpp
+index 26e3d6c..59f217c 100644
+--- a/coreclr-1.0.6/src/debug/daccess/dacdbiimpl.cpp
++++ b/coreclr-1.0.6/src/debug/daccess/dacdbiimpl.cpp
+@@ -90,7 +90,6 @@ IDacDbiInterface::IAllocator * g_pAllocator = NULL;
+ //
+ 
+ // Need a class to serve as a tag that we can use to overload New/Delete.
+-#define forDbi (*(forDbiWorker *)NULL)
+ 
+ void * operator new(size_t lenBytes, const forDbiWorker &)
+ {
+diff --git a/coreclr-1.0.6/src/debug/ee/debugger.h b/coreclr-1.0.6/src/debug/ee/debugger.h
+index 6368647..59d1e66 100644
+--- a/coreclr-1.0.6/src/debug/ee/debugger.h
++++ b/coreclr-1.0.6/src/debug/ee/debugger.h
+@@ -3512,10 +3512,10 @@ class DebuggerEval
+  * ------------------------------------------------------------------------ */
+ 
+ class InteropSafe {};
+-#define interopsafe (*(InteropSafe*)NULL)
++SELECTANY InteropSafe interopsafe;
+ 
+ class InteropSafeExecutable {};
+-#define interopsafeEXEC (*(InteropSafeExecutable*)NULL)
++SELECTANY InteropSafeExecutable interopsafeEXEC;
+ 
+ #ifndef DACCESS_COMPILE
+ inline void * __cdecl operator new(size_t n, const InteropSafe&)
+diff --git a/coreclr-1.0.6/src/debug/ildbsymlib/symwrite.h b/coreclr-1.0.6/src/debug/ildbsymlib/symwrite.h
+index 055b8ec..54ab11a 100644
+--- a/coreclr-1.0.6/src/debug/ildbsymlib/symwrite.h
++++ b/coreclr-1.0.6/src/debug/ildbsymlib/symwrite.h
+@@ -839,7 +839,8 @@ class ArrayStorage
+         {
+             // Help mitigate the impact of buffer overflow
+             // Fail fast with a null-reference AV
+-            return *(static_cast<T*>(0)) ;
++            volatile char* nullPointer = nullptr;
++            *nullPointer;
+         }
+         return m_array[ i ];
+     }
+diff --git a/coreclr-1.0.6/src/debug/inc/dacdbiinterface.h b/coreclr-1.0.6/src/debug/inc/dacdbiinterface.h
+index e61e240..24c3e24 100644
+--- a/coreclr-1.0.6/src/debug/inc/dacdbiinterface.h
++++ b/coreclr-1.0.6/src/debug/inc/dacdbiinterface.h
+@@ -32,7 +32,7 @@
+ template<class T> void DeleteDbiMemory(T *p);
+ // Need a class to serve as a tag that we can use to overload New/Delete.
+ class forDbiWorker {};
+-#define forDbi (*(forDbiWorker *)NULL)
++SELECTANY forDbiWorker forDbi;
+ extern void * operator new(size_t lenBytes, const forDbiWorker &);
+ extern void * operator new[](size_t lenBytes, const forDbiWorker &);
+ extern void operator delete(void *p, const forDbiWorker &);
+diff --git a/coreclr-1.0.6/src/pal/src/exception/seh.cpp b/coreclr-1.0.6/src/pal/src/exception/seh.cpp
+index 473c490..ad09e02 100644
+--- a/coreclr-1.0.6/src/pal/src/exception/seh.cpp
++++ b/coreclr-1.0.6/src/pal/src/exception/seh.cpp
+@@ -274,7 +274,7 @@ SEHProcessException(PAL_SEHException* exception)
+                     {
+                         // The exception happened in the page right below the stack limit,
+                         // so it is a stack overflow
+-                        write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1);
++                        (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1);
+                         PROCAbort();
+                     }
+                 }
+diff --git a/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.cpp b/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.cpp
+index 4bef170..82061ac 100644
+--- a/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.cpp
++++ b/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.cpp
+@@ -277,7 +277,7 @@ DWORD TP_GetFullPathName(LPWSTR fileName, DWORD nBufferLength, LPWSTR lpBuffer)
+ 	return GetFullPathNameW(fileName, nBufferLength, lpBuffer, NULL);
+ #else
+ 	char nativeFullPath[MAX_PATH];
+-	realpath(HackyConvertToSTR(fileName), nativeFullPath);
++	(void)realpath(HackyConvertToSTR(fileName), nativeFullPath);
+ 	LPWSTR fullPathForCLR = HackyConvertToWSTR(nativeFullPath);
+ 	wcscpy_s(lpBuffer, MAX_PATH, fullPathForCLR);
+ 	return wcslen(lpBuffer);
+diff --git a/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.h b/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.h
+index 49e8f88..c196b0c 100644
+--- a/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.h
++++ b/coreclr-1.0.6/tests/src/Common/Platform/platformdefines.h
+@@ -87,7 +87,7 @@ typedef void* HMODULE;
+ typedef void* ULONG_PTR;
+ typedef unsigned error_t;
+ typedef void* LPVOID;
+-typedef char BYTE;
++typedef unsigned char BYTE;
+ typedef WCHAR OLECHAR;
+ #endif
+ 
+diff --git a/coreclr-1.0.6/tests/src/Interop/common/types.h b/coreclr-1.0.6/tests/src/Interop/common/types.h
+index 7d7f776..cb59c42 100755
+--- a/coreclr-1.0.6/tests/src/Interop/common/types.h
++++ b/coreclr-1.0.6/tests/src/Interop/common/types.h
+@@ -28,7 +28,7 @@ typedef void* HMODULE;
+ typedef void* ULONG_PTR;
+ typedef unsigned error_t;
+ typedef void* LPVOID;
+-typedef char BYTE;
++typedef unsigned char BYTE;
+ typedef WCHAR OLECHAR;
+ 
+ typedef unsigned int UINT_PTR;
+@@ -54,4 +54,4 @@ typedef int*  DWORD_PTR;
+ #define FALSE 0
+ #endif
+ 
+-#endif //_INTEROP_TYPES__H
+\ No newline at end of file
++#endif //_INTEROP_TYPES__H

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-gcc6-clang39.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-gcc6-clang39.patch
new file mode 100644
index 0000000..d921dc3
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-gcc6-clang39.patch
@@ -0,0 +1,26 @@
+diff -rupN a/coreclr-1.0.6/src/pal/src/include/pal/palinternal.h b/coreclr-1.0.6/src/pal/src/include/pal/palinternal.h
+--- a/coreclr-1.0.6/src/pal/src/include/pal/palinternal.h	2017-04-27 21:06:55.268009100 +0300
++++ b/coreclr-1.0.6/src/pal/src/include/pal/palinternal.h	2017-04-27 21:08:23.705175087 +0300
+@@ -567,6 +567,8 @@ function_name() to call the system's imp
+ #endif
+ #include <ctype.h>
+ 
++#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 1
++
+ #define _WITH_GETLINE
+ #include <stdio.h>
+ #include <stdlib.h>
+diff -rupN a/coreclr-1.0.6/src/pal/src/include/pal/sharedmemory.h b/coreclr-1.0.6/src/pal/src/include/pal/sharedmemory.h
+--- a/coreclr-1.0.6/src/pal/src/include/pal/sharedmemory.h	2017-04-27 21:06:55.268009100 +0300
++++ b/coreclr-1.0.6/src/pal/src/include/pal/sharedmemory.h	2017-04-27 21:07:44.351101225 +0300
+@@ -182,6 +182,10 @@ public:
+     virtual void Close(bool isAbruptShutdown, bool releaseSharedData)
+     {
+     }
++
++	virtual ~SharedMemoryProcessDataBase()
++	{
++	}
+ };
+ 
+ class SharedMemoryProcessDataHeader

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-clang39-commit-9db7fb1.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-clang39-commit-9db7fb1.patch
new file mode 100644
index 0000000..9c95b85
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-clang39-commit-9db7fb1.patch
@@ -0,0 +1,115 @@
+diff --git a/coreclr-1.1.1/src/debug/daccess/dacdbiimpl.cpp b/coreclr-1.1.1/src/debug/daccess/dacdbiimpl.cpp
+index 26e3d6c..59f217c 100644
+--- a/coreclr-1.1.1/src/debug/daccess/dacdbiimpl.cpp
++++ b/coreclr-1.1.1/src/debug/daccess/dacdbiimpl.cpp
+@@ -90,7 +90,6 @@ IDacDbiInterface::IAllocator * g_pAllocator = NULL;
+ //
+ 
+ // Need a class to serve as a tag that we can use to overload New/Delete.
+-#define forDbi (*(forDbiWorker *)NULL)
+ 
+ void * operator new(size_t lenBytes, const forDbiWorker &)
+ {
+diff --git a/coreclr-1.1.1/src/debug/ee/debugger.h b/coreclr-1.1.1/src/debug/ee/debugger.h
+index 6368647..59d1e66 100644
+--- a/coreclr-1.1.1/src/debug/ee/debugger.h
++++ b/coreclr-1.1.1/src/debug/ee/debugger.h
+@@ -3512,10 +3512,10 @@ class DebuggerEval
+  * ------------------------------------------------------------------------ */
+ 
+ class InteropSafe {};
+-#define interopsafe (*(InteropSafe*)NULL)
++SELECTANY InteropSafe interopsafe;
+ 
+ class InteropSafeExecutable {};
+-#define interopsafeEXEC (*(InteropSafeExecutable*)NULL)
++SELECTANY InteropSafeExecutable interopsafeEXEC;
+ 
+ #ifndef DACCESS_COMPILE
+ inline void * __cdecl operator new(size_t n, const InteropSafe&)
+diff --git a/coreclr-1.1.1/src/debug/ildbsymlib/symwrite.h b/coreclr-1.1.1/src/debug/ildbsymlib/symwrite.h
+index 055b8ec..54ab11a 100644
+--- a/coreclr-1.1.1/src/debug/ildbsymlib/symwrite.h
++++ b/coreclr-1.1.1/src/debug/ildbsymlib/symwrite.h
+@@ -839,7 +839,8 @@ class ArrayStorage
+         {
+             // Help mitigate the impact of buffer overflow
+             // Fail fast with a null-reference AV
+-            return *(static_cast<T*>(0)) ;
++            volatile char* nullPointer = nullptr;
++            *nullPointer;
+         }
+         return m_array[ i ];
+     }
+diff --git a/coreclr-1.1.1/src/debug/inc/dacdbiinterface.h b/coreclr-1.1.1/src/debug/inc/dacdbiinterface.h
+index e61e240..24c3e24 100644
+--- a/coreclr-1.1.1/src/debug/inc/dacdbiinterface.h
++++ b/coreclr-1.1.1/src/debug/inc/dacdbiinterface.h
+@@ -32,7 +32,7 @@
+ template<class T> void DeleteDbiMemory(T *p);
+ // Need a class to serve as a tag that we can use to overload New/Delete.
+ class forDbiWorker {};
+-#define forDbi (*(forDbiWorker *)NULL)
++SELECTANY forDbiWorker forDbi;
+ extern void * operator new(size_t lenBytes, const forDbiWorker &);
+ extern void * operator new[](size_t lenBytes, const forDbiWorker &);
+ extern void operator delete(void *p, const forDbiWorker &);
+diff --git a/coreclr-1.1.1/src/pal/src/exception/seh.cpp b/coreclr-1.1.1/src/pal/src/exception/seh.cpp
+index 473c490..ad09e02 100644
+--- a/coreclr-1.1.1/src/pal/src/exception/seh.cpp
++++ b/coreclr-1.1.1/src/pal/src/exception/seh.cpp
+@@ -274,7 +274,7 @@ SEHProcessException(PAL_SEHException* exception)
+                     {
+                         // The exception happened in the page right below the stack limit,
+                         // so it is a stack overflow
+-                        write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1);
++                        (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1);
+                         PROCAbort();
+                     }
+                 }
+diff --git a/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.cpp b/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.cpp
+index 4bef170..82061ac 100644
+--- a/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.cpp
++++ b/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.cpp
+@@ -277,7 +277,7 @@ DWORD TP_GetFullPathName(LPWSTR fileName, DWORD nBufferLength, LPWSTR lpBuffer)
+ 	return GetFullPathNameW(fileName, nBufferLength, lpBuffer, NULL);
+ #else
+ 	char nativeFullPath[MAX_PATH];
+-	realpath(HackyConvertToSTR(fileName), nativeFullPath);
++	(void)realpath(HackyConvertToSTR(fileName), nativeFullPath);
+ 	LPWSTR fullPathForCLR = HackyConvertToWSTR(nativeFullPath);
+ 	wcscpy_s(lpBuffer, MAX_PATH, fullPathForCLR);
+ 	return wcslen(lpBuffer);
+diff --git a/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.h b/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.h
+index 49e8f88..c196b0c 100644
+--- a/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.h
++++ b/coreclr-1.1.1/tests/src/Common/Platform/platformdefines.h
+@@ -87,7 +87,7 @@ typedef void* HMODULE;
+ typedef void* ULONG_PTR;
+ typedef unsigned error_t;
+ typedef void* LPVOID;
+-typedef char BYTE;
++typedef unsigned char BYTE;
+ typedef WCHAR OLECHAR;
+ #endif
+ 
+diff --git a/coreclr-1.1.1/tests/src/Interop/common/types.h b/coreclr-1.1.1/tests/src/Interop/common/types.h
+index 7d7f776..cb59c42 100755
+--- a/coreclr-1.1.1/tests/src/Interop/common/types.h
++++ b/coreclr-1.1.1/tests/src/Interop/common/types.h
+@@ -28,7 +28,7 @@ typedef void* HMODULE;
+ typedef void* ULONG_PTR;
+ typedef unsigned error_t;
+ typedef void* LPVOID;
+-typedef char BYTE;
++typedef unsigned char BYTE;
+ typedef WCHAR OLECHAR;
+ 
+ typedef unsigned int UINT_PTR;
+@@ -54,4 +54,4 @@ typedef int*  DWORD_PTR;
+ #define FALSE 0
+ #endif
+ 
+-#endif //_INTEROP_TYPES__H
+\ No newline at end of file
++#endif //_INTEROP_TYPES__H

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-exceptionhandling.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-exceptionhandling.patch
new file mode 100644
index 0000000..0fd56af
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-exceptionhandling.patch
@@ -0,0 +1,11 @@
+--- a/coreclr-1.1.1/src/vm/exceptionhandling.cpp.orig	2017-04-28 01:48:48.153258383 +0300
++++ a/coreclr-1.1.1/src/vm/exceptionhandling.cpp	2017-04-28 01:50:38.150431673 +0300
+@@ -4730,7 +4730,7 @@
+         }
+     }
+ 
+-    throw ex;
++    throw std::move(ex);
+ }
+ 
+ #ifdef _AMD64_


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/dotnet:master commit in: dev-dotnet/dotnet-cli/, dev-dotnet/dotnet-cli/files/
@ 2017-07-04 13:18 Mikhail Pukhlikov
  0 siblings, 0 replies; 4+ messages in thread
From: Mikhail Pukhlikov @ 2017-07-04 13:18 UTC (permalink / raw
  To: gentoo-commits

commit:     0e595381994264d0fc5d53c1b28a3048ad0223b9
Author:     Dmitry Kalyanov <Kalyanov.Dmitry <AT> gmail <DOT> com>
AuthorDate: Sun Jul  2 15:23:53 2017 +0000
Commit:     Mikhail Pukhlikov <cynede <AT> gentoo <DOT> org>
CommitDate: Sun Jul  2 15:23:53 2017 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=0e595381

Improve ebuild for .NET Core (LLVM-4 and heimdal)

This adds support for building .NET Core with LLVM 4 (mostly backported
from https://github.com/dotnet/coreclr/pull/11226).
Also added a 'heimdal' USE flag to allow use of Heimdal implementation
of Kerberos rather than MIT-KRB5.

 dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r2.ebuild   | 218 +++++++++++++++++++++
 .../files/coreclr-1.0.6-llvm4-intsafe.patch        | 117 +++++++++++
 .../dotnet-cli/files/coreclr-1.0.6-llvm4.patch     | 176 +++++++++++++++++
 .../files/coreclr-1.1.1-builtin-redefinition.patch |  40 ++++
 .../files/coreclr-1.1.1-llvm4-intsafe.patch        | 117 +++++++++++
 .../dotnet-cli/files/coreclr-1.1.1-llvm4.patch     | 136 +++++++++++++
 .../dotnet-cli/files/corefx-1.0.4-werror.patch     |  11 ++
 .../dotnet-cli/files/corefx-1.1.1-werror.patch     |  11 ++
 8 files changed, 826 insertions(+)

diff --git a/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r2.ebuild b/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r2.ebuild
new file mode 100644
index 0000000..b94d2f1
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/dotnet-cli-1.1.1-r2.ebuild
@@ -0,0 +1,218 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#BASED ON https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=dotnet-cli
+
+EAPI="6"
+
+CORE_V1_0=1.0.3
+CLI_V1_0=1.0.0-preview2-003156
+CORECLR_V1_0=1.0.6
+COREFX_V1_0=1.0.4
+
+DIST='debian-x64'
+
+COREFX=corefx-${COREFX_V}
+
+DESCRIPTION=".NET Core cli utility for building, testing, packaging and running projects"
+HOMEPAGE="https://www.microsoft.com/net/core"
+LICENSE="MIT"
+
+IUSE="heimdal"
+SRC_URI="https://github.com/dotnet/coreclr/archive/v${CORECLR_V1_0}.tar.gz -> coreclr-${CORECLR_V1_0}.tar.gz
+	https://github.com/dotnet/corefx/archive/v${COREFX_V1_0}.tar.gz -> corefx-${COREFX_V1_0}.tar.gz
+	https://download.microsoft.com/download/0/3/0/030449F5-F093-44A6-9889-E19B50A59777/sdk/dotnet-dev-${DIST}.${CLI_V1_0}.tar.gz
+	https://github.com/dotnet/coreclr/archive/v${PV}.tar.gz -> coreclr-${PV}.tar.gz
+	https://github.com/dotnet/corefx/archive/v${PV}.tar.gz -> corefx-${PV}.tar.gz
+	https://download.microsoft.com/download/F/D/5/FD52A2F7-65B6-4912-AEDD-4015DF6D8D22/dotnet-${PV}-sdk-${DIST}.tar.gz"
+
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	>=sys-devel/llvm-4.0
+	>=dev-util/lldb-4.0
+	>=sys-libs/libunwind-1.1-r1
+	>=dev-libs/icu-57.1
+	>=dev-util/lttng-ust-2.8.1
+	>=dev-libs/openssl-1.0.2h-r2
+	>=net-misc/curl-7.49.0
+	heimdal? (
+		>=app-crypt/heimdal-1.5.3-r2
+	)
+	!heimdal? (
+		>=app-crypt/mit-krb5-1.14.2
+	)
+	>=sys-libs/zlib-1.2.8-r1 "
+DEPEND="${RDEPEND}
+	>=dev-util/cmake-3.3.1-r1
+	>=sys-devel/make-4.1-r1
+	>=sys-devel/clang-3.7.1-r100
+	>=sys-devel/gettext-0.19.7"
+
+PATCHES=(
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-gcc6-clang39.patch"
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-clang39-commit-9db7fb1.patch"
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-icu57-commit-352df35.patch"
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-llvm4.patch"
+	"${FILESDIR}/coreclr-${CORECLR_V1_0}-llvm4-intsafe.patch"
+	"${FILESDIR}/coreclr-${PV}-clang39-commit-9db7fb1.patch"
+	"${FILESDIR}/coreclr-${PV}-exceptionhandling.patch"
+	"${FILESDIR}/coreclr-${PV}-builtin-redefinition.patch"
+	"${FILESDIR}/corefx-${PV}-init-tools-script.patch"
+	"${FILESDIR}/coreclr-${PV}-llvm4.patch"
+	"${FILESDIR}/coreclr-${PV}-llvm4-intsafe.patch"
+	"${FILESDIR}/corefx-${COREFX_V1_0}-werror.patch"
+	"${FILESDIR}/corefx-${PV}-run-script.patch"
+	"${FILESDIR}/corefx-${PV}-werror.patch"
+)
+
+S=${WORKDIR}
+CLI_1_0_S="${S}/tools-dotnet"
+CORECLR_1_0_S="${S}/coreclr-${CORECLR_V1_0}"
+COREFX_1_0_S="${S}/corefx-${COREFX_V1_0}"
+CLI_S="${S}/dotnetcli-${PV}"
+CORECLR_S="${S}/coreclr-${PV}"
+COREFX_S="${S}/corefx-${PV}"
+
+CORECLR_FILES=(
+	'libclrjit.so'
+	'libcoreclr.so'
+	'libcoreclrtraceptprovider.so'
+	'libdbgshim.so'
+	'libmscordaccore.so'
+	'libmscordbi.so'
+	'libsos.so'
+	'libsosplugin.so'
+	'System.Globalization.Native.so'
+)
+
+COREFX_FILES=(
+	'System.IO.Compression.Native.so'
+	'System.Native.a'
+	'System.Native.so'
+	'System.Net.Http.Native.so'
+	'System.Net.Security.Native.so'
+)
+
+CRYPTO_V1_0_FILES=(
+	'System.Security.Cryptography.Native.so'
+)
+
+CRYPTO_FILES=(
+	'System.Security.Cryptography.Native.OpenSsl.so'
+)
+
+pkg_pretend() {
+	# If FEATURES="-sandbox -usersandbox" are not set dotnet will hang while compiling.
+	if has sandbox $FEATURES || has usersandbox $FEATURES ; then
+		die ".NET core command-line (CLI) tools require sandbox and usersandbox to be disabled in FEATURES."
+	fi
+}
+
+src_unpack() {
+	unpack "coreclr-${CORECLR_V1_0}.tar.gz" "corefx-${COREFX_V1_0}.tar.gz" "coreclr-${PV}.tar.gz" "corefx-${PV}.tar.gz"
+	mkdir "${CLI_1_0_S}" "${CLI_S}" || die
+	cd "${CLI_S}" || die
+	unpack "dotnet-${PV}-sdk-${DIST}.tar.gz"
+	cd "${CLI_1_0_S}" || die
+	unpack "dotnet-dev-${DIST}.${CLI_V1_0}.tar.gz"
+}
+
+src_prepare() {
+	cp "${FILESDIR}/corefx-${PV}-buildtools.patch" "${COREFX_S}/buildtools.patch"
+
+	for file in "${CORECLR_FILES[@]}"; do
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/${PV}/${file}"
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/1.0.4/${file}"
+		rm "${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/${file}"
+	done
+
+	for file in "${COREFX_FILES[@]}"; do
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/${PV}/${file}"
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/1.0.4/${file}"
+		rm "${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/${file}"
+	done
+
+	for file in "${CRYPTO_FILES[@]}"; do
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/${PV}/${file}"
+	done
+
+	for file in "${CRYPTO_V1_0_FILES[@]}"; do
+		rm "${CLI_S}/shared/Microsoft.NETCore.App/1.0.4/${file}"
+		rm "${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/${file}"
+	done
+
+	default_src_prepare
+}
+
+src_compile() {
+	local buildargs=""
+
+	if use heimdal; then
+		# build uses mit-krb5 by default but lets override to heimdal
+		buildargs="${buildargs} cmakeargs -DHeimdalGssApi=ON"
+	fi
+
+	local dest="${CLI_1_0_S}/shared/Microsoft.NETCore.App/${CORE_V1_0}/"
+
+	cd "${COREFX_1_0_S}" || die
+	./build.sh native x64 release ${buildargs} || die
+
+	for file in "${COREFX_FILES[@]}"; do
+		cp -pP "${COREFX_1_0_S}/bin/Linux.x64.Release/Native/${file}" "${dest}" || die
+	done
+
+	for file in "${CRYPTO_V1_0_FILES[@]}"; do
+		cp -pP "${COREFX_1_0_S}/bin/Linux.x64.Release/Native/${file}" "${dest}" || die
+	done
+
+	cd "${S}" || die
+	rm -rf "${COREFX_1_0_S}" || die
+
+	cd "${CORECLR_1_0_S}" || die
+	./build.sh x64 release || die
+
+	for file in "${CORECLR_FILES[@]}"; do
+		cp -pP "${CORECLR_1_0_S}/bin/Product/Linux.x64.Release/${file}" "${dest}" || die
+	done
+
+	cd "${S}" || die
+	rm -rf "${CORECLR_1_0_S}" || die
+
+	cd "${COREFX_S}" || die
+	./src/Native/build-native.sh x64 release ${buildargs} || die
+
+	cd "${CORECLR_S}" || die
+	./build.sh x64 release || die
+}
+
+src_install() {
+	local dest="/opt/dotnet_cli"
+	local ddest="${D}/${dest}"
+	local ddest_core="${ddest}/shared/Microsoft.NETCore.App"
+
+	dodir "${dest}"
+	cp -pPR "${CLI_S}"/* "${ddest}" || die
+
+	for file in "${CORECLR_FILES[@]}"; do
+		cp -pP "${CORECLR_S}/bin/Product/Linux.x64.Release/${file}" "${ddest_core}/${PV}/" || die
+		cp -pP "${CORECLR_S}/bin/Product/Linux.x64.Release/${file}" "${ddest_core}/1.0.4/" || die
+	done
+
+	for file in "${COREFX_FILES[@]}"; do
+		cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}/${PV}/" || die
+		cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}/1.0.4/" || die
+	done
+
+	for file in "${CRYPTO_FILES[@]}"; do
+		cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}/${PV}/" || die
+	done
+
+	for file in "${CRYPTO_V1_0_FILES[@]}"; do
+		cp -pP "${COREFX_S}/bin/Linux.x64.Release/Native/${file}" "${ddest_core}/1.0.4/" || die
+	done
+
+	dosym "../../opt/dotnet_cli/dotnet" "/usr/bin/dotnet"
+}

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-llvm4-intsafe.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-llvm4-intsafe.patch
new file mode 100644
index 0000000..2684bbb
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-llvm4-intsafe.patch
@@ -0,0 +1,117 @@
+--- a/coreclr-1.0.6/src/pal/inc/rt/intsafe.h	2017-07-01 21:44:44.431947107 +0300
++++ b/coreclr-1.0.6/src/pal/inc/rt/intsafe.h	2017-07-01 21:45:03.236947035 +0300
+@@ -1449,114 +1449,4 @@
+ //
+ #define DWordPtrMult	ULongPtrMult
+ 
+-//
+-// size_t multiplication
+-//
+-#define SizeTMult		UIntPtrMult
+-
+-//
+-// SIZE_T multiplication
+-//
+-#define SIZETMult		ULongPtrMult
+-
+-//
+-// ULONGLONG multiplication
+-//
+-__inline
+-HRESULT
+-ULongLongMult(
+-    IN ULONGLONG ullMultiplicand,
+-    IN ULONGLONG ullMultiplier,
+-    OUT ULONGLONG* pullResult)
+-{
+-    HRESULT hr = INTSAFE_E_ARITHMETIC_OVERFLOW;
+-#ifdef _AMD64_
+-    ULONGLONG u64ResultHigh;
+-    ULONGLONG u64ResultLow;
+-    
+-    *pullResult = ULONGLONG_ERROR;
+-    
+-    u64ResultLow = UnsignedMultiply128(ullMultiplicand, ullMultiplier, &u64ResultHigh);
+-    if (u64ResultHigh == 0)
+-    {
+-        *pullResult = u64ResultLow;
+-        hr = S_OK;
+-    }
+-#else
+-    // 64x64 into 128 is like 32.32 x 32.32.
+-    //
+-    // a.b * c.d = a*(c.d) + .b*(c.d) = a*c + a*.d + .b*c + .b*.d
+-    // back in non-decimal notation where A=a*2^32 and C=c*2^32:  
+-    // A*C + A*d + b*C + b*d
+-    // So there are four components to add together.
+-    //   result = (a*c*2^64) + (a*d*2^32) + (b*c*2^32) + (b*d)
+-    //
+-    // a * c must be 0 or there would be bits in the high 64-bits
+-    // a * d must be less than 2^32 or there would be bits in the high 64-bits
+-    // b * c must be less than 2^32 or there would be bits in the high 64-bits
+-    // then there must be no overflow of the resulting values summed up.
+-    
+-    ULONG dw_a;
+-    ULONG dw_b;
+-    ULONG dw_c;
+-    ULONG dw_d;
+-    ULONGLONG ad = 0;
+-    ULONGLONG bc = 0;
+-    ULONGLONG bd = 0;
+-    ULONGLONG ullResult = 0;
+-    
+-    *pullResult = ULONGLONG_ERROR;
+-
+-    dw_a = (ULONG)(ullMultiplicand >> 32);
+-    dw_c = (ULONG)(ullMultiplier >> 32);
+-
+-    // common case -- if high dwords are both zero, no chance for overflow
+-    if ((dw_a == 0) && (dw_c == 0))
+-    {
+-        dw_b = (DWORD)ullMultiplicand;
+-        dw_d = (DWORD)ullMultiplier;
+-
+-        *pullResult = (((ULONGLONG)dw_b) * (ULONGLONG)dw_d);
+-        hr = S_OK;
+-    }
+-    else
+-    {
+-        // a * c must be 0 or there would be bits set in the high 64-bits
+-        if ((dw_a == 0) ||
+-            (dw_c == 0))
+-        {
+-            dw_d = (DWORD)ullMultiplier;
+-
+-            // a * d must be less than 2^32 or there would be bits set in the high 64-bits
+-            ad = (((ULONGLONG)dw_a) * (ULONGLONG)dw_d);
+-            if ((ad & HIDWORD_MASK) == 0)
+-            {
+-                dw_b = (DWORD)ullMultiplicand;
+-
+-                // b * c must be less than 2^32 or there would be bits set in the high 64-bits
+-                bc = (((ULONGLONG)dw_b) * (ULONGLONG)dw_c);
+-                if ((bc & HIDWORD_MASK) == 0)
+-                {
+-                    // now sum them all up checking for overflow.
+-                    // shifting is safe because we already checked for overflow above
+-                    if (SUCCEEDED(ULongLongAdd(bc << 32, ad << 32, &ullResult)))                        
+-                    {
+-                        // b * d
+-                        bd = (((ULONGLONG)dw_b) * (ULONGLONG)dw_d);
+-                    
+-                        if (SUCCEEDED(ULongLongAdd(ullResult, bd, &ullResult)))
+-                        {
+-                            *pullResult = ullResult;
+-                            hr = S_OK;
+-                        }
+-                    }
+-                }
+-            }
+-        }
+-    }
+-#endif // _AMD64_  
+-    
+-    return hr;
+-}
+-
+ #endif // _INTSAFE_H_INCLUDED_

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-llvm4.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-llvm4.patch
new file mode 100644
index 0000000..b5bb5e8
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.0.6-llvm4.patch
@@ -0,0 +1,176 @@
+--- before/coreclr-1.0.6/src/pal/inc/pal.h	2017-02-09 10:11:27.000000000 +0300
++++ after/coreclr-1.0.6/src/pal/inc/pal.h	2017-07-01 01:33:36.727950051 +0300
+@@ -5964,6 +5964,12 @@
+ }
+ #endif
+
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
++#if !__has_builtin(_rotl)
++
+ /*++
+ Function:
+ _rotl
+@@ -5982,11 +5988,15 @@
+     return retval;
+ }
+
++#endif
++
+ // On 64 bit unix, make the long an int.
+ #ifdef BIT64
+ #define _lrotl _rotl
+ #endif // BIT64
+
++#if !__has_builtin(_rotr)
++
+ /*++
+ Function:
+ _rotr
+@@ -6005,6 +6015,8 @@
+     return retval;
+ }
+
++#endif
++
+ PALIMPORT int __cdecl abs(int);
+ PALIMPORT double __cdecl fabs(double);
+ #ifndef PAL_STDCPP_COMPAT
+diff --git a/src/pal/inc/pal_mstypes.h b/src/pal/inc/pal_mstypes.h
+index 0ca2871f2b7..0aa35ae1e5a 100644
+--- a/coreclr-1.0.6/src/pal/inc/pal_mstypes.h
++++ b/coreclr-1.0.6/src/pal/inc/pal_mstypes.h
+@@ -556,7 +556,7 @@ typedef LONG_PTR SSIZE_T, *PSSIZE_T;
+ #endif
+
+ #ifndef SSIZE_T_MIN
+-#define SSIZE_T_MIN I64(-9223372036854775808)
++#define SSIZE_T_MIN I64(0x8000000000000000)
+ #endif
+
+ #ifndef PAL_STDCPP_COMPAT
+diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
+index 745b24f5916..08de1facb28 100644
+--- a/coreclr-1.0.6/src/gc/gc.cpp
++++ b/coreclr-1.0.6/src/gc/gc.cpp
+@@ -20356,7 +20356,7 @@ size_t gc_heap::update_brick_table (uint8_t* tree, size_t current_brick,
+     dprintf (3, ("tree: %Ix, current b: %Ix, x: %Ix, plug_end: %Ix",
+         tree, current_brick, x, plug_end));
+
+-    if (tree > 0)
++    if (tree != NULL)
+     {
+         dprintf (3, ("b- %Ix->%Ix pointing to tree %Ix",
+             current_brick, (size_t)(tree - brick_address (current_brick)), tree));
+diff --git a/src/pal/inc/rt/intsafe.h b/src/pal/inc/rt/intsafe.h
+index 4ed70e7423f..6e28175e220 100644
+--- a/coreclr-1.0.6/src/pal/inc/rt/intsafe.h
++++ b/coreclr-1.0.6/src/pal/inc/rt/intsafe.h
+@@ -18,26 +18,6 @@
+
+ #include <specstrings.h>    // for IN, etc.
+
+-
+-#if defined(_AMD64_)
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-#define UnsignedMultiply128 _umul128
+-ULONG64
+-UnsignedMultiply128 (
+-    IN ULONG64  Multiplier,
+-    IN ULONG64  Multiplicand,
+-    OUT ULONG64 *HighProduct
+-    );
+-#ifdef _MSC_VER
+-#pragma intrinsic(_umul128)
+-#endif // _MSC_VER
+-#ifdef __cplusplus
+-}
+-#endif
+-#endif // _AMD64_
+-
+ #ifndef FEATURE_PAL
+
+ #ifdef  _WIN64
+@@ -1444,23 +1424,6 @@
+ }
+
+ //
+-// UINT_PTR multiplication
+-//
+-#ifdef _WIN64
+-#define UIntPtrMult     ULongLongMult
+-#else
+-__inline
+-HRESULT
+-UIntPtrMult(
+-    IN UINT_PTR ulMultiplicand,
+-    IN UINT_PTR ulMultiplier,
+-    OUT UINT_PTR* pulResult)
+-{
+-	return UIntMult((UINT)ulMultiplicand, (UINT)ulMultiplier, (UINT*)pulResult);
+-}
+-#endif // _WIN64
+-
+-//
+ // ULONG multiplication
+ //
+ __inline
+@@ -1475,23 +1438,6 @@
+     return ULongLongToULong(ull64Result, pulResult);
+ }
+
+-//
+-// ULONG_PTR multiplication
+-//
+-#ifdef _WIN64
+-#define ULongPtrMult    ULongLongMult
+-#else
+-__inline
+-HRESULT
+-ULongPtrMult(
+-    IN ULONG_PTR ulMultiplicand,
+-    IN ULONG_PTR ulMultiplier,
+-    OUT ULONG_PTR* pulResult)
+-{
+-	return ULongMult((ULONG)ulMultiplicand, (ULONG)ulMultiplier, (ULONG*)pulResult);
+-}
+-#endif // _WIN64
+-
+
+ //
+ // DWORD multiplication
+diff --git a/src/vm/amd64/unixstubs.cpp b/src/vm/amd64/unixstubs.cpp
+index 29041490845..76d3cf18902 100644
+--- a/coreclr-1.0.6/src/vm/amd64/unixstubs.cpp
++++ b/coreclr-1.0.6/src/vm/amd64/unixstubs.cpp
+@@ -37,7 +37,7 @@ extern "C"
+               "  mov %%edx, 12(%[result])\n" \
+             : "=a"(eax) /*output in eax*/\
+             : "a"(arg), [result]"r"(result) /*inputs - arg in eax, result in any register*/\
+-            : "eax", "rbx", "ecx", "edx" /* registers that are clobbered*/
++            : "rbx", "ecx", "edx" /* registers that are clobbered*/
+           );
+         return eax;
+     }
+@@ -52,7 +52,7 @@ extern "C"
+               "  mov %%edx, 12(%[result])\n" \
+             : "=a"(eax) /*output in eax*/\
+             : "c"(arg1), "a"(arg2), [result]"r"(result) /*inputs - arg1 in ecx, arg2 in eax, result in any register*/\
+-            : "eax", "rbx", "ecx", "edx" /* registers that are clobbered*/
++            : "rbx", "edx" /* registers that are clobbered*/
+           );
+         return eax;
+     }
+@@ -63,7 +63,7 @@ extern "C"
+         __asm("  xgetbv\n" \
+             : "=a"(eax) /*output in eax*/\
+             : "c"(0) /*inputs - 0 in ecx*/\
+-            : "eax", "edx" /* registers that are clobbered*/
++            : "edx" /* registers that are clobbered*/
+           );
+         // check OS has enabled both XMM and YMM state support
+         return ((eax & 0x06) == 0x06) ? 1 : 0;

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-builtin-redefinition.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-builtin-redefinition.patch
new file mode 100644
index 0000000..7ee48fe
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-builtin-redefinition.patch
@@ -0,0 +1,40 @@
+--- before/coreclr-1.1.1/src/pal/inc/pal.h	2017-02-09 10:16:50.000000000 +0300
++++ after/coreclr-1.1.1/src/pal/inc/pal.h	2017-07-01 01:34:53.949949756 +0300
+@@ -5967,6 +5967,12 @@
+ }
+ #endif
+ 
++#ifndef __has_builtin
++#define __has_builtin(x) 0
++#endif
++
++#if !__has_builtin(_rotl)
++
+ /*++
+ Function:
+ _rotl
+@@ -5985,11 +5991,15 @@
+     return retval;
+ }
+ 
++#endif
++
+ // On 64 bit unix, make the long an int.
+ #ifdef BIT64
+ #define _lrotl _rotl
+ #endif // BIT64
+ 
++#if !__has_builtin(_rotr)
++
+ /*++
+ Function:
+ _rotr
+@@ -6008,6 +6018,8 @@
+     return retval;
+ }
+ 
++#endif
++
+ PALIMPORT int __cdecl abs(int);
+ #ifndef PAL_STDCPP_COMPAT
+ PALIMPORT LONG __cdecl labs(LONG);

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-llvm4-intsafe.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-llvm4-intsafe.patch
new file mode 100644
index 0000000..1fb2487
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-llvm4-intsafe.patch
@@ -0,0 +1,117 @@
+--- a/coreclr-1.1.1/src/pal/inc/rt/intsafe.h	2017-07-01 23:09:42.103927661 +0300
++++ b/coreclr-1.1.1/src/pal/inc/rt/intsafe.h	2017-07-01 23:10:17.995927524 +0300
+@@ -1449,114 +1449,4 @@
+ //
+ #define DWordPtrMult	ULongPtrMult
+ 
+-//
+-// size_t multiplication
+-//
+-#define SizeTMult		UIntPtrMult
+-
+-//
+-// SIZE_T multiplication
+-//
+-#define SIZETMult		ULongPtrMult
+-
+-//
+-// ULONGLONG multiplication
+-//
+-__inline
+-HRESULT
+-ULongLongMult(
+-    IN ULONGLONG ullMultiplicand,
+-    IN ULONGLONG ullMultiplier,
+-    OUT ULONGLONG* pullResult)
+-{
+-    HRESULT hr = INTSAFE_E_ARITHMETIC_OVERFLOW;
+-#ifdef _AMD64_
+-    ULONGLONG u64ResultHigh;
+-    ULONGLONG u64ResultLow;
+-    
+-    *pullResult = ULONGLONG_ERROR;
+-    
+-    u64ResultLow = UnsignedMultiply128(ullMultiplicand, ullMultiplier, &u64ResultHigh);
+-    if (u64ResultHigh == 0)
+-    {
+-        *pullResult = u64ResultLow;
+-        hr = S_OK;
+-    }
+-#else
+-    // 64x64 into 128 is like 32.32 x 32.32.
+-    //
+-    // a.b * c.d = a*(c.d) + .b*(c.d) = a*c + a*.d + .b*c + .b*.d
+-    // back in non-decimal notation where A=a*2^32 and C=c*2^32:  
+-    // A*C + A*d + b*C + b*d
+-    // So there are four components to add together.
+-    //   result = (a*c*2^64) + (a*d*2^32) + (b*c*2^32) + (b*d)
+-    //
+-    // a * c must be 0 or there would be bits in the high 64-bits
+-    // a * d must be less than 2^32 or there would be bits in the high 64-bits
+-    // b * c must be less than 2^32 or there would be bits in the high 64-bits
+-    // then there must be no overflow of the resulting values summed up.
+-    
+-    ULONG dw_a;
+-    ULONG dw_b;
+-    ULONG dw_c;
+-    ULONG dw_d;
+-    ULONGLONG ad = 0;
+-    ULONGLONG bc = 0;
+-    ULONGLONG bd = 0;
+-    ULONGLONG ullResult = 0;
+-    
+-    *pullResult = ULONGLONG_ERROR;
+-
+-    dw_a = (ULONG)(ullMultiplicand >> 32);
+-    dw_c = (ULONG)(ullMultiplier >> 32);
+-
+-    // common case -- if high dwords are both zero, no chance for overflow
+-    if ((dw_a == 0) && (dw_c == 0))
+-    {
+-        dw_b = (DWORD)ullMultiplicand;
+-        dw_d = (DWORD)ullMultiplier;
+-
+-        *pullResult = (((ULONGLONG)dw_b) * (ULONGLONG)dw_d);
+-        hr = S_OK;
+-    }
+-    else
+-    {
+-        // a * c must be 0 or there would be bits set in the high 64-bits
+-        if ((dw_a == 0) ||
+-            (dw_c == 0))
+-        {
+-            dw_d = (DWORD)ullMultiplier;
+-
+-            // a * d must be less than 2^32 or there would be bits set in the high 64-bits
+-            ad = (((ULONGLONG)dw_a) * (ULONGLONG)dw_d);
+-            if ((ad & HIDWORD_MASK) == 0)
+-            {
+-                dw_b = (DWORD)ullMultiplicand;
+-
+-                // b * c must be less than 2^32 or there would be bits set in the high 64-bits
+-                bc = (((ULONGLONG)dw_b) * (ULONGLONG)dw_c);
+-                if ((bc & HIDWORD_MASK) == 0)
+-                {
+-                    // now sum them all up checking for overflow.
+-                    // shifting is safe because we already checked for overflow above
+-                    if (SUCCEEDED(ULongLongAdd(bc << 32, ad << 32, &ullResult)))                        
+-                    {
+-                        // b * d
+-                        bd = (((ULONGLONG)dw_b) * (ULONGLONG)dw_d);
+-                    
+-                        if (SUCCEEDED(ULongLongAdd(ullResult, bd, &ullResult)))
+-                        {
+-                            *pullResult = ullResult;
+-                            hr = S_OK;
+-                        }
+-                    }
+-                }
+-            }
+-        }
+-    }
+-#endif // _AMD64_  
+-    
+-    return hr;
+-}
+-
+ #endif // _INTSAFE_H_INCLUDED_

diff --git a/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-llvm4.patch b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-llvm4.patch
new file mode 100644
index 0000000..388f73a
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/coreclr-1.1.1-llvm4.patch
@@ -0,0 +1,136 @@
+diff --git a/src/pal/inc/pal_mstypes.h b/src/pal/inc/pal_mstypes.h
+index 0ca2871f2b7..0aa35ae1e5a 100644
+--- a/coreclr-1.1.1/src/pal/inc/pal_mstypes.h
++++ b/coreclr-1.1.1/src/pal/inc/pal_mstypes.h
+@@ -556,7 +556,7 @@ typedef LONG_PTR SSIZE_T, *PSSIZE_T;
+ #endif
+
+ #ifndef SSIZE_T_MIN
+-#define SSIZE_T_MIN I64(-9223372036854775808)
++#define SSIZE_T_MIN I64(0x8000000000000000)
+ #endif
+
+ #ifndef PAL_STDCPP_COMPAT
+diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
+index 745b24f5916..08de1facb28 100644
+--- a/coreclr-1.1.1/src/gc/gc.cpp
++++ b/coreclr-1.1.1/src/gc/gc.cpp
+@@ -20356,7 +20356,7 @@ size_t gc_heap::update_brick_table (uint8_t* tree, size_t current_brick,
+     dprintf (3, ("tree: %Ix, current b: %Ix, x: %Ix, plug_end: %Ix",
+         tree, current_brick, x, plug_end));
+
+-    if (tree > 0)
++    if (tree != NULL)
+     {
+         dprintf (3, ("b- %Ix->%Ix pointing to tree %Ix",
+             current_brick, (size_t)(tree - brick_address (current_brick)), tree));
+diff --git a/src/pal/inc/rt/intsafe.h b/src/pal/inc/rt/intsafe.h
+index 4ed70e7423f..6e28175e220 100644
+--- a/coreclr-1.1.1/src/pal/inc/rt/intsafe.h
++++ b/coreclr-1.1.1/src/pal/inc/rt/intsafe.h
+@@ -18,26 +18,6 @@
+
+ #include <specstrings.h>    // for IN, etc.
+
+-
+-#if defined(_AMD64_)
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-#define UnsignedMultiply128 _umul128
+-ULONG64
+-UnsignedMultiply128 (
+-    IN ULONG64  Multiplier,
+-    IN ULONG64  Multiplicand,
+-    OUT ULONG64 *HighProduct
+-    );
+-#ifdef _MSC_VER
+-#pragma intrinsic(_umul128)
+-#endif // _MSC_VER
+-#ifdef __cplusplus
+-}
+-#endif
+-#endif // _AMD64_
+-
+ #ifndef FEATURE_PAL
+
+ #ifdef  _WIN64
+@@ -1444,23 +1424,6 @@
+ }
+
+ //
+-// UINT_PTR multiplication
+-//
+-#ifdef _WIN64
+-#define UIntPtrMult     ULongLongMult
+-#else
+-__inline
+-HRESULT
+-UIntPtrMult(
+-    IN UINT_PTR ulMultiplicand,
+-    IN UINT_PTR ulMultiplier,
+-    OUT UINT_PTR* pulResult)
+-{
+-	return UIntMult((UINT)ulMultiplicand, (UINT)ulMultiplier, (UINT*)pulResult);
+-}
+-#endif // _WIN64
+-
+-//
+ // ULONG multiplication
+ //
+ __inline
+@@ -1475,23 +1438,6 @@
+     return ULongLongToULong(ull64Result, pulResult);
+ }
+
+-//
+-// ULONG_PTR multiplication
+-//
+-#ifdef _WIN64
+-#define ULongPtrMult    ULongLongMult
+-#else
+-__inline
+-HRESULT
+-ULongPtrMult(
+-    IN ULONG_PTR ulMultiplicand,
+-    IN ULONG_PTR ulMultiplier,
+-    OUT ULONG_PTR* pulResult)
+-{
+-	return ULongMult((ULONG)ulMultiplicand, (ULONG)ulMultiplier, (ULONG*)pulResult);
+-}
+-#endif // _WIN64
+-
+
+ //
+ // DWORD multiplication
+diff --git a/src/vm/amd64/unixstubs.cpp b/src/vm/amd64/unixstubs.cpp
+index 29041490845..76d3cf18902 100644
+--- a/coreclr-1.1.1/src/vm/amd64/unixstubs.cpp
++++ b/coreclr-1.1.1/src/vm/amd64/unixstubs.cpp
+@@ -37,7 +37,7 @@ extern "C"
+               "  mov %%edx, 12(%[result])\n" \
+             : "=a"(eax) /*output in eax*/\
+             : "a"(arg), [result]"r"(result) /*inputs - arg in eax, result in any register*/\
+-            : "eax", "rbx", "ecx", "edx", "memory" /* registers that are clobbered, *result is clobbered */
++            : "rbx", "ecx", "edx", "memory" /* registers that are clobbered, *result is clobbered */
+           );
+         return eax;
+     }
+@@ -52,7 +52,7 @@ extern "C"
+               "  mov %%edx, 12(%[result])\n" \
+             : "=a"(eax) /*output in eax*/\
+             : "c"(arg1), "a"(arg2), [result]"r"(result) /*inputs - arg1 in ecx, arg2 in eax, result in any register*/\
+-            : "eax", "rbx", "ecx", "edx", "memory" /* registers that are clobbered, *result is clobbered */
++            : "rbx", "edx", "memory" /* registers that are clobbered, *result is clobbered */
+           );
+         return eax;
+     }
+@@ -63,7 +63,7 @@ extern "C"
+         __asm("  xgetbv\n" \
+             : "=a"(eax) /*output in eax*/\
+             : "c"(0) /*inputs - 0 in ecx*/\
+-            : "eax", "edx" /* registers that are clobbered*/
++            : "edx" /* registers that are clobbered*/
+           );
+         // check OS has enabled both XMM and YMM state support
+         return ((eax & 0x06) == 0x06) ? 1 : 0;

diff --git a/dev-dotnet/dotnet-cli/files/corefx-1.0.4-werror.patch b/dev-dotnet/dotnet-cli/files/corefx-1.0.4-werror.patch
new file mode 100644
index 0000000..e34868c
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/corefx-1.0.4-werror.patch
@@ -0,0 +1,11 @@
+--- before/corefx-1.0.4/src/Native/CMakeLists.txt	2017-02-10 06:02:30.000000000 +0300
++++ after/corefx-1.0.4/src/Native/CMakeLists.txt	2017-07-01 00:59:23.425957884 +0300
+@@ -15,7 +15,7 @@
+ add_compile_options(-Wno-disabled-macro-expansion)
+ add_compile_options(-Wno-c++98-compat)
+ add_compile_options(-Wno-c++98-compat-pedantic)
+-add_compile_options(-Werror)
++#add_compile_options(-Werror)
+ add_compile_options(-fPIC)
+ add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common)
+ add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common)

diff --git a/dev-dotnet/dotnet-cli/files/corefx-1.1.1-werror.patch b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-werror.patch
new file mode 100644
index 0000000..2370d6d
--- /dev/null
+++ b/dev-dotnet/dotnet-cli/files/corefx-1.1.1-werror.patch
@@ -0,0 +1,11 @@
+--- before/corefx-1.1.1/src/Native/Unix/CMakeLists.txt	2017-02-22 19:42:11.000000000 +0300
++++ after/corefx-1.1.1/src/Native/Unix/CMakeLists.txt	2017-07-01 00:59:39.256957823 +0300
+@@ -15,7 +15,7 @@
+ add_compile_options(-Wno-disabled-macro-expansion)
+ add_compile_options(-Wno-c++98-compat)
+ add_compile_options(-Wno-c++98-compat-pedantic)
+-add_compile_options(-Werror)
++#add_compile_options(-Werror)
+ add_compile_options(-fPIC)
+ add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common)
+ add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-04 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-04 13:18 [gentoo-commits] proj/dotnet:master commit in: dev-dotnet/dotnet-cli/, dev-dotnet/dotnet-cli/files/ Mikhail Pukhlikov
  -- strict thread matches above, loose matches on Subject: below --
2017-06-02  8:19 Mikhail Pukhlikov
2016-09-19 13:16 Mikhail Pukhlikov
2016-07-14  6:29 Heather Cynede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox