libxcrypt/libxcrypt-4.4.2-gcc9_declare_strong_alias_explicitly___THROW.patch

49 lines
1.7 KiB
Diff
Raw Normal View History

From 6ab065482c8fa2893dcf6cdef2be0d87bdf3f224 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
Date: Mon, 21 Jan 2019 16:07:37 +0100
Subject: [PATCH] crypt-port: Declare strong_alias explicitly __THROW.
Closes: #76.
---
crypt-port.h | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/crypt-port.h b/crypt-port.h
index 2beb558..379a76b 100644
--- a/crypt-port.h
+++ b/crypt-port.h
@@ -165,14 +165,26 @@ _crypt_strcpy_or_abort (void *, const size_t, const void *);
#define strong_alias(name, aliasname) _strong_alias(name, aliasname)
/* Darwin doesn't support alias attributes. */
-#ifndef __APPLE__
-# define _strong_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((alias (#name)))
+#ifdef __cplusplus
+# ifndef __APPLE__
+# define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __THROW __attribute__ ((alias (#name)))
+# else
+# define _strong_alias(name, aliasname) \
+ __THROW __asm__(".globl _" #aliasname); \
+ __THROW __asm__(".set _" #aliasname ", _" #name); \
+ extern __typeof(name) aliasname __THROW
+# endif
#else
-# define _strong_alias(name, aliasname) \
- __asm__(".globl _" #aliasname); \
- __asm__(".set _" #aliasname ", _" #name); \
- extern __typeof(name) aliasname
+# ifndef __APPLE__
+# define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name))) __THROW
+# else
+# define _strong_alias(name, aliasname) \
+ __asm__(".globl _" #aliasname) __THROW; \
+ __asm__(".set _" #aliasname ", _" #name) __THROW; \
+ extern __typeof(name) aliasname __THROW
+# endif
#endif
/* Set the symbol version for EXTNAME, which uses INTNAME as its