pkgsrc-WIP-changes archive

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

coreclr-git: adjust ifdefry for va_list platform specific insanities



Module Name:	pkgsrc-wip
Committed By:	Tobias Nygren <tnn%NetBSD.org@localhost>
Pushed By:	tnn
Date:		Wed Feb 24 19:38:09 2016 +0100
Changeset:	412b233ab76dae37dcf36f3a89fda0f18c7bb160

Modified Files:
	coreclr-git/distinfo
Added Files:
	coreclr-git/patches/patch-src_pal_src_safecrt_output.inl
	coreclr-git/patches/patch-src_pal_src_safecrt_safecrt__output__l.c

Log Message:
coreclr-git: adjust ifdefry for va_list platform specific insanities

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

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

diffstat:
 coreclr-git/distinfo                               |  2 +
 .../patches/patch-src_pal_src_safecrt_output.inl   | 34 +++++++++++++++++
 .../patch-src_pal_src_safecrt_safecrt__output__l.c | 43 ++++++++++++++++++++++
 3 files changed, 79 insertions(+)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index 620d25a..28267a3 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -5,3 +5,5 @@ SHA1 (patch-src_pal_inc_pal.h) = 7d3ef148af8b1b24067ba4cb5efc12581ebc6881
 SHA1 (patch-src_pal_src_cruntime_printf.cpp) = 8a86c57e1fe3953d158e1860f04bd19d7df1fe08
 SHA1 (patch-src_pal_src_cruntime_printfcpp.cpp) = 4d1ba5fea45402259c67428506f39d9c3128ecbd
 SHA1 (patch-src_pal_src_cruntime_silent__printf.cpp) = 0922321ad05a90cc3b87b1e2663ff4d0b2e4717e
+SHA1 (patch-src_pal_src_safecrt_output.inl) = ceb1951e8a7e0839fa1c0f5d07fd6c4087afd5df
+SHA1 (patch-src_pal_src_safecrt_safecrt__output__l.c) = 5a17a2525ab434336cfef369980562d1ecdcd953
diff --git a/coreclr-git/patches/patch-src_pal_src_safecrt_output.inl b/coreclr-git/patches/patch-src_pal_src_safecrt_output.inl
new file mode 100644
index 0000000..84b0164
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_safecrt_output.inl
@@ -0,0 +1,34 @@
+$NetBSD$
+
+Try to fix va_list insanity. It is unsafe to pass pointers to va_list across
+function calls, on some platforms. clang does not like it.
+
+--- src/pal/src/safecrt/output.inl.orig	2016-02-24 01:48:40.000000000 +0000
++++ src/pal/src/safecrt/output.inl
+@@ -205,7 +205,7 @@ int __cdecl _swoutput_s(wchar_t *_Dst, s
+     CASSERT(sizeof(void *) != sizeof(int64_t));
+ #endif  /* defined (_WIN64) */
+ 
+-#ifndef __GNUC_VA_LIST
++#if !defined(__GNUC_VA_LIST) && !defined(__clang__)
+ #if LONGLONG_IS_INT64
+     #define get_long_long_arg(x) (long long)get_int64_arg(x)
+ #endif  /* LONGLONG_IS_INT64 */
+@@ -546,7 +546,7 @@ LOCAL(void) write_string(const _TCHAR *s
+ 
+ #endif  /* CPRFLAG */
+ 
+-#ifdef __GNUC_VA_LIST
++#if defined(__GNUC_VA_LIST) || defined(__clang__)
+ 
+     #define get_int_arg(list)           va_arg(*list, int)
+     #define get_long_arg(list)          va_arg(*list, long)
+@@ -1665,7 +1665,7 @@ LOCAL(void) write_string (
+ #endif  /* CPRFLAG */
+ 
+ // For GCC 64 bit, we can't cast to va_list *, so we need to make these functions defines.
+-#ifndef __GNUC_VA_LIST
++#if !defined(__GNUC_VA_LIST) && !defined(__clang__)
+ 
+ /***
+ *int get_int_arg(va_list *pargptr)
diff --git a/coreclr-git/patches/patch-src_pal_src_safecrt_safecrt__output__l.c b/coreclr-git/patches/patch-src_pal_src_safecrt_safecrt__output__l.c
new file mode 100644
index 0000000..b6e650b
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_safecrt_safecrt__output__l.c
@@ -0,0 +1,43 @@
+$NetBSD$
+
+Try to fix va_list insanity. It is unsafe to pass pointers to va_list across
+function calls, on some platforms. clang does not like it.
+
+--- src/pal/src/safecrt/safecrt_output_l.c.orig	2016-02-24 01:48:40.000000000 +0000
++++ src/pal/src/safecrt/safecrt_output_l.c
+@@ -111,7 +111,7 @@ Buffer size required to be passed to _gc
+     CASSERT(sizeof(long) == sizeof(int));
+ #endif
+ 
+-#ifdef __GNUC_VA_LIST
++#if defined(__GNUC_VA_LIST)
+     // GCC: short is not int, but GCC promotes va_arg to int
+     #define SHORT_IS_INT     1
+ #else
+@@ -143,7 +143,7 @@ Buffer size required to be passed to _gc
+     CASSERT(sizeof(void *) != sizeof(int64_t));
+ #endif  /* defined (_WIN64) */
+ 
+-#ifndef __GNUC_VA_LIST
++#if !defined(__GNUC_VA_LIST) && !defined(__clang__)
+ 
+ #if LONGLONG_IS_INT64
+     #define get_long_long_arg(x) (long long)get_int64_arg(x)
+@@ -401,7 +401,7 @@ LOCAL(void) write_string(const _TCHAR *s
+ 
+ #endif  /* CPRFLAG */
+ 
+-#ifdef __GNUC_VA_LIST
++#if defined(__GNUC_VA_LIST) || defined(__clang__)
+ 
+     #define get_short_arg(list)         va_arg(*list, int)  // GCC promotes va_arg shorts into int values
+     #define get_int_arg(list)           va_arg(*list, int)
+@@ -1527,7 +1527,7 @@ LOCAL(void) write_string (
+ 
+ 
+ // For GCC 64 bit, we can't cast to va_list *, so we need to make these functions defines.
+-#ifndef __GNUC_VA_LIST
++#if !defined(__GNUC_VA_LIST) && !defined(__clang__)
+ 
+ /***
+ *int get_int_arg(va_list *pargptr)


Home | Main Index | Thread Index | Old Index