* sync in patches from cygwin gcc * sync in important patches from mingw gcc not related to the build * enabling stripping (not sure why it was disabled) * reduce diff for build options to the mingw gcc build a bit
93 lines
3.5 KiB
Diff
93 lines
3.5 KiB
Diff
From 7330e79d1eaab54e91d27ff8aae1d610713383cd Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Yong <10walls@gmail.com>
|
|
Date: Tue, 8 Sep 2020 14:50:33 +0200
|
|
Subject: [PATCH 01/13] Cygwin: use SysV ABI on x86_64
|
|
|
|
# Conflicts:
|
|
# libitm/libitm.h
|
|
---
|
|
gcc/builtin-attrs.def | 3 +++
|
|
gcc/gtm-builtins.def | 2 +-
|
|
libitm/libitm.h | 3 ++-
|
|
libitm/libitm_i.h | 4 ++--
|
|
4 files changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/gcc/builtin-attrs.def b/gcc/builtin-attrs.def
|
|
index 11ce5a3d16c..a544fcf9afd 100644
|
|
--- a/gcc/builtin-attrs.def
|
|
+++ b/gcc/builtin-attrs.def
|
|
@@ -119,6 +119,7 @@ DEF_ATTR_IDENT (ATTR_TYPEGENERIC, "type generic")
|
|
DEF_ATTR_IDENT (ATTR_TM_REGPARM, "*tm regparm")
|
|
DEF_ATTR_IDENT (ATTR_TM_TMPURE, "transaction_pure")
|
|
DEF_ATTR_IDENT (ATTR_RETURNS_TWICE, "returns_twice")
|
|
+DEF_ATTR_IDENT (ATTR_SYSV_ABI, "sysv_abi")
|
|
DEF_ATTR_IDENT (ATTR_RETURNS_NONNULL, "returns_nonnull")
|
|
DEF_ATTR_IDENT (ATTR_WARN_UNUSED_RESULT, "warn_unused_result")
|
|
|
|
@@ -401,6 +402,8 @@ DEF_ATTR_TREE_LIST (ATTR_TM_CONST_NOTHROW_LIST,
|
|
ATTR_TM_REGPARM, ATTR_NULL, ATTR_CONST_NOTHROW_LIST)
|
|
DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_RT_LIST,
|
|
ATTR_RETURNS_TWICE, ATTR_NULL, ATTR_TM_NOTHROW_LIST)
|
|
+DEF_ATTR_TREE_LIST (ATTR_TM_NOTHROW_RT_SYSV_LIST,
|
|
+ ATTR_SYSV_ABI, ATTR_NULL, ATTR_TM_NOTHROW_RT_LIST)
|
|
|
|
/* Same attributes used for BUILT_IN_MALLOC except with TM_PURE thrown in. */
|
|
DEF_ATTR_TREE_LIST (ATTR_TMPURE_MALLOC_NOTHROW_LIST,
|
|
diff --git a/gcc/gtm-builtins.def b/gcc/gtm-builtins.def
|
|
index 6d5cfb9b406..1f47898a71a 100644
|
|
--- a/gcc/gtm-builtins.def
|
|
+++ b/gcc/gtm-builtins.def
|
|
@@ -1,5 +1,5 @@
|
|
DEF_TM_BUILTIN (BUILT_IN_TM_START, "_ITM_beginTransaction",
|
|
- BT_FN_UINT32_UINT32_VAR, ATTR_TM_NOTHROW_RT_LIST)
|
|
+ BT_FN_UINT32_UINT32_VAR, ATTR_TM_NOTHROW_RT_SYSV_LIST)
|
|
|
|
DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT, "_ITM_commitTransaction",
|
|
BT_FN_VOID, ATTR_TM_NOTHROW_LIST)
|
|
diff --git a/libitm/libitm.h b/libitm/libitm.h
|
|
index 7ecf53a93e1..5b2bf7582f1 100644
|
|
--- a/libitm/libitm.h
|
|
+++ b/libitm/libitm.h
|
|
@@ -45,6 +45,7 @@ extern "C" {
|
|
|
|
#define ITM_NORETURN __attribute__((noreturn))
|
|
#define ITM_PURE __attribute__((transaction_pure))
|
|
+#define ITM_SYSV __attribute__((sysv_abi))
|
|
#ifdef _GLIBCXX_NOTHROW
|
|
# define _ITM_NOTHROW _GLIBCXX_NOTHROW
|
|
#elif !defined (__cplusplus)
|
|
@@ -154,7 +155,7 @@ typedef uint64_t _ITM_transactionId_t; /* Transaction identifier */
|
|
|
|
extern _ITM_transactionId_t _ITM_getTransactionId(void) ITM_REGPARM;
|
|
|
|
-extern uint32_t _ITM_beginTransaction(uint32_t, ...) ITM_REGPARM;
|
|
+extern uint32_t _ITM_beginTransaction(uint32_t, ...) ITM_REGPARM ITM_SYSV;
|
|
|
|
extern void _ITM_abortTransaction(_ITM_abortReason) ITM_REGPARM ITM_NORETURN;
|
|
|
|
diff --git a/libitm/libitm_i.h b/libitm/libitm_i.h
|
|
index 4e415ef53a0..ff3ae90df76 100644
|
|
--- a/libitm/libitm_i.h
|
|
+++ b/libitm/libitm_i.h
|
|
@@ -294,7 +294,7 @@ struct gtm_thread
|
|
// Invoked from assembly language, thus the "asm" specifier on
|
|
// the name, avoiding complex name mangling.
|
|
static uint32_t begin_transaction(uint32_t, const gtm_jmpbuf *)
|
|
- __asm__(UPFX "GTM_begin_transaction") ITM_REGPARM;
|
|
+ __asm__(UPFX "GTM_begin_transaction") ITM_REGPARM ITM_SYSV;
|
|
// In eh_cpp.cc
|
|
void init_cpp_exceptions ();
|
|
void revert_cpp_exceptions (gtm_transaction_cp *cp = 0);
|
|
@@ -328,7 +328,7 @@ namespace GTM HIDDEN {
|
|
extern uint64_t gtm_spin_count_var;
|
|
|
|
extern "C" uint32_t GTM_longjmp (uint32_t, const gtm_jmpbuf *, uint32_t)
|
|
- ITM_NORETURN ITM_REGPARM;
|
|
+ ITM_NORETURN ITM_REGPARM ITM_SYSV;
|
|
|
|
extern "C" void GTM_LB (const void *, size_t) ITM_REGPARM;
|
|
|
|
--
|
|
2.39.0
|
|
|