summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Brodersen2016-06-29 14:54:15 -0500
committerAaron Brodersen2016-06-29 14:54:15 -0500
commite4bb2e04c4ed09c13e51624884b75f3dc08f0d7b (patch)
treeb7df230bb8dfd91360dd4be319c928e66767f797
downloadaur-e4bb2e04c4ed09c13e51624884b75f3dc08f0d7b.tar.gz
initial commit
-rw-r--r--.SRCINFO33
-rw-r--r--.gitignore3
-rw-r--r--PKGBUILD102
-rw-r--r--gcc6-github-pull-5304.patch28
-rw-r--r--segv-github-pull-6027.patch59
5 files changed, 225 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2aa4b526623f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = dotnet-cli
+ pkgdesc = A command line utility for building, testing, packaging and running .NET Core applications and libraries
+ pkgver = 1.0.0_preview2_003121
+ pkgrel = 1
+ url = https://www.microsoft.com/net/core
+ arch = x86_64
+ license = MIT
+ makedepends = cmake
+ makedepends = make
+ makedepends = clang
+ makedepends = llvm
+ makedepends = gettext
+ depends = libunwind
+ depends = icu
+ depends = lttng-ust
+ depends = openssl
+ depends = curl
+ provides = dotnet
+ noextract = dotnet-cli-1.0.0_preview2_003121.tar.gz
+ options = staticlibs
+ source = coreclr-1.0.0.tar.gz::https://github.com/dotnet/coreclr/archive/v1.0.0.tar.gz
+ source = corefx-1.0.0.tar.gz::https://github.com/dotnet/corefx/archive/v1.0.0.tar.gz
+ source = dotnet-cli-1.0.0_preview2_003121.tar.gz::https://go.microsoft.com/fwlink/?LinkID=816869
+ source = gcc6-github-pull-5304.patch
+ source = segv-github-pull-6027.patch
+ sha256sums = fad7bb05f78d90dfea6e8fec59f79ff12648fe95c0965cda5bc11beafabd0f27
+ sha256sums = 98f9475ea42e5d55ad9402424e342a6c0ea7351f3fb5805a602132969b44b774
+ sha256sums = dde9f8326583f351a89e57095dc523ba92560896cd1d4b8e0ca5ac7fd8499138
+ sha256sums = 0905f9f8e6e33a7a6e5f4acf9ec54ec3796400dce28f0d71c1d1d8bcd9b7e068
+ sha256sums = a039329f892c55a400537ea4da61de86af195d143d758b6019fbae76f17ef6f1
+
+pkgname = dotnet-cli
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..0465d3310ba6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+pkg/
+src/
+**.tar.gz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..90cc85d81412
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,102 @@
+# Maintainer: Aaron Brodersen <aaron at abrodersen dot com>
+pkgname=dotnet-cli
+pkgver="1.0.0_preview2_003121"
+pkgrel=1
+pkgdesc="A command line utility for building, testing, packaging and running .NET Core applications and libraries"
+arch=(x86_64)
+url="https://www.microsoft.com/net/core"
+license=('MIT')
+groups=()
+depends=('libunwind' 'icu' 'lttng-ust' 'openssl' 'curl')
+makedepends=('cmake' 'make' 'clang' 'llvm' 'gettext')
+provides=('dotnet')
+conflicts=()
+replaces=()
+backup=()
+options=(staticlibs)
+install=
+
+_coreclrver="1.0.0"
+_corefxver="1.0.0"
+
+_coreclr="coreclr-${_coreclrver}"
+_corefx="corefx-${_corefxver}"
+
+source=(
+ "${_coreclr}.tar.gz::https://github.com/dotnet/coreclr/archive/v${_coreclrver}.tar.gz"
+ "${_corefx}.tar.gz::https://github.com/dotnet/corefx/archive/v${_corefxver}.tar.gz"
+ "${pkgname}-${pkgver}.tar.gz::https://go.microsoft.com/fwlink/?LinkID=816869"
+ 'gcc6-github-pull-5304.patch'
+ 'segv-github-pull-6027.patch')
+noextract=("${pkgname}-${pkgver}.tar.gz")
+sha256sums=(
+ 'fad7bb05f78d90dfea6e8fec59f79ff12648fe95c0965cda5bc11beafabd0f27'
+ '98f9475ea42e5d55ad9402424e342a6c0ea7351f3fb5805a602132969b44b774'
+ 'dde9f8326583f351a89e57095dc523ba92560896cd1d4b8e0ca5ac7fd8499138'
+ '0905f9f8e6e33a7a6e5f4acf9ec54ec3796400dce28f0d71c1d1d8bcd9b7e068'
+ 'a039329f892c55a400537ea4da61de86af195d143d758b6019fbae76f17ef6f1')
+
+prepare() {
+ cd "${srcdir}/${_coreclr}"
+ patch -p1 < "${srcdir}/gcc6-github-pull-5304.patch"
+ patch -p1 < "${srcdir}/segv-github-pull-6027.patch"
+}
+
+build() {
+ cd "${srcdir}/${_coreclr}"
+ ./build.sh x64 release > /dev/null
+
+ cd "${srcdir}/${_corefx}"
+ ./build.sh native x64 release > /dev/null
+
+}
+
+_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'
+)
+
+_copy_file() {
+ cp --force --preserve=mode $1 "$2/shared/Microsoft.NETCore.App/${_corefxver}/"
+}
+
+package() {
+ local _outdir="${pkgdir}/opt/dotnet"
+ mkdir -p "${_outdir}"
+
+ tar -C "${_outdir}" -xzf "${srcdir}/${pkgname}-${pkgver}.tar.gz"
+
+ local _clrdir="${srcdir}/${_coreclr}"
+
+ for file in "${_coreclr_files[@]}"; do
+ _copy_file "${_clrdir}/bin/Product/Linux.x64.Release/${file}" "${_outdir}"
+ done
+
+ local _fxdir="${srcdir}/${_corefx}"
+
+ for file in "${_corefx_files[@]}"; do
+ _copy_file "${_fxdir}/bin/Linux.x64.Release/Native/${file}" "${_outdir}"
+ done
+
+ mkdir -p "${pkgdir}/usr/bin/"
+ ln -s "/opt/dotnet/dotnet" "${pkgdir}/usr/bin/dotnet"
+ chown -R 0:0 "${_outdir}"
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/gcc6-github-pull-5304.patch b/gcc6-github-pull-5304.patch
new file mode 100644
index 000000000000..012303fa7152
--- /dev/null
+++ b/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/src/pal/src/include/pal/palinternal.h
++++ b/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/segv-github-pull-6027.patch b/segv-github-pull-6027.patch
new file mode 100644
index 000000000000..698151b3757a
--- /dev/null
+++ b/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/src/pal/src/exception/signal.cpp
++++ b/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/src/pal/src/include/pal/context.h
++++ b/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
+