From 3b162df4d6d392c8d8c61a18e42d1cced9f06f1b Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Jul 23 2018 01:31:40 +0000 Subject: [PATCH 1/2] Merge history from older fedora-dotnet repository --- diff --git a/README.md b/README.md index 3f6ea5d..1f87097 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,94 @@ This repository contains the source files for .NET Core packages on [dotnet-sig ### IRC `#fedora-dotnet` on Freenode ([webchat](https://webchat.freenode.net/?channels=#fedora-dotnet)) + +# Getting builds from COPR + +Packages from this repository are available the DotNet SIG copr at +https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet/ + +Please see the copr repository for steps on how to install the +packages and use them. + +Please report any issues here, via *New Issue*. + +# Specification + +- Follows [package naming and contents suggested by upstream](https://github.com/dotnet/core-setup/issues/1599) +- Installs dotnet to `/usr/lib64/dotnet` + +# Building + +1. You will need credentials and permissions to build in copr. + + - You need [a valid Fedora + account](https://admin.fedoraproject.org/accounts/) to be able to + use any Fedora infrastructure, including copr. + - You will need a token for `copr-cli` commands. See + https://copr.fedorainfracloud.org/api/ for how to get a token. + - To build in dotnet-sig copr, ask an admin of dotnet-sig for + permissions. + +2. Fork [the dotnet-sig repo](https://pagure.io/fedora-dotnet) via + copr. You should now have a repo with the web url + https://pagure.io/fork/$USER/fedora-dotnet + +3. Checkout the forked repository + + - `git clone ssh://git@pagure.io/forks/$USER/fedora-dotnet.git` + - `cd fedora-dotnet` + - `git checkout f26` + + Use the most appropriate branch name, but f26 is where the action is right now + +4. Bump version/release in the spec file. Add a Changelog. Make sure + the `Source` tag corresponds to the new tarball name, if there is a + new tarball. + +5. Do local builds + + - `fedpkg --dist $YOUR_FEDORA_VERSION --module-name dotnet local` + + Where the version can be, for example, f27. Fix any errors that + come up and rebuild until it works locally. + +6. Upload the new tarball to a public URL, if there is a new tarball. + I use: + + - `scp dotnet-2.0.3.tar.gz omajid.fedorapeople.org:public_html/dotnet/ ` + + Make sure `spectool -g /path/to/dotnet.spec` can download this + tarball from the public URL. + +7. Commit the changes to the git repo and do a build on copr. + + - `git add # any new files, such as new patches` + - `git remote # old files, such as old patches` + - `git commit -a` + - `git push` + - `fedpkg --release f26 --module-name dotnet srpm` + - `copr-cli build @dotnet-sig/dotnet ` + +8. If it fails, update spec file/patches and rebuild with the same set + of steps. + +# Testing + +1. Pull down the packages from copr, and install them: + + - `dnf copr enable @dotnet-sig/dotnet` + - `dnf install dotnet-sdk-2.0` + + OR, if you already have the packages installed: + + - `dnf upgrade 'dotnet*'` + + Make sure it installs the version you just built. Sometimes it + takes a few minutes to an hour for the latest version to show up + in the copr repos. + +2. Run some smoke tests + + - `dotnet new console -o ConsoleApplication` + - `dotnet run` + - `dotnet public -c Release -r linux-x64` diff --git a/check-debug-symbols.py b/check-debug-symbols.py new file mode 100755 index 0000000..1e14800 --- /dev/null +++ b/check-debug-symbols.py @@ -0,0 +1,136 @@ +#!/usr/bin/python3 + +""" +Check debug symbols are present in shared object and can identify +code. + +It starts scanning from a directory and recursively scans all ELF +files found in it for various symbols to ensure all debuginfo is +present and nothing has been stripped. + +Usage: + +./check-debug-symbols /path/of/dir/to/scan/ + + +Example: + +./check-debug-symbols /usr/lib64 +""" + +# This technique was explained to me by Mark Wielaard (mjw). + +import collections +import os +import re +import subprocess +import sys + +ScanResult = collections.namedtuple('ScanResult', + 'file_name debug_info debug_abbrev file_symbols gnu_debuglink') + + +def scan_file(file): + "Scan the provided file and return a ScanResult containing results of the scan." + + # Test for .debug_* sections in the shared object. This is the main test. + # Stripped objects will not contain these. + readelf_S_result = subprocess.run(['eu-readelf', '-S', file], + stdout=subprocess.PIPE, encoding='utf-8', check=True) + has_debug_info = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_info' in line) + + has_debug_abbrev = any(line for line in readelf_S_result.stdout.split('\n') if '] .debug_abbrev' in line) + + # Test FILE symbols. These will most likely be removed by anyting that + # manipulates symbol tables because it's generally useless. So a nice test + # that nothing has messed with symbols. + def contains_file_symbols(line): + parts = line.split() + if len(parts) < 8: + return False + return \ + parts[2] == '0' and parts[3] == 'FILE' and parts[4] == 'LOCAL' and parts[5] == 'DEFAULT' and \ + parts[6] == 'ABS' and re.match(r'((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx))?', parts[7]) + + readelf_s_result = subprocess.run(["eu-readelf", '-s', file], + stdout=subprocess.PIPE, encoding='utf-8', check=True) + has_file_symbols = any(line for line in readelf_s_result.stdout.split('\n') if contains_file_symbols(line)) + + # Test that there are no .gnu_debuglink sections pointing to another + # debuginfo file. There shouldn't be any debuginfo files, so the link makes + # no sense either. + has_gnu_debuglink = any(line for line in readelf_s_result.stdout.split('\n') if '] .gnu_debuglink' in line) + + return ScanResult(file, has_debug_info, has_debug_abbrev, has_file_symbols, has_gnu_debuglink) + +def is_elf(file): + result = subprocess.run(['file', file], stdout=subprocess.PIPE, encoding='utf-8', check=True) + return re.search('ELF 64-bit LSB (?:executable|shared object)', result.stdout) + +def scan_file_if_sensible(file): + if is_elf(file): + # print(file) + return scan_file(file) + return None + +def scan_dir(dir): + results = [] + for root, _, files in os.walk(dir): + for name in files: + result = scan_file_if_sensible(os.path.join(root, name)) + if result: + results.append(result) + return results + +def scan(file): + file = os.path.abspath(file) + if os.path.isdir(file): + return scan_dir(file) + elif os.path.isfile(file): + return scan_file_if_sensible(file) + +def is_bad_result(result): + return not result.debug_info or not result.debug_abbrev or not result.file_symbols or result.gnu_debuglink + +def print_scan_results(results, verbose): + # print(results) + for result in results: + file_name = result.file_name + found_issue = False + if not result.debug_info: + found_issue = True + print('error: missing .debug_info section in', file_name) + if not result.debug_abbrev: + found_issue = True + print('error: missing .debug_abbrev section in', file_name) + if not result.file_symbols: + found_issue = True + print('error: missing FILE symbols in', file_name) + if result.gnu_debuglink: + found_issue = True + print('error: unexpected .gnu_debuglink section in', file_name) + if verbose and not found_issue: + print('OK: ', file_name) + +def main(args): + verbose = False + files = [] + for arg in args: + if arg == '--verbose' or arg == '-v': + verbose = True + else: + files.append(arg) + + results = [] + for file in files: + results.extend(scan(file)) + + print_scan_results(results, verbose) + + if any(is_bad_result(result) for result in results): + return 1 + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/coreclr-clang5.patch b/coreclr-clang5.patch new file mode 100644 index 0000000..c446b57 --- /dev/null +++ b/coreclr-clang5.patch @@ -0,0 +1,40 @@ +commit 9b22e1a767dee38f351001c5601f56d78766a43e +Author: Sergey Andreenko +Date: Mon Dec 11 19:05:15 2017 -0800 + + fix CoreCLR build errors with clang5.0. (#15477) + + * spmi: delete the explicit call to the constructor. + + MethodContext was already initialized through `new MethodContext();` + + * add an artificial using of lambda param. + + the define `#define PAL_EXCEPT(dispositionExpression)` + can declare expression that has zero or one param. If it has zero param, then `__param` in the lambda is unused, prevent clang complains by adding this change. + +diff --git dotnet/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp dotnet/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +index 581b2286d8..601f73833e 100644 +--- dotnet/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp ++++ dotnet/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +@@ -299,8 +299,6 @@ void MethodContext::MethodInitHelperFile(HANDLE hFile) + + void MethodContext::MethodInitHelper(unsigned char* buff2, unsigned int totalLen) + { +- MethodContext::MethodContext(); +- + unsigned int buffIndex = 0; + unsigned int localsize = 0; + unsigned char canary = 0xff; +diff --git dotnet/src/coreclr/src/pal/inc/pal.h dotnet/src/coreclr/src/pal/inc/pal.h +index 8f6bc12798..e8fdab544f 100644 +--- dotnet/src/coreclr/src/pal/inc/pal.h ++++ dotnet/src/coreclr/src/pal/inc/pal.h +@@ -5921,6 +5921,7 @@ public: + EXCEPTION_DISPOSITION disposition = EXCEPTION_CONTINUE_EXECUTION; \ + auto exceptionFilter = [&disposition, &__param](PAL_SEHException& ex) \ + { \ ++ (void)__param; \ + disposition = dispositionExpression; \ + _ASSERTE(disposition != EXCEPTION_CONTINUE_EXECUTION); \ + return disposition; \ diff --git a/coreclr-clang6.patch b/coreclr-clang6.patch new file mode 100644 index 0000000..6fc3d39 --- /dev/null +++ b/coreclr-clang6.patch @@ -0,0 +1,131 @@ +From 57b215fc758737f55a7062cab277154c5b9626d4 Mon Sep 17 00:00:00 2001 +From: Jan Vorlicek +Date: Sat, 10 Mar 2018 01:12:14 +0100 +Subject: [PATCH] Fix build with Clang 6.0 and enable build with Clang 5.0 + (#16855) + +* Fix build with Clang 6.0 + +* Add support for clang 5.0 too +--- + build.sh | 10 ++++++++++ + compileoptions.cmake | 4 ++++ + src/ToolBox/SOS/lldbplugin/CMakeLists.txt | 8 +++++--- + src/inc/utilcode.h | 2 +- + src/jit/ee_il_dll.cpp | 2 +- + src/vm/gcenv.ee.cpp | 4 ++-- + 6 files changed, 23 insertions(+), 7 deletions(-) + +diff --git dotnet/src/coreclr/build.sh dotnet/src/coreclr/build.sh +index b7a77e33cf..63be11bb2a 100755 +--- dotnet/src/coreclr/build.sh ++++ dotnet/src/coreclr/build.sh +@@ -725,6 +725,16 @@ while :; do + __ClangMinorVersion=0 + ;; + ++ clang5.0|-clang5.0) ++ __ClangMajorVersion=5 ++ __ClangMinorVersion=0 ++ ;; ++ ++ clang6.0|-clang6.0) ++ __ClangMajorVersion=6 ++ __ClangMinorVersion=0 ++ ;; ++ + ninja) + __UseNinja=1 + ;; +diff --git dotnet/src/coreclr/compileoptions.cmake dotnet/src/coreclr/compileoptions.cmake +index 6f9d55fa33..9c352e8bab 100644 +--- dotnet/src/coreclr/compileoptions.cmake ++++ dotnet/src/coreclr/compileoptions.cmake +@@ -38,6 +38,10 @@ if (CLR_CMAKE_PLATFORM_UNIX) + # There are constants of type BOOL used in a condition. But BOOL is defined as int + # and so the compiler thinks that there is a mistake. + add_compile_options(-Wno-constant-logical-operand) ++ # We use pshpack1/2/4/8.h and poppack.h headers to set and restore packing. However ++ # clang 6.0 complains when the packing change lifetime is not contained within ++ # a header file. ++ add_compile_options(-Wno-pragma-pack) + + add_compile_options(-Wno-unknown-warning-option) + +diff --git dotnet/src/coreclr/src/ToolBox/SOS/lldbplugin/CMakeLists.txt dotnet/src/coreclr/src/ToolBox/SOS/lldbplugin/CMakeLists.txt +index d780cb2e85..e87ac8bf02 100644 +--- dotnet/src/coreclr/src/ToolBox/SOS/lldbplugin/CMakeLists.txt ++++ dotnet/src/coreclr/src/ToolBox/SOS/lldbplugin/CMakeLists.txt +@@ -55,15 +55,15 @@ endif() + + if (CLR_CMAKE_PLATFORM_DARWIN) + # Check for LLDB library +- find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH) +- find_library(LLDB NAMES LLDB lldb lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm) ++ find_library(LLDB NAMES LLDB lldb lldb-6.0 lldb-5.0 lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATHS "${WITH_LLDB_LIBS}" PATH_SUFFIXES llvm NO_DEFAULT_PATH) ++ find_library(LLDB NAMES LLDB lldb lldb-6.0 lldb-5.0 lldb-4.0 lldb-3.9 lldb-3.8 lldb-3.7 lldb-3.6 lldb-3.5 PATH_SUFFIXES llvm) + if(LLDB STREQUAL LLDB-NOTFOUND) + if(REQUIRE_LLDBPLUGIN) + set(MESSAGE_MODE FATAL_ERROR) + else() + set(MESSAGE_MODE WARNING) + endif() +- message(${MESSAGE_MODE} "Cannot find lldb-3.5, lldb-3.6, lldb-3.8, lldb-3.9 or lldb-4.0. Try installing lldb-3.6-dev (or the appropriate package for your platform)") ++ message(${MESSAGE_MODE} "Cannot find lldb-3.5, lldb-3.6, lldb-3.8, lldb-3.9, lldb-4.0, lldb-5.0 or lldb-6.0. Try installing liblldb-3.9-dev (or the appropriate package for your platform). You may need to set LLVM_HOME if the build still can't find it.") + return() + endif() + +@@ -75,7 +75,9 @@ + # If the file in a directory is found the result is stored in the variable and the search will not be repeated unless the variable is cleared. + find_path(LLDB_H "lldb/API/LLDB.h" PATHS "${WITH_LLDB_INCLUDES}" NO_DEFAULT_PATH) + find_path(LLDB_H "lldb/API/LLDB.h") +- ++find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-6.0/include") ++find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-5.0/include") ++find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-4.0/include") + find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-3.9/include") + find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-3.8/include") + find_path(LLDB_H "lldb/API/LLDB.h" PATHS "/usr/lib/llvm-3.7/include") +diff --git dotnet/src/coreclr/src/inc/utilcode.h dotnet/src/coreclr/src/inc/utilcode.h +index d7676cb86a..9226d682e2 100644 +--- dotnet/src/coreclr/src/inc/utilcode.h ++++ dotnet/src/coreclr/src/inc/utilcode.h +@@ -1106,7 +1106,7 @@ inline HRESULT DecimalCanonicalize(DECIMAL* dec) + // + //***************************************************************************** + // secure version! Specify the size of the each buffer in count of elements +-void SplitPath(register const WCHAR *path, ++void SplitPath(const WCHAR *path, + __inout_z __inout_ecount_opt(driveSizeInWords) WCHAR *drive, int driveSizeInWords, + __inout_z __inout_ecount_opt(dirSizeInWords) WCHAR *dir, int dirSizeInWords, + __inout_z __inout_ecount_opt(fnameSizeInWords) WCHAR *fname, size_t fnameSizeInWords, +diff --git dotnet/src/coreclr/src/jit/ee_il_dll.cpp dotnet/src/coreclr/src/jit/ee_il_dll.cpp +index 81ed6cfb5d..f7ea585948 100644 +--- dotnet/src/coreclr/src/jit/ee_il_dll.cpp ++++ dotnet/src/coreclr/src/jit/ee_il_dll.cpp +@@ -798,7 +798,7 @@ void Compiler::eeDispVar(ICorDebugInfo::NativeVarInfo* var) + printf("%3d(%10s) : From %08Xh to %08Xh, in ", var->varNumber, + (VarNameToStr(name) == nullptr) ? "UNKNOWN" : VarNameToStr(name), var->startOffset, var->endOffset); + +- switch (var->loc.vlType) ++ switch ((Compiler::siVarLocType)var->loc.vlType) + { + case VLT_REG: + case VLT_REG_BYREF: +diff --git dotnet/src/coreclr/src/vm/gcenv.ee.cpp dotnet/src/coreclr/src/vm/gcenv.ee.cpp +index 8e2594be63..0759768126 100644 +--- dotnet/src/coreclr/src/vm/gcenv.ee.cpp ++++ dotnet/src/coreclr/src/vm/gcenv.ee.cpp +@@ -15,8 +15,8 @@ void GCToEEInterface::SuspendEE(SUSPEND_REASON reason) + { + WRAPPER_NO_CONTRACT; + +- static_assert_no_msg(SUSPEND_FOR_GC == ThreadSuspend::SUSPEND_FOR_GC); +- static_assert_no_msg(SUSPEND_FOR_GC_PREP == ThreadSuspend::SUSPEND_FOR_GC_PREP); ++ static_assert_no_msg(SUSPEND_FOR_GC == (int)ThreadSuspend::SUSPEND_FOR_GC); ++ static_assert_no_msg(SUSPEND_FOR_GC_PREP == (int)ThreadSuspend::SUSPEND_FOR_GC_PREP); + + _ASSERTE(reason == SUSPEND_FOR_GC || reason == SUSPEND_FOR_GC_PREP); + +-- +2.17.0 diff --git a/corefx-clang5-compat.patch b/corefx-clang5-compat.patch new file mode 100644 index 0000000..1069065 --- /dev/null +++ b/corefx-clang5-compat.patch @@ -0,0 +1,24 @@ +From a2142d9998a5fa27d27b3e3da2c3b527be359b00 Mon Sep 17 00:00:00 2001 +From: kasper3 <33230602+kasper3@users.noreply.github.com> +Date: Tue, 10 Apr 2018 21:55:35 +0300 +Subject: [PATCH] Silent the warning on XCode 9.3's clang (#28976) + +--- + src/Native/Unix/System.Native/pal_process.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git dotnet/src/corefx/src/Native/Unix/System.Native/pal_process.cpp dotnet/src/corefx/src/Native/Unix/System.Native/pal_process.cpp +index 551c017fec..0d627f4588 100644 +--- dotnet/src/corefx/src/Native/Unix/System.Native/pal_process.cpp ++++ dotnet/src/corefx/src/Native/Unix/System.Native/pal_process.cpp +@@ -369,6 +369,7 @@ static rlim_t ConvertFromManagedRLimitInfinityToPalIfNecessary(uint64_t value) + // rlim_t type can vary per platform, so we also treat anything outside its range as infinite. + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wunknown-pragmas" ++#pragma clang diagnostic ignored "-Wunknown-warning-option" + #pragma clang diagnostic ignored "-Wtautological-type-limit-compare" + if (value == UINT64_MAX || value > std::numeric_limits::max()) + #pragma clang diagnostic pop +-- +2.17.0 + diff --git a/corefx-clang6.patch b/corefx-clang6.patch new file mode 100644 index 0000000..8fcd09a --- /dev/null +++ b/corefx-clang6.patch @@ -0,0 +1,332 @@ +--- dotnet/src/corefx/src/Native/Unix/System.Net.Http.Native/pal_versioninfo.cpp.orig 2018-04-23 18:51:04.400019840 -0400 ++++ dotnet/src/corefx/src/Native/Unix/System.Net.Http.Native/pal_versioninfo.cpp 2018-04-23 18:58:50.057184551 -0400 +@@ -8,36 +8,36 @@ + #include + #include + +-static_assert(PAL_CURL_VERSION_IPV6 == CURL_VERSION_IPV6, ""); +-static_assert(PAL_CURL_VERSION_KERBEROS4 == CURL_VERSION_KERBEROS4, ""); +-static_assert(PAL_CURL_VERSION_SSL == CURL_VERSION_SSL, ""); +-static_assert(PAL_CURL_VERSION_LIBZ == CURL_VERSION_LIBZ, ""); +-static_assert(PAL_CURL_VERSION_NTLM == CURL_VERSION_NTLM, ""); +-static_assert(PAL_CURL_VERSION_GSSNEGOTIATE == CURL_VERSION_GSSNEGOTIATE, ""); +-static_assert(PAL_CURL_VERSION_DEBUG == CURL_VERSION_DEBUG, ""); +-static_assert(PAL_CURL_VERSION_ASYNCHDNS == CURL_VERSION_ASYNCHDNS, ""); +-static_assert(PAL_CURL_VERSION_SPNEGO == CURL_VERSION_SPNEGO, ""); +-static_assert(PAL_CURL_VERSION_LARGEFILE == CURL_VERSION_LARGEFILE, ""); +-static_assert(PAL_CURL_VERSION_IDN == CURL_VERSION_IDN, ""); +-static_assert(PAL_CURL_VERSION_SSPI == CURL_VERSION_SSPI, ""); +-static_assert(PAL_CURL_VERSION_CONV == CURL_VERSION_CONV, ""); +-static_assert(PAL_CURL_VERSION_CURLDEBUG == CURL_VERSION_CURLDEBUG, ""); +-static_assert(PAL_CURL_VERSION_TLSAUTH_SRP == CURL_VERSION_TLSAUTH_SRP, ""); +-static_assert(PAL_CURL_VERSION_NTLM_WB == CURL_VERSION_NTLM_WB, ""); ++static_assert((int)PAL_CURL_VERSION_IPV6 == CURL_VERSION_IPV6, ""); ++static_assert((int)PAL_CURL_VERSION_KERBEROS4 == CURL_VERSION_KERBEROS4, ""); ++static_assert((int)PAL_CURL_VERSION_SSL == CURL_VERSION_SSL, ""); ++static_assert((int)PAL_CURL_VERSION_LIBZ == CURL_VERSION_LIBZ, ""); ++static_assert((int)PAL_CURL_VERSION_NTLM == CURL_VERSION_NTLM, ""); ++static_assert((int)PAL_CURL_VERSION_GSSNEGOTIATE == CURL_VERSION_GSSNEGOTIATE, ""); ++static_assert((int)PAL_CURL_VERSION_DEBUG == CURL_VERSION_DEBUG, ""); ++static_assert((int)PAL_CURL_VERSION_ASYNCHDNS == CURL_VERSION_ASYNCHDNS, ""); ++static_assert((int)PAL_CURL_VERSION_SPNEGO == CURL_VERSION_SPNEGO, ""); ++static_assert((int)PAL_CURL_VERSION_LARGEFILE == CURL_VERSION_LARGEFILE, ""); ++static_assert((int)PAL_CURL_VERSION_IDN == CURL_VERSION_IDN, ""); ++static_assert((int)PAL_CURL_VERSION_SSPI == CURL_VERSION_SSPI, ""); ++static_assert((int)PAL_CURL_VERSION_CONV == CURL_VERSION_CONV, ""); ++static_assert((int)PAL_CURL_VERSION_CURLDEBUG == CURL_VERSION_CURLDEBUG, ""); ++static_assert((int)PAL_CURL_VERSION_TLSAUTH_SRP == CURL_VERSION_TLSAUTH_SRP, ""); ++static_assert((int)PAL_CURL_VERSION_NTLM_WB == CURL_VERSION_NTLM_WB, ""); + #ifdef CURL_VERSION_HTTP2 +-static_assert(PAL_CURL_VERSION_HTTP2 == CURL_VERSION_HTTP2, ""); ++static_assert((int)PAL_CURL_VERSION_HTTP2 == CURL_VERSION_HTTP2, ""); + #endif + #ifdef CURL_VERSION_GSSAPI +-static_assert(PAL_CURL_VERSION_GSSAPI == CURL_VERSION_GSSAPI, ""); ++static_assert((int)PAL_CURL_VERSION_GSSAPI == CURL_VERSION_GSSAPI, ""); + #endif + #ifdef CURL_VERSION_KERBEROS5 +-static_assert(PAL_CURL_VERSION_KERBEROS5 == CURL_VERSION_KERBEROS5, ""); ++static_assert((int)PAL_CURL_VERSION_KERBEROS5 == CURL_VERSION_KERBEROS5, ""); + #endif + #ifdef CURL_VERSION_UNIX_SOCKETS +-static_assert(PAL_CURL_VERSION_UNIX_SOCKETS == CURL_VERSION_UNIX_SOCKETS, ""); ++static_assert((int)PAL_CURL_VERSION_UNIX_SOCKETS == CURL_VERSION_UNIX_SOCKETS, ""); + #endif + #ifdef CURL_VERSION_PSL +-static_assert(PAL_CURL_VERSION_PSL == CURL_VERSION_PSL, ""); ++static_assert((int)PAL_CURL_VERSION_PSL == CURL_VERSION_PSL, ""); + #endif + + // Based on docs/libcurl/symbols-in-versions in libcurl source tree, +--- dotnet-2.0.7/src/corefx/src/Native/Unix/System.Net.Http.Native/pal_multi.cpp.orig 2018-04-20 11:02:33.000000000 -0400 ++++ dotnet-2.0.7/src/corefx/src/Native/Unix/System.Net.Http.Native/pal_multi.cpp 2018-04-23 19:00:48.579717419 -0400 +@@ -9,26 +9,26 @@ + #include + #include + +-static_assert(PAL_CURLM_CALL_MULTI_PERFORM == CURLM_CALL_MULTI_PERFORM, ""); +-static_assert(PAL_CURLM_OK == CURLM_OK, ""); +-static_assert(PAL_CURLM_BAD_HANDLE == CURLM_BAD_HANDLE, ""); +-static_assert(PAL_CURLM_BAD_EASY_HANDLE == CURLM_BAD_EASY_HANDLE, ""); +-static_assert(PAL_CURLM_OUT_OF_MEMORY == CURLM_OUT_OF_MEMORY, ""); +-static_assert(PAL_CURLM_INTERNAL_ERROR == CURLM_INTERNAL_ERROR, ""); +-static_assert(PAL_CURLM_BAD_SOCKET == CURLM_BAD_SOCKET, ""); +-static_assert(PAL_CURLM_UNKNOWN_OPTION == CURLM_UNKNOWN_OPTION, ""); ++static_assert((int)PAL_CURLM_CALL_MULTI_PERFORM == CURLM_CALL_MULTI_PERFORM, ""); ++static_assert((int)PAL_CURLM_OK == CURLM_OK, ""); ++static_assert((int)PAL_CURLM_BAD_HANDLE == CURLM_BAD_HANDLE, ""); ++static_assert((int)PAL_CURLM_BAD_EASY_HANDLE == CURLM_BAD_EASY_HANDLE, ""); ++static_assert((int)PAL_CURLM_OUT_OF_MEMORY == CURLM_OUT_OF_MEMORY, ""); ++static_assert((int)PAL_CURLM_INTERNAL_ERROR == CURLM_INTERNAL_ERROR, ""); ++static_assert((int)PAL_CURLM_BAD_SOCKET == CURLM_BAD_SOCKET, ""); ++static_assert((int)PAL_CURLM_UNKNOWN_OPTION == CURLM_UNKNOWN_OPTION, ""); + #if HAVE_CURLM_ADDED_ALREADY +-static_assert(PAL_CURLM_ADDED_ALREADY == CURLM_ADDED_ALREADY, ""); ++static_assert((int)PAL_CURLM_ADDED_ALREADY == CURLM_ADDED_ALREADY, ""); + #endif +-static_assert(PAL_CURLMOPT_PIPELINING == CURLMOPT_PIPELINING, ""); ++static_assert((int)PAL_CURLMOPT_PIPELINING == CURLMOPT_PIPELINING, ""); + #ifdef CURLMOPT_MAX_HOST_CONNECTIONS +-static_assert(PAL_CURLMOPT_MAX_HOST_CONNECTIONS == CURLMOPT_MAX_HOST_CONNECTIONS, ""); ++static_assert((int)PAL_CURLMOPT_MAX_HOST_CONNECTIONS == CURLMOPT_MAX_HOST_CONNECTIONS, ""); + #endif + #if HAVE_CURLPIPE_MULTIPLEX +-static_assert(PAL_CURLPIPE_MULTIPLEX == CURLPIPE_MULTIPLEX, ""); ++static_assert((int)PAL_CURLPIPE_MULTIPLEX == CURLPIPE_MULTIPLEX, ""); + #endif + +-static_assert(PAL_CURLMSG_DONE == CURLMSG_DONE, ""); ++static_assert((int)PAL_CURLMSG_DONE == CURLMSG_DONE, ""); + + extern "C" CURLM* HttpNative_MultiCreate() + { +--- dotnet-2.0.7/src/corefx/src/Native/Unix/System.Net.Http.Native/pal_easy.cpp.orig 2018-04-20 11:02:33.000000000 -0400 ++++ dotnet-2.0.7/src/corefx/src/Native/Unix/System.Net.Http.Native/pal_easy.cpp 2018-04-23 19:04:08.769928413 -0400 +@@ -8,102 +8,102 @@ + #include + #include + +-static_assert(PAL_CURLOPT_INFILESIZE == CURLOPT_INFILESIZE, ""); +-static_assert(PAL_CURLOPT_SSLVERSION == CURLOPT_SSLVERSION, ""); +-static_assert(PAL_CURLOPT_VERBOSE == CURLOPT_VERBOSE, ""); +-static_assert(PAL_CURLOPT_NOBODY == CURLOPT_NOBODY, ""); +-static_assert(PAL_CURLOPT_UPLOAD == CURLOPT_UPLOAD, ""); +-static_assert(PAL_CURLOPT_POST == CURLOPT_POST, ""); +-static_assert(PAL_CURLOPT_FOLLOWLOCATION == CURLOPT_FOLLOWLOCATION, ""); +-static_assert(PAL_CURLOPT_PROXYPORT == CURLOPT_PROXYPORT, ""); +-static_assert(PAL_CURLOPT_POSTFIELDSIZE == CURLOPT_POSTFIELDSIZE, ""); +-static_assert(PAL_CURLOPT_SSL_VERIFYPEER == CURLOPT_SSL_VERIFYPEER, ""); +-static_assert(PAL_CURLOPT_MAXREDIRS == CURLOPT_MAXREDIRS, ""); +-static_assert(PAL_CURLOPT_SSL_VERIFYHOST == CURLOPT_SSL_VERIFYHOST, ""); +-static_assert(PAL_CURLOPT_HTTP_VERSION == CURLOPT_HTTP_VERSION, ""); +-static_assert(PAL_CURLOPT_DNS_CACHE_TIMEOUT == CURLOPT_DNS_CACHE_TIMEOUT, ""); +-static_assert(PAL_CURLOPT_NOSIGNAL == CURLOPT_NOSIGNAL, ""); +-static_assert(PAL_CURLOPT_PROXYTYPE == CURLOPT_PROXYTYPE, ""); +-static_assert(PAL_CURLOPT_HTTPAUTH == CURLOPT_HTTPAUTH, ""); +-static_assert(PAL_CURLOPT_TCP_NODELAY == CURLOPT_TCP_NODELAY, ""); +-static_assert(PAL_CURLOPT_CONNECTTIMEOUT_MS == CURLOPT_CONNECTTIMEOUT_MS, ""); +-static_assert(PAL_CURLOPT_ADDRESS_SCOPE == CURLOPT_ADDRESS_SCOPE, ""); +-static_assert(PAL_CURLOPT_PROTOCOLS == CURLOPT_PROTOCOLS, ""); +-static_assert(PAL_CURLOPT_REDIR_PROTOCOLS == CURLOPT_REDIR_PROTOCOLS, ""); +- +-static_assert(PAL_CURLOPT_URL == CURLOPT_URL, ""); +-static_assert(PAL_CURLOPT_PROXY == CURLOPT_PROXY, ""); +-static_assert(PAL_CURLOPT_PROXYUSERPWD == CURLOPT_PROXYUSERPWD, ""); +-static_assert(PAL_CURLOPT_COOKIE == CURLOPT_COOKIE, ""); +-static_assert(PAL_CURLOPT_HTTPHEADER == CURLOPT_HTTPHEADER, ""); +-static_assert(PAL_CURLOPT_CUSTOMREQUEST == CURLOPT_CUSTOMREQUEST, ""); +-static_assert(PAL_CURLOPT_ACCEPT_ENCODING == CURLOPT_ACCEPT_ENCODING, ""); +-static_assert(PAL_CURLOPT_PRIVATE == CURLOPT_PRIVATE, ""); +-static_assert(PAL_CURLOPT_COPYPOSTFIELDS == CURLOPT_COPYPOSTFIELDS, ""); +-static_assert(PAL_CURLOPT_USERNAME == CURLOPT_USERNAME, ""); +-static_assert(PAL_CURLOPT_PASSWORD == CURLOPT_PASSWORD, ""); +- +-static_assert(PAL_CURLOPT_INFILESIZE_LARGE == CURLOPT_INFILESIZE_LARGE, ""); +-static_assert(PAL_CURLOPT_POSTFIELDSIZE_LARGE == CURLOPT_POSTFIELDSIZE_LARGE, ""); +- +-static_assert(PAL_CURLE_OK == CURLE_OK, ""); +-static_assert(PAL_CURLE_UNSUPPORTED_PROTOCOL == CURLE_UNSUPPORTED_PROTOCOL, ""); +-static_assert(PAL_CURLE_FAILED_INIT == CURLE_FAILED_INIT, ""); +-static_assert(PAL_CURLE_NOT_BUILT_IN == CURLE_NOT_BUILT_IN, ""); +-static_assert(PAL_CURLE_COULDNT_RESOLVE_HOST == CURLE_COULDNT_RESOLVE_HOST, ""); +-static_assert(PAL_CURLE_OUT_OF_MEMORY == CURLE_OUT_OF_MEMORY, ""); +-static_assert(PAL_CURLE_OPERATION_TIMEDOUT == CURLE_OPERATION_TIMEDOUT, ""); +-static_assert(PAL_CURLE_ABORTED_BY_CALLBACK == CURLE_ABORTED_BY_CALLBACK, ""); +-static_assert(PAL_CURLE_UNKNOWN_OPTION == CURLE_UNKNOWN_OPTION, ""); +-static_assert(PAL_CURLE_RECV_ERROR == CURLE_RECV_ERROR, ""); +-static_assert(PAL_CURLE_SEND_FAIL_REWIND == CURLE_SEND_FAIL_REWIND, ""); +- +-static_assert(PAL_CURL_HTTP_VERSION_NONE == CURL_HTTP_VERSION_NONE, ""); +-static_assert(PAL_CURL_HTTP_VERSION_1_0 == CURL_HTTP_VERSION_1_0, ""); +-static_assert(PAL_CURL_HTTP_VERSION_1_1 == CURL_HTTP_VERSION_1_1, ""); ++static_assert((int)PAL_CURLOPT_INFILESIZE == CURLOPT_INFILESIZE, ""); ++static_assert((int)PAL_CURLOPT_SSLVERSION == CURLOPT_SSLVERSION, ""); ++static_assert((int)PAL_CURLOPT_VERBOSE == CURLOPT_VERBOSE, ""); ++static_assert((int)PAL_CURLOPT_NOBODY == CURLOPT_NOBODY, ""); ++static_assert((int)PAL_CURLOPT_UPLOAD == CURLOPT_UPLOAD, ""); ++static_assert((int)PAL_CURLOPT_POST == CURLOPT_POST, ""); ++static_assert((int)PAL_CURLOPT_FOLLOWLOCATION == CURLOPT_FOLLOWLOCATION, ""); ++static_assert((int)PAL_CURLOPT_PROXYPORT == CURLOPT_PROXYPORT, ""); ++static_assert((int)PAL_CURLOPT_POSTFIELDSIZE == CURLOPT_POSTFIELDSIZE, ""); ++static_assert((int)PAL_CURLOPT_SSL_VERIFYPEER == CURLOPT_SSL_VERIFYPEER, ""); ++static_assert((int)PAL_CURLOPT_MAXREDIRS == CURLOPT_MAXREDIRS, ""); ++static_assert((int)PAL_CURLOPT_SSL_VERIFYHOST == CURLOPT_SSL_VERIFYHOST, ""); ++static_assert((int)PAL_CURLOPT_HTTP_VERSION == CURLOPT_HTTP_VERSION, ""); ++static_assert((int)PAL_CURLOPT_DNS_CACHE_TIMEOUT == CURLOPT_DNS_CACHE_TIMEOUT, ""); ++static_assert((int)PAL_CURLOPT_NOSIGNAL == CURLOPT_NOSIGNAL, ""); ++static_assert((int)PAL_CURLOPT_PROXYTYPE == CURLOPT_PROXYTYPE, ""); ++static_assert((int)PAL_CURLOPT_HTTPAUTH == CURLOPT_HTTPAUTH, ""); ++static_assert((int)PAL_CURLOPT_TCP_NODELAY == CURLOPT_TCP_NODELAY, ""); ++static_assert((int)PAL_CURLOPT_CONNECTTIMEOUT_MS == CURLOPT_CONNECTTIMEOUT_MS, ""); ++static_assert((int)PAL_CURLOPT_ADDRESS_SCOPE == CURLOPT_ADDRESS_SCOPE, ""); ++static_assert((int)PAL_CURLOPT_PROTOCOLS == CURLOPT_PROTOCOLS, ""); ++static_assert((int)PAL_CURLOPT_REDIR_PROTOCOLS == CURLOPT_REDIR_PROTOCOLS, ""); ++ ++static_assert((int)PAL_CURLOPT_URL == CURLOPT_URL, ""); ++static_assert((int)PAL_CURLOPT_PROXY == CURLOPT_PROXY, ""); ++static_assert((int)PAL_CURLOPT_PROXYUSERPWD == CURLOPT_PROXYUSERPWD, ""); ++static_assert((int)PAL_CURLOPT_COOKIE == CURLOPT_COOKIE, ""); ++static_assert((int)PAL_CURLOPT_HTTPHEADER == CURLOPT_HTTPHEADER, ""); ++static_assert((int)PAL_CURLOPT_CUSTOMREQUEST == CURLOPT_CUSTOMREQUEST, ""); ++static_assert((int)PAL_CURLOPT_ACCEPT_ENCODING == CURLOPT_ACCEPT_ENCODING, ""); ++static_assert((int)PAL_CURLOPT_PRIVATE == CURLOPT_PRIVATE, ""); ++static_assert((int)PAL_CURLOPT_COPYPOSTFIELDS == CURLOPT_COPYPOSTFIELDS, ""); ++static_assert((int)PAL_CURLOPT_USERNAME == CURLOPT_USERNAME, ""); ++static_assert((int)PAL_CURLOPT_PASSWORD == CURLOPT_PASSWORD, ""); ++ ++static_assert((int)PAL_CURLOPT_INFILESIZE_LARGE == CURLOPT_INFILESIZE_LARGE, ""); ++static_assert((int)PAL_CURLOPT_POSTFIELDSIZE_LARGE == CURLOPT_POSTFIELDSIZE_LARGE, ""); ++ ++static_assert((int)PAL_CURLE_OK == CURLE_OK, ""); ++static_assert((int)PAL_CURLE_UNSUPPORTED_PROTOCOL == CURLE_UNSUPPORTED_PROTOCOL, ""); ++static_assert((int)PAL_CURLE_FAILED_INIT == CURLE_FAILED_INIT, ""); ++static_assert((int)PAL_CURLE_NOT_BUILT_IN == CURLE_NOT_BUILT_IN, ""); ++static_assert((int)PAL_CURLE_COULDNT_RESOLVE_HOST == CURLE_COULDNT_RESOLVE_HOST, ""); ++static_assert((int)PAL_CURLE_OUT_OF_MEMORY == CURLE_OUT_OF_MEMORY, ""); ++static_assert((int)PAL_CURLE_OPERATION_TIMEDOUT == CURLE_OPERATION_TIMEDOUT, ""); ++static_assert((int)PAL_CURLE_ABORTED_BY_CALLBACK == CURLE_ABORTED_BY_CALLBACK, ""); ++static_assert((int)PAL_CURLE_UNKNOWN_OPTION == CURLE_UNKNOWN_OPTION, ""); ++static_assert((int)PAL_CURLE_RECV_ERROR == CURLE_RECV_ERROR, ""); ++static_assert((int)PAL_CURLE_SEND_FAIL_REWIND == CURLE_SEND_FAIL_REWIND, ""); ++ ++static_assert((int)PAL_CURL_HTTP_VERSION_NONE == CURL_HTTP_VERSION_NONE, ""); ++static_assert((int)PAL_CURL_HTTP_VERSION_1_0 == CURL_HTTP_VERSION_1_0, ""); ++static_assert((int)PAL_CURL_HTTP_VERSION_1_1 == CURL_HTTP_VERSION_1_1, ""); + #if HAVE_CURL_HTTP_VERSION_2_0 +-static_assert(PAL_CURL_HTTP_VERSION_2_0 == CURL_HTTP_VERSION_2_0, ""); ++static_assert((int)PAL_CURL_HTTP_VERSION_2_0 == CURL_HTTP_VERSION_2_0, ""); + #endif + +-static_assert(PAL_CURL_SSLVERSION_TLSv1 == CURL_SSLVERSION_TLSv1, ""); ++static_assert((int)PAL_CURL_SSLVERSION_TLSv1 == CURL_SSLVERSION_TLSv1, ""); + #if HAVE_CURL_SSLVERSION_TLSv1_012 +-static_assert(PAL_CURL_SSLVERSION_TLSv1_0 == CURL_SSLVERSION_TLSv1_0, ""); +-static_assert(PAL_CURL_SSLVERSION_TLSv1_1 == CURL_SSLVERSION_TLSv1_1, ""); +-static_assert(PAL_CURL_SSLVERSION_TLSv1_2 == CURL_SSLVERSION_TLSv1_2, ""); ++static_assert((int)PAL_CURL_SSLVERSION_TLSv1_0 == CURL_SSLVERSION_TLSv1_0, ""); ++static_assert((int)PAL_CURL_SSLVERSION_TLSv1_1 == CURL_SSLVERSION_TLSv1_1, ""); ++static_assert((int)PAL_CURL_SSLVERSION_TLSv1_2 == CURL_SSLVERSION_TLSv1_2, ""); + #endif + +-static_assert(PAL_CURLINFO_EFFECTIVE_URL == CURLINFO_EFFECTIVE_URL, ""); +-static_assert(PAL_CURLINFO_PRIVATE == CURLINFO_PRIVATE, ""); +-static_assert(PAL_CURLINFO_HTTPAUTH_AVAIL == CURLINFO_HTTPAUTH_AVAIL, ""); +- +-static_assert(PAL_CURLAUTH_None == CURLAUTH_NONE, ""); +-static_assert(PAL_CURLAUTH_Basic == CURLAUTH_BASIC, ""); +-static_assert(PAL_CURLAUTH_Digest == CURLAUTH_DIGEST, ""); +-static_assert(PAL_CURLAUTH_Negotiate == CURLAUTH_GSSNEGOTIATE, ""); +-static_assert(PAL_CURLAUTH_NTLM == CURLAUTH_NTLM, ""); +- +-static_assert(PAL_CURLPROXY_HTTP == CURLPROXY_HTTP, ""); +- +-static_assert(PAL_CURLPROTO_HTTP == CURLPROTO_HTTP, ""); +-static_assert(PAL_CURLPROTO_HTTPS == CURLPROTO_HTTPS, ""); +- +-static_assert(PAL_CURL_SEEKFUNC_OK == CURL_SEEKFUNC_OK, ""); +-static_assert(PAL_CURL_SEEKFUNC_FAIL == CURL_SEEKFUNC_FAIL, ""); +-static_assert(PAL_CURL_SEEKFUNC_CANTSEEK == CURL_SEEKFUNC_CANTSEEK, ""); +- +-static_assert(PAL_CURL_READFUNC_ABORT == CURL_READFUNC_ABORT, ""); +-static_assert(PAL_CURL_READFUNC_PAUSE == CURL_READFUNC_PAUSE, ""); +-static_assert(PAL_CURL_WRITEFUNC_PAUSE == CURL_WRITEFUNC_PAUSE, ""); +- +-static_assert(PAL_CURLINFO_TEXT == CURLINFO_TEXT, ""); +-static_assert(PAL_CURLINFO_HEADER_IN == CURLINFO_HEADER_IN, ""); +-static_assert(PAL_CURLINFO_HEADER_OUT == CURLINFO_HEADER_OUT, ""); +-static_assert(PAL_CURLINFO_DATA_IN == CURLINFO_DATA_IN, ""); +-static_assert(PAL_CURLINFO_DATA_OUT == CURLINFO_DATA_OUT, ""); +-static_assert(PAL_CURLINFO_SSL_DATA_IN == CURLINFO_SSL_DATA_IN, ""); +-static_assert(PAL_CURLINFO_SSL_DATA_OUT == CURLINFO_SSL_DATA_OUT, ""); ++static_assert((int)PAL_CURLINFO_EFFECTIVE_URL == CURLINFO_EFFECTIVE_URL, ""); ++static_assert((int)PAL_CURLINFO_PRIVATE == CURLINFO_PRIVATE, ""); ++static_assert((int)PAL_CURLINFO_HTTPAUTH_AVAIL == CURLINFO_HTTPAUTH_AVAIL, ""); ++ ++static_assert((int)PAL_CURLAUTH_None == CURLAUTH_NONE, ""); ++static_assert((int)PAL_CURLAUTH_Basic == CURLAUTH_BASIC, ""); ++static_assert((int)PAL_CURLAUTH_Digest == CURLAUTH_DIGEST, ""); ++static_assert((int)PAL_CURLAUTH_Negotiate == CURLAUTH_GSSNEGOTIATE, ""); ++static_assert((int)PAL_CURLAUTH_NTLM == CURLAUTH_NTLM, ""); ++ ++static_assert((int)PAL_CURLPROXY_HTTP == CURLPROXY_HTTP, ""); ++ ++static_assert((int)PAL_CURLPROTO_HTTP == CURLPROTO_HTTP, ""); ++static_assert((int)PAL_CURLPROTO_HTTPS == CURLPROTO_HTTPS, ""); ++ ++static_assert((int)PAL_CURL_SEEKFUNC_OK == CURL_SEEKFUNC_OK, ""); ++static_assert((int)PAL_CURL_SEEKFUNC_FAIL == CURL_SEEKFUNC_FAIL, ""); ++static_assert((int)PAL_CURL_SEEKFUNC_CANTSEEK == CURL_SEEKFUNC_CANTSEEK, ""); ++ ++static_assert((int)PAL_CURL_READFUNC_ABORT == CURL_READFUNC_ABORT, ""); ++static_assert((int)PAL_CURL_READFUNC_PAUSE == CURL_READFUNC_PAUSE, ""); ++static_assert((int)PAL_CURL_WRITEFUNC_PAUSE == CURL_WRITEFUNC_PAUSE, ""); ++ ++static_assert((int)PAL_CURLINFO_TEXT == CURLINFO_TEXT, ""); ++static_assert((int)PAL_CURLINFO_HEADER_IN == CURLINFO_HEADER_IN, ""); ++static_assert((int)PAL_CURLINFO_HEADER_OUT == CURLINFO_HEADER_OUT, ""); ++static_assert((int)PAL_CURLINFO_DATA_IN == CURLINFO_DATA_IN, ""); ++static_assert((int)PAL_CURLINFO_DATA_OUT == CURLINFO_DATA_OUT, ""); ++static_assert((int)PAL_CURLINFO_SSL_DATA_IN == CURLINFO_SSL_DATA_IN, ""); ++static_assert((int)PAL_CURLINFO_SSL_DATA_OUT == CURLINFO_SSL_DATA_OUT, ""); + +-static_assert(PAL_CURL_MAX_HTTP_HEADER == CURL_MAX_HTTP_HEADER, ""); ++static_assert((int)PAL_CURL_MAX_HTTP_HEADER == CURL_MAX_HTTP_HEADER, ""); + + extern "C" CURL* HttpNative_EasyCreate() + { +--- dotnet/src/corefx/src/Native/Unix/CMakeLists.txt 2018-04-24 11:22:53.290510537 -0400 ++++ dotnet/src/corefx/src/Native/Unix/CMakeLists.txt 2018-04-24 11:25:18.883504641 -0400 +@@ -15,11 +15,18 @@ + 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(-Wno-padded) ++add_compile_options(-Wno-empty-translation-unit) ++add_compile_options(-Wno-old-style-cast) ++add_compile_options(-Wno-cast-align) ++add_compile_options(-Wno-typedef-redefinition) ++add_compile_options(-Wno-unused-local-typedef) ++add_compile_options(-Wno-c99-extensions) ++add_compile_options(-Wno-c11-extensions) + 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) +-add_compile_options(-Wno-c99-extensions) + add_compile_options(-g) + + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) +--- dotnet/src/corefx/src/Native/Unix/System.Native/pal_process.cpp ++++ dotnet/src/corefx/src/Native/Unix/System.Native/pal_process.cpp +@@ -367,7 +367,11 @@ static int32_t ConvertRLimitResourcesPalToPlatform(RLimitResources value) + static rlim_t ConvertFromManagedRLimitInfinityToPalIfNecessary(uint64_t value) + { + // rlim_t type can vary per platform, so we also treat anything outside its range as infinite. ++#pragma clang diagnostic push ++#pragma clang diagnostic ignored "-Wunknown-pragmas" ++#pragma clang diagnostic ignored "-Wtautological-type-limit-compare" + if (value == UINT64_MAX || value > std::numeric_limits::max()) ++#pragma clang diagnostic pop + return RLIM_INFINITY; + + return static_cast(value); diff --git a/corefx-less-warnings.patch b/corefx-less-warnings.patch new file mode 100644 index 0000000..78ec9a8 --- /dev/null +++ b/corefx-less-warnings.patch @@ -0,0 +1,65 @@ +From f2c05eb07f53d69507697908ba44db48cc1cf25c Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Thu, 15 Feb 2018 17:38:42 -0500 +Subject: [PATCH] Fix build on clang 5 + +This contains two fixes, both related to new warnings introduced with +clang 5: +http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html + +1. clang 5 introduces a -Wzero-as-null-pointer-constant warning, which +becomes an error with Werror. This warning is not known by older +versions of clang and affects a lot of C/C++ code, such as: + + static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; + +It also affects code we pick up from our dependency libraries. Lets +check if the compiler knows about this warning and disable it if so. + +2. clang 5 introduces checks for casts. The library expects a `char *`, +so lets cast our pointer to the expected type so it will continue +working. +--- + src/Native/Unix/CMakeLists.txt | 3 +++ + src/Native/Unix/System.Security.Cryptography.Native/pal_ssl.cpp | 2 +- + src/Native/Unix/configure.cmake | 8 ++++++++ + 3 files changed, 12 insertions(+), 1 deletion(-) + +diff --git dotnet/src/corefx/src/Native/Unix/CMakeLists.txt dotnet/src/corefx/src/Native/Unix/CMakeLists.txt +index 739c2d2b1ef9..7d804a1e541d 100644 +--- dotnet/src/corefx/src/Native/Unix/CMakeLists.txt ++++ dotnet/src/corefx/src/Native/Unix/CMakeLists.txt +@@ -259,6 +259,10 @@ + + include(configure.cmake) + ++if (HAVE_ZERO_AS_NULL_POINTER_CONSTANT_FLAG) ++ add_compile_options(-Wno-zero-as-null-pointer-constant) ++endif() ++ + add_subdirectory(System.IO.Compression.Native) + add_subdirectory(System.Native) + add_subdirectory(System.Net.Http.Native) +diff --git dotnet/src/corefx/src/Native/Unix/configure.cmake dotnet/src/corefx/src/Native/Unix/configure.cmake +index 497dc2173817..8e7726fad57d 100644 +--- dotnet/src/corefx/src/Native/Unix/configure.cmake ++++ dotnet/src/corefx/src/Native/Unix/configure.cmake +@@ -1,3 +1,4 @@ ++include(CheckCXXCompilerFlag) + include(CheckCXXSourceCompiles) + include(CheckCXXSourceRuns) + include(CheckFunctionExists) +@@ -29,6 +30,13 @@ endif () + # We compile with -Werror, so we need to make sure these code fragments compile without warnings. + set(CMAKE_REQUIRED_FLAGS -Werror) + ++# This compiler warning will fail code as innocuous as: ++# static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; ++# Check if the compiler knows about this warning so we can disable it ++check_cxx_compiler_flag( ++ -Wzero-as-null-pointer-constant ++ HAVE_ZERO_AS_NULL_POINTER_CONSTANT_FLAG) ++ + # in_pktinfo: Find whether this struct exists + check_include_files( + linux/in.h diff --git a/corefx-not-portable.patch b/corefx-not-portable.patch new file mode 100644 index 0000000..532c49e --- /dev/null +++ b/corefx-not-portable.patch @@ -0,0 +1,14 @@ +See https://github.com/dotnet/source-build/issues/286 + +diff -ruN dotnet/targets/corefx.targets dotnet/targets/corefx.targets +--- dotnet/targets/corefx.targets 2017-10-25 20:40:18.000000000 -0400 ++++ dotnet/targets/corefx.targets 2017-11-10 12:39:18.045215772 -0500 +@@ -16,7 +16,7 @@ + + +- + diff --git a/do-not-strip-debuginfo.patch b/do-not-strip-debuginfo.patch new file mode 100644 index 0000000..a6d432d --- /dev/null +++ b/do-not-strip-debuginfo.patch @@ -0,0 +1,36 @@ +Do not strip debuginfo from native binaries + +See https://github.com/dotnet/source-build/pull/272 and https://github.com/dotnet/source-build/pull/272 + +diff -ruN dotnet/src/corefx/src/Native/Unix/CMakeLists.txt dotnet/src/corefx/src/Native/Unix/CMakeLists.txt +--- dotnet/src/corefx/src/Native/Unix/CMakeLists.txt 2017-10-25 20:38:56.000000000 -0400 ++++ dotnet/src/corefx/src/Native/Unix/CMakeLists.txt 2017-11-09 13:05:54.053454759 -0500 +@@ -20,6 +20,7 @@ + add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common) + add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common) + add_compile_options(-Wno-c99-extensions) ++add_compile_options(-g) + + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) + add_compile_options(-Wno-unreachable-code) +@@ -60,7 +61,7 @@ + + string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE) + if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG) +- add_compile_options(-g -O0) ++ add_compile_options(-O0) + add_definitions(-DDEBUG) + + # obtain settings from running coreclr\enablesanitizers.sh +diff -ruN dotnet/targets/coreclr.props dotnet/targets/coreclr.props +--- dotnet/targets/coreclr.props 2017-11-09 12:52:08.413769785 -0500 ++++ dotnet/targets/coreclr.props 2017-11-09 13:01:20.655552475 -0500 +@@ -3,7 +3,7 @@ + + $(PathToRepo) + $(Platform) $(Configuration) skiptests -PortableBuild=false msbuildonunsupportedplatform +- $(BuildArguments) skipnuget cross -skiprestore stripSymbols ++ $(BuildArguments) skipnuget cross -skiprestore + $(ProjectDirectory)/build$(ShellExtension) $(BuildArguments) + $(ArmEnvironmentVariables) $(BuildCommand) + $(ProjectDirectory)/bin/Product/$(TargetOS).$(Platform).$(Configuration)/.nuget/pkg/ diff --git a/dotnet.spec b/dotnet.spec new file mode 100644 index 0000000..348cab2 --- /dev/null +++ b/dotnet.spec @@ -0,0 +1,330 @@ + +# Avoid provides/requires from private libraries +%global privlibs libhostfxr +%global privlibs %{privlibs}|libclrjit +%global privlibs %{privlibs}|libcoreclr +%global privlibs %{privlibs}|libcoreclrtraceptprovider +%global privlibs %{privlibs}|libdbgshim +%global privlibs %{privlibs}|libhostpolicy +%global privlibs %{privlibs}|libmscordaccore +%global privlibs %{privlibs}|libmscordbi +%global privlibs %{privlibs}|libsos +%global privlibs %{privlibs}|libsosplugin +%global __provides_exclude ^(%{privlibs})\\.so +%global __requires_exclude ^(%{privlibs})\\.so + +%global sdk_version 2.1.105 +%global runtime_version 2.0.7 + +%global template_package microsoft.dotnet.web.projecttemplates.2.0.1.0.0-beta2-20170810-304 + +Name: dotnet +Version: %{runtime_version} +Release: 1%{?dist} +Summary: .NET Core CLI tools and runtime +License: MIT and ASL 2.0 and BSD +URL: https://github.com/dotnet/ + +Source0: https://omajid.fedorapeople.org/dotnet/dotnet-%{runtime_version}.tar.gz +Source1: patch-nuget-packages.sh +Source2: check-debug-symbols.py + +Patch0: missing-exec.patch +# https://github.com/dotnet/coreclr/issues/13009 +# https://github.com/dotnet/core-setup/pull/3129 +Patch1: f27-libc.patch +Patch2: corefx-not-portable.patch +Patch3: do-not-strip-debuginfo.patch +Patch4: coreclr-clang5.patch +Patch5: corefx-less-warnings.patch +Patch6: coreclr-clang6.patch +Patch7: corefx-clang6.patch +Patch8: corefx-clang5-compat.patch + +Patch100: templates-publish-without-manifest.patch + +ExclusiveArch: x86_64 + +BuildRequires: clang +BuildRequires: cmake +BuildRequires: hostname +BuildRequires: krb5-devel +BuildRequires: libcurl-devel +BuildRequires: libicu-devel +BuildRequires: libunwind-devel +BuildRequires: libuuid-devel +BuildRequires: lldb-devel +BuildRequires: llvm +BuildRequires: lttng-ust-devel +BuildRequires: python +BuildRequires: zlib-devel +%if 0%{fedora} >= 26 +BuildRequires: compat-openssl10-devel +%else +BuildRequires: openssl-devel +%endif + +Requires: %{name}-sdk-2.1%{?_isa} = %{version}-%{release} + +%description +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, macOS and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +.NET Core contains a runtime conforming to .NET Standards a set of +framework libraries, an SDK containing compilers and a 'dotnet' +application to drive everything. + +%package host + +Summary: .NET command line launcher + +%description host +The .NET Core host is a command line program that runs a standalone +.NET core application or launches the SDK. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +%package runtime-2.0 + +# Theoretically any version of the host should work +Requires: %{name}-host + +# libicu is dlopen()ed +Requires: libicu + +Summary: NET Core 2.0 runtime + +%description runtime-2.0 +The .NET Core runtime contains everything needed to run .NET Core applications. +It includes a high performance Virtual Machine as well as the framework +libraries used by .NET Core applications. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +%package sdk-2.1 + +Requires: %{name}-runtime-2.0%{?_isa} = %{version}-%{release} + +Provides: %{name}-sdk-2.0 = %{version}-%{release} +Obsoletes: %{name}-sdk-2.0 <= 2.0.0-5 + +Summary: .NET Core 2.1 Software Development Kit + +%description sdk-2.1 +The .NET Core SDK is a collection of command line applications to +create, build, publish and run .NET Core applications. + +.NET Core is a fast, lightweight and modular platform for creating +cross platform applications that work on Linux, Mac and Windows. + +It particularly focuses on creating console applications, web +applications and micro-services. + +%prep +%setup -q -n %{name}-%{version} + +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 + +# The templates are "pre-built" into a nuget package. Lets extract, patch, and +# compile the nuget package back into it. +mkdir templates +pushd templates +unzip ../prebuilt/nuget-packages/%{template_package}.nupkg +rm ../prebuilt/nuget-packages/%{template_package}.nupkg +%patch100 -p1 +zip -r ../prebuilt/nuget-packages/%{template_package}.nupkg . +popd + +%if 0%{?fedora} > 0 +# Add current versions of Fedora as a valid OS +sed -i -e 's|fedora.24|fedora.%{fedora}|g' build.proj +sed -i -e 's|fedora.24|fedora.%{fedora}|g' src/coreclr/build.sh +sed -i -e 's|fedora.23|fedora.%{fedora}|g' src/corefx/pkg/Microsoft.NETCore.Platforms/runtime.json +sed -i -e 's|fedora.23|fedora.%{fedora}|g' src/core-setup/src/pkg/projects/Microsoft.NETCore.App/src/Microsoft.NETCore.App.depproj +sed -i -e 's|fedora.23|fedora.%{fedora}|g' Tools/optional-tool-runtime/optional.json +sed -i -e 's|rhel.7-x64|rhel.7-x64;fedora.%{fedora}|g' Tools/Packaging.targets +find Tools/ -iname 'runtime.json' -exec sed -i -e 's|fedora.23|fedora.%{fedora}|g' {} \; + +# Replace RHEL rid with Fedora rid +sed -i -e 's|rhel.7.4-|fedora.%{fedora}-|g' targets/core-setup.props +sed -i -e 's|rhel.7.4-|fedora.%{fedora}-|g' targets/cli.props +sed -i -e 's|rhel.7.4-|fedora.%{fedora}-|g' src/cli/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj + +sed -i -e '/DOTNET_RUNTIME_ID=rhel.7.4-x64/d' targets/roslyn.props + +sed -i -e 's|:v=normal|:v=diag|g' src/corefx/config.json + +# Fix RIDs in nuget packages +cp %{SOURCE1} patch-nuget-packages.sh +chmod +x patch-nuget-packages.sh +./patch-nuget-packages.sh %{fedora} + +%endif + +%build +# crazy insane hack. the first build fails but a rebuild works... +./build.sh /v:diag || ./build.sh /v:diag + +%install +install -d -m 0755 %{buildroot}%{_libdir}/%{name}/ +ls bin/x64/Release +tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{name}/ + +# Fix permissions on files +find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.props' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.targets' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.dll' -exec chmod -x {} \; +find %{buildroot}%{_libdir}/%{name}/ -type f -name '*.pubxml' -exec chmod -x {} \; + +# Hack. We dont build net46 at the moment as part of source-build, so make it a +# symlink for it. This lets OmniSharp start, at least. See +# https://github.com/dotnet/source-build/issues/125 for more details. +pushd %{buildroot}%{_libdir}/%{name}/sdk/%{sdk_version}/Sdks/Microsoft.NET.Sdk/tools +ln -s netcoreapp1.0 net46 +popd + +install -dm 755 %{buildroot}/%{_datadir}/bash-completion/completions +# dynamic completion needs the file to be named the same as the base command +install src/cli/scripts/register-completions.bash %{buildroot}/%{_datadir}/bash-completion/completions/dotnet + +# TODO: the zsh completion script needs to be ported to use #compdef +#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions +#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet + +install -d -m 0755 %{buildroot}%{_bindir} +ln -s %{_libdir}/%{name}/dotnet %{buildroot}%{_bindir}/ + +install -d -m 0755 %{buildroot}%{_mandir}/man1/ +find -iname 'dotnet*.1' -type f -exec cp {} %{buildroot}%{_mandir}/man1/ \; + +# Check debug symbols in all elf objects. This is not in %%check +# because native binaries are stripped by rpm-build after %%install. +# So we need to do this check earlier. +echo "Testing build results for debug symbols..." +%{SOURCE2} -v %{buildroot}%{_libdir}/%{name}/ + +%check +%{buildroot}%{_libdir}/%{name}/dotnet --info + +%files +# empty package + +%files host +%dir %{_libdir}/%{name} +%{_libdir}/%{name}/dotnet +%{_libdir}/%{name}/host +%{_bindir}/dotnet +%license %{_libdir}/%{name}/LICENSE.txt +%license %{_libdir}/%{name}/ThirdPartyNotices.txt +%doc %{_mandir}/man1/dotnet.1.gz + +%files runtime-2.0 +%dir %{_libdir}/%{name}/shared +%dir %{_libdir}/%{name}/shared/Microsoft.NETCore.App +%{_libdir}/%{name}/shared/Microsoft.NETCore.App/%{runtime_version} + +%files sdk-2.1 +%dir %{_libdir}/%{name}/sdk +%{_libdir}/%{name}/sdk/%{sdk_version} +%doc %{_mandir}/man1/dotnet-*.1.gz +%dir %{_datadir}/bash-completion +%dir %{_datadir}/bash-completion/completions +%{_datadir}/bash-completion/completions/dotnet + +%changelog +* Thu May 03 2018 Omair Majid - 2.0.7-1 +- Update to .NET Core 2.0.7 + +* Wed Mar 28 2018 Omair Majid - 2.0.6-2 +- Enable bash completion for dotnet +- Remove redundant buildrequires and requires + +* Wed Mar 14 2018 Omair Majid - 2.0.6-1 +- Update to .NET Core 2.0.6 + +* Fri Feb 23 2018 Omair Majid - 2.0.5-1 +- Update to .NET Core 2.0.5 + +* Wed Jan 24 2018 Omair Majid - 2.0.3-5 +- Don't apply corefx clang warnings fix on clang < 5 + +* Fri Jan 19 2018 Omair Majid - 2.0.3-4 +- Add a test script to sanity check debug and symbol info. +- Build with clang 5.0 +- Make main package real instead of using a virtual provides (see RHBZ 1519325) + +* Wed Nov 29 2017 Omair Majid - 2.0.3-3 +- Add a Provides for 'dotnet' +- Fix conditional macro + +* Tue Nov 28 2017 Omair Majid - 2.0.3-2 +- Fix build on Fedora 27 + +* Fri Nov 17 2017 Omair Majid - 2.0.3-1 +- Update to .NET Core 2.0.3 + +* Thu Oct 19 2017 Omair Majid - 2.0.0-4 +- Add a hack to let omnisharp work + +* Wed Aug 30 2017 Omair Majid - 2.0.0-3 +- Add a patch for building coreclr and core-setup correctly on Fedora >= 27 + +* Fri Aug 25 2017 Omair Majid - 2.0.0-2 +- Move libicu/libcurl/libunwind requires to runtime package +- Make sdk depend on the exact version of the runtime package + +* Thu Aug 24 2017 Omair Majid - 2.0.0-1 +- Update to 2.0.0 final release + +* Wed Jul 26 2017 Omair Majid - 2.0.0-0.3.preview2 +- Add man pages + +* Tue Jul 25 2017 Omair Majid - 2.0.0-0.2.preview2 +- Add Requires on libicu +- Split into multiple packages +- Do not repeat first-run message + +* Fri Jul 21 2017 Omair Majid - 2.0.0-0.1.preview2 +- Update to .NET Core 2.0 Preview 2 + +* Thu Mar 16 2017 Nemanja Milošević - 1.1.0-7 +- rebuilt with latest libldb +* Wed Feb 22 2017 Nemanja Milosevic - 1.1.0-6 +- compat-openssl 1.0 for F26 for now +* Sun Feb 19 2017 Nemanja Milosevic - 1.1.0-5 +- Fix wrong commit id's +* Sat Feb 18 2017 Nemanja Milosevic - 1.1.0-4 +- Use commit id's instead of branch names +* Sat Feb 18 2017 Nemanja Milosevic - 1.1.0-3 +- Improper patch5 fix +* Sat Feb 18 2017 Nemanja Milosevic - 1.1.0-2 +- SPEC cleanup +- git removal (using all tarballs for reproducible builds) +- more reasonable versioning +* Thu Feb 09 2017 Nemanja Milosevic - 1.1.0-1 +- Fixed debuginfo going to separate package (Patch1) +- Added F25/F26 RIL and fixed the version info (Patch2) +- Added F25/F26 RIL in Microsoft.NETCore.App suported runtime graph (Patch3) +- SPEC file cleanup +* Wed Jan 11 2017 Nemanja Milosevic - 1.1.0-0 +- Initial RPM for Fedora 25/26. + diff --git a/f27-libc.patch b/f27-libc.patch new file mode 100644 index 0000000..977fa23 --- /dev/null +++ b/f27-libc.patch @@ -0,0 +1,69 @@ + +See https://github.com/dotnet/core-setup/pull/3129 and https://github.com/dotnet/coreclr/pull/13785 + +--- dotnet/src/core-setup/src/corehost/cli/json/casablanca/include/cpprest/asyncrt_utils.h ++++ dotnet/src/core-setup/src/corehost/cli/json/casablanca/include/cpprest/asyncrt_utils.h +@@ -40,9 +40,6 @@ + + #ifndef _WIN32 + #include +-#ifdef __GLIBC__ +-#include +-#endif + #endif + + /// Various utilities for string conversions and date and time manipulation. +--- dotnet/src/coreclr/src/pal/src/config.h.in ++++ dotnet/src/coreclr/src/pal/src/config.h.in +@@ -77,6 +77,7 @@ + #cmakedefine01 HAVE_PT_REGS + #cmakedefine01 HAVE_GREGSET_T + #cmakedefine01 HAVE___GREGSET_T ++#cmakedefine01 HAVE_FPSTATE_GLIBC_RESERVED1 + #cmakedefine01 HAVE_SIGINFO_T + #cmakedefine01 HAVE_UCONTEXT_T + #cmakedefine01 HAVE_PTHREAD_RWLOCK_T +--- dotnet/src/coreclr/src/pal/src/configure.cmake ++++ dotnet/src/coreclr/src/pal/src/configure.cmake +@@ -136,6 +136,7 @@ check_struct_has_member ("struct stat" st_atimensec "sys/types.h;sys/stat.h" HAV + check_struct_has_member ("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF) + check_struct_has_member ("ucontext_t" uc_mcontext.gregs[0] ucontext.h HAVE_GREGSET_T) + check_struct_has_member ("ucontext_t" uc_mcontext.__gregs[0] ucontext.h HAVE___GREGSET_T) ++check_struct_has_member ("ucontext_t" uc_mcontext.fpregs->__glibc_reserved1[0] ucontext.h HAVE_FPSTATE_GLIBC_RESERVED1) + check_struct_has_member ("struct sysinfo" mem_unit "sys/sysinfo.h" HAVE_SYSINFO_WITH_MEM_UNIT) + + set(CMAKE_EXTRA_INCLUDE_FILES machine/reg.h) +--- dotnet/src/coreclr/src/pal/src/include/pal/context.h ++++ dotnet/src/coreclr/src/pal/src/include/pal/context.h +@@ -151,22 +151,28 @@ using asm_sigcontext::_xstate; + + #ifdef XSTATE_SUPPORTED + ++#if HAVE_FPSTATE_GLIBC_RESERVED1 ++#define FPSTATE_RESERVED __glibc_reserved1 ++#else ++#define FPSTATE_RESERVED padding ++#endif ++ + // The mask for YMM registers presence flag stored in the xstate_bv. On current Linuxes, this definition is + // only in internal headers, so we define it here. The xstate_bv is extracted from the processor xstate bit + // vector register, so the value is OS independent. + #ifndef XSTATE_YMM + #define XSTATE_YMM 4 + #endif + + inline _fpx_sw_bytes *FPREG_FpxSwBytes(const ucontext_t *uc) + { + // Bytes 464..511 in the FXSAVE format are available for software to use for any purpose. In this case, they are used to + // indicate information about extended state. +- _ASSERTE(reinterpret_cast(&FPREG_Fpstate(uc)->padding[12]) - reinterpret_cast(FPREG_Fpstate(uc)) == 464); ++ _ASSERTE(reinterpret_cast(&FPREG_Fpstate(uc)->FPSTATE_RESERVED[12]) - reinterpret_cast(FPREG_Fpstate(uc)) == 464); + + _ASSERTE(FPREG_Fpstate(uc) != nullptr); + +- return reinterpret_cast<_fpx_sw_bytes *>(&FPREG_Fpstate(uc)->padding[12]); ++ return reinterpret_cast<_fpx_sw_bytes *>(&FPREG_Fpstate(uc)->FPSTATE_RESERVED[12]); + } + + inline UINT32 FPREG_ExtendedSize(const ucontext_t *uc) + diff --git a/missing-exec.patch b/missing-exec.patch new file mode 100644 index 0000000..d985efd --- /dev/null +++ b/missing-exec.patch @@ -0,0 +1,12 @@ +--- dotnet/targets/websdk.targets 2017-06-23 06:56:18.000000000 -0400 ++++ dotnet/targets/websdk.targets 2017-07-20 18:02:10.292618284 -0400 +@@ -7,5 +7,9 @@ + WorkingDirectory="$(ProjectDirectory)" + EnvironmentVariables="@(EnvironmentVariables)" + Condition="'$(OS)' == 'Unix'" /> ++ + + diff --git a/patch-nuget-packages.sh b/patch-nuget-packages.sh new file mode 100755 index 0000000..3c8f7ab --- /dev/null +++ b/patch-nuget-packages.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e + +replace_rid=fedora.26 +replace_rid_by=fedora."$1" + +function contains_rid() +{ + local nuget_package=$1 + local rid=$2 + if unzip -p "$nuget_package" '*.json' 2>/dev/null | grep -q "$rid"; then + echo "1" + else + echo "0" + fi +} + +for file in $(find . -name '*.nupkg'); do + if [ "$(contains_rid $file $replace_rid)" -eq "1" ] && [ "$(contains_rid $file $replace_rid_by)" -eq "0" ]; then + echo "Patching $file" + + file_realpath=`realpath $file` + tempdir=`mktemp -d` + + # unzip file and remove it + unzip -q $file -d $tempdir + + chmod -R u+rw $tempdir + # patch + find $tempdir -name '*.json' -exec sed -i "s/$replace_rid/$replace_rid_by/g" {} + + + # remove, zip, replace + rm $file + pushd $tempdir >/dev/null + zip -q $file_realpath * + popd >/dev/null + + rm -rf $tempdir + fi +done + diff --git a/templates-publish-without-manifest.patch b/templates-publish-without-manifest.patch new file mode 100644 index 0000000..33e1550 --- /dev/null +++ b/templates-publish-without-manifest.patch @@ -0,0 +1,59 @@ +Templates should publish without the ASP.NET Core manifest by default + +Patch the default ASP.NET Core templates (used by dotnet new) to publish +without expecting the runtime package store on the target. The package store is +not part of these public built-from-source builds. + +If published applications use the manifest - and expect the runtime store to be +available - they will publish correctly but fail to run at runtime. + +--- a/content/EmptyWeb-CSharp/Company.WebApplication1.csproj 2017-06-09 15:35:23.000000000 -0400 ++++ b/content/EmptyWeb-CSharp/Company.WebApplication1.csproj 2017-07-19 15:59:25.900632277 -0400 +@@ -3,6 +3,7 @@ + + netcoreapp2.0 + TargetFrameworkOverride ++ false + + + +--- a/content/RazorPagesWeb-CSharp/Company.WebApplication1.csproj 2017-06-09 15:35:23.000000000 -0400 ++++ b/content/RazorPagesWeb-CSharp/Company.WebApplication1.csproj 2017-07-19 16:07:23.248684922 -0400 +@@ -5,6 +5,7 @@ + aspnet-Company.WebApplication1-0ce56475-d1db-490f-8af1-a881ea4fcd2d + 0 + 1 ++ false + + + +--- a/content/StarterWeb-CSharp/Company.WebApplication1.csproj 2017-06-09 15:35:23.000000000 -0400 ++++ b/content/StarterWeb-CSharp/Company.WebApplication1.csproj 2017-07-19 16:00:58.613168965 -0400 +@@ -8,6 +8,7 @@ + aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502 + 0 + 1 ++ false + + + +--- a/content/StarterWeb-FSharp/Company.WebApplication1.fsproj 2017-06-09 15:35:23.000000000 -0400 ++++ b/content/StarterWeb-FSharp/Company.WebApplication1.fsproj 2017-07-19 16:01:12.964097252 -0400 +@@ -4,6 +4,7 @@ + netcoreapp2.0 + TargetFrameworkOverride + true ++ false + + + +--- a/content/WebApi-CSharp/Company.WebApplication1.csproj 2017-06-09 15:35:23.000000000 -0400 ++++ b/content/WebApi-CSharp/Company.WebApplication1.csproj 2017-07-19 16:04:59.211162884 -0400 +@@ -6,6 +6,7 @@ + aspnet-Company.WebApplication1-53bc9b9d-9d6a-45d4-8429-2a2761773502 + 0 + 1 ++ false + + + From d047a8a88306547a5c3d274896439966dff9a3d3 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Jul 23 2018 17:21:06 +0000 Subject: [PATCH 2/2] Update README Update README to reflect new repository locations and simplify existing commands. Also fix typos. --- diff --git a/README.md b/README.md index 1f87097..81020a5 100644 --- a/README.md +++ b/README.md @@ -32,17 +32,14 @@ Please report any issues here, via *New Issue*. - To build in dotnet-sig copr, ask an admin of dotnet-sig for permissions. -2. Fork [the dotnet-sig repo](https://pagure.io/fedora-dotnet) via +2. Fork [the dotnet-2-0 repo](https://pagure.io/dotnet-sig/dotnet-2-0) via copr. You should now have a repo with the web url - https://pagure.io/fork/$USER/fedora-dotnet + https://pagure.io/fork/$USER/dotnet-sig/dotnet-2-0 3. Checkout the forked repository - - `git clone ssh://git@pagure.io/forks/$USER/fedora-dotnet.git` - - `cd fedora-dotnet` - - `git checkout f26` - - Use the most appropriate branch name, but f26 is where the action is right now + - `git clone ssh://git@pagure.io/forks/$USER/dotnet-sig/dotnet-2-0.git + - `cd dotnet-2-0` 4. Bump version/release in the spec file. Add a Changelog. Make sure the `Source` tag corresponds to the new tarball name, if there is a @@ -50,7 +47,7 @@ Please report any issues here, via *New Issue*. 5. Do local builds - - `fedpkg --dist $YOUR_FEDORA_VERSION --module-name dotnet local` + - `fedpkg --dist $YOUR_FEDORA_VERSION local` Where the version can be, for example, f27. Fix any errors that come up and rebuild until it works locally. @@ -66,10 +63,10 @@ Please report any issues here, via *New Issue*. 7. Commit the changes to the git repo and do a build on copr. - `git add # any new files, such as new patches` - - `git remote # old files, such as old patches` + - `git remove # old files, such as old patches` - `git commit -a` - `git push` - - `fedpkg --release f26 --module-name dotnet srpm` + - `fedpkg dotnet srpm` - `copr-cli build @dotnet-sig/dotnet ` 8. If it fails, update spec file/patches and rebuild with the same set @@ -94,4 +91,4 @@ Please report any issues here, via *New Issue*. - `dotnet new console -o ConsoleApplication` - `dotnet run` - - `dotnet public -c Release -r linux-x64` + - `dotnet publish -c Release -r linux-x64`