pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coreclr-git: Improve patch for alloca(3)



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Feb 16 22:36:11 2016 +0100
Changeset:	46db15c0aff7abf51f3c909c057d44b6ed4ca9b8

Modified Files:
	coreclr-git/distinfo
Added Files:
	coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.h
	coreclr-git/patches/patch-src_pal_inc_pal.h
	coreclr-git/patches/patch-src_pal_src_CMakeLists.txt
	coreclr-git/patches/patch-src_pal_src_include_pal_palinternal.h

Log Message:
coreclr-git: Improve patch for alloca(3)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=46db15c0aff7abf51f3c909c057d44b6ed4ca9b8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coreclr-git/distinfo                               |  4 +++
 .../patches/patch-src_ToolBox_SOS_Strike_strike.h  | 31 ++++++++++++++++++++++
 coreclr-git/patches/patch-src_pal_inc_pal.h        | 16 +++++++++++
 .../patches/patch-src_pal_src_CMakeLists.txt       | 12 +++++++++
 .../patch-src_pal_src_include_pal_palinternal.h    | 24 +++++++++++++++++
 5 files changed, 87 insertions(+)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index afc7651..ee68afd 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -1,2 +1,6 @@
 $NetBSD$
 
+SHA1 (patch-src_ToolBox_SOS_Strike_strike.h) = f5128c974d4f2be838d476de87167045afb6ed31
+SHA1 (patch-src_pal_inc_pal.h) = f7f1f2a2e18c37a961289a360e960eb71bf75a0a
+SHA1 (patch-src_pal_src_CMakeLists.txt) = 910d8464b5caf4db79b80b46cc8d23105f81c162
+SHA1 (patch-src_pal_src_include_pal_palinternal.h) = d55df797d34de6577566da4886bb70d09ab45308
diff --git a/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.h b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.h
new file mode 100644
index 0000000..87d1cb4
--- /dev/null
+++ b/coreclr-git/patches/patch-src_ToolBox_SOS_Strike_strike.h
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- src/ToolBox/SOS/Strike/strike.h.orig	2016-01-28 19:04:13.000000000 +0000
++++ src/ToolBox/SOS/Strike/strike.h
+@@ -76,6 +76,21 @@
+ #ifndef PAL_STDCPP_COMPAT
+ #include <malloc.h>
+ #endif
++
++#if defined(_MSC_VER)
++#define alloca _alloca
++#elif defined(PLATFORM_UNIX)
++#define _alloca alloca
++#else
++// MingW
++#define _alloca __builtin_alloca
++#define alloca __builtin_alloca
++#endif //_MSC_VER
++
++#if defined(__GNUC__) && defined(PLATFORM_UNIX)
++#define alloca  __builtin_alloca                                                                                                                             
++#endif // __GNUC__
++
+ #include <stddef.h>
+ 
+ #ifndef FEATURE_PAL
+@@ -128,4 +143,3 @@ HRESULT SetNGENCompilerFlags(DWORD flags
+ 
+ 
+ #endif // __strike_h__
+-
diff --git a/coreclr-git/patches/patch-src_pal_inc_pal.h b/coreclr-git/patches/patch-src_pal_inc_pal.h
new file mode 100644
index 0000000..7993057
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_inc_pal.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- src/pal/inc/pal.h.orig	2016-02-15 22:52:17.000000000 +0000
++++ src/pal/inc/pal.h
+@@ -6340,11 +6340,6 @@ PALIMPORT char * __cdecl _strdup(const c
+ #endif //_MSC_VER
+ 
+ #if defined(__GNUC__) && defined(PLATFORM_UNIX)
+-// we set -fno-builtin on the command line. This requires that if
+-// we use alloca, with either have to call __builtin_alloca, or
+-// ensure that the alloca call doesn't happen in code which is
+-// modifying the stack (such as "memset (alloca(x), y, z)"
+-
+ #define alloca  __builtin_alloca
+ #endif // __GNUC__
+ 
diff --git a/coreclr-git/patches/patch-src_pal_src_CMakeLists.txt b/coreclr-git/patches/patch-src_pal_src_CMakeLists.txt
new file mode 100644
index 0000000..97fa0e2
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_CMakeLists.txt
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/pal/src/CMakeLists.txt.orig	2016-02-06 02:05:27.000000000 +0000
++++ src/pal/src/CMakeLists.txt
+@@ -68,7 +68,6 @@ endif()
+ # turn off capability to remove unused functions (which was enabled in debug build with sanitizers)
+ set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no-gc-sections")
+ 
+-add_compile_options(-fno-builtin)
+ add_compile_options(-fPIC)
+ 
+ if(PAL_CMAKE_PLATFORM_ARCH_AMD64)
diff --git a/coreclr-git/patches/patch-src_pal_src_include_pal_palinternal.h b/coreclr-git/patches/patch-src_pal_src_include_pal_palinternal.h
new file mode 100644
index 0000000..22be417
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_include_pal_palinternal.h
@@ -0,0 +1,24 @@
+$NetBSD$
+
+--- src/pal/src/include/pal/palinternal.h.orig	2016-02-15 22:52:17.000000000 +0000
++++ src/pal/src/include/pal/palinternal.h
+@@ -337,15 +337,15 @@ function_name() to call the system's imp
+ #undef _BitScanForward64
+ #endif 
+ 
+-/* pal.h does "#define alloca _alloca", but we need access to the "real"
+-   alloca */
+-#undef alloca
++/* pal.h defines alloca(3) as a compiler builtin.
++   Redefining it to native libc will result in undefined breakage because
++   a compiler is allowed to make assumptions about the stack and frame
++   pointers. */
+ 
+ /* Undef all functions and types previously defined so those functions and
+    types could be mapped to the C runtime and socket implementation of the 
+    native OS */
+ #undef exit
+-#undef alloca
+ #undef atexit
+ #undef div
+ #undef div_t


Home | Main Index | Thread Index | Old Index