Fix Alpine build (#13052)
authorJan Vorlicek <janvorli@microsoft.com>
Thu, 27 Jul 2017 22:18:31 +0000 (00:18 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Jul 2017 22:18:31 +0000 (00:18 +0200)
This change fixes CoreCLR build on Alpine Linux

build.sh
src/debug/createdump/threadinfo.cpp

index 52ad1ae..91a97e4 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -390,10 +390,11 @@ isMSBuildOnNETCoreSupported()
     if [ "$__HostArch" == "x64" ]; then
         if [ "$__HostOS" == "Linux" ]; then
             __isMSBuildOnNETCoreSupported=1
-            UNSUPPORTED_RIDS=("debian.9-x64" "ubuntu.17.04-x64")
+            # note: the RIDs below can use globbing patterns
+            UNSUPPORTED_RIDS=("debian.9-x64" "ubuntu.17.04-x64" "alpine.3.6.*-x64")
             for UNSUPPORTED_RID in "${UNSUPPORTED_RIDS[@]}"
             do
-                if [ "$__HostDistroRid" == "$UNSUPPORTED_RID" ]; then
+                if [[ $__HostDistroRid == $UNSUPPORTED_RID ]]; then
                     __isMSBuildOnNETCoreSupported=0
                     break
                 fi
index 0bb439e..6a91ed7 100644 (file)
@@ -5,6 +5,10 @@
 #include "createdump.h"
 #include <asm/ptrace.h>
 
+#ifndef __GLIBC__
+typedef int __ptrace_request;
+#endif
+
 #define FPREG_ErrorOffset(fpregs) *(DWORD*)&((fpregs).rip)
 #define FPREG_ErrorSelector(fpregs) *(((WORD*)&((fpregs).rip)) + 2)
 #define FPREG_DataOffset(fpregs) *(DWORD*)&((fpregs).rdp)