From 752fdb5dd8418c0ae56e308067c043b8fe39e695 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 29 Mar 2018 11:56:56 +0200 Subject: [PATCH 1/3] Add workaround for old gcc and clang versions Old gcc and clang do not handle constructor arguments, finally fix #875 as discussed there, using the fedora patch --- driver/others/memory.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/driver/others/memory.c b/driver/others/memory.c index 474d97c4d..1cb7519b4 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -148,8 +148,15 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define CONSTRUCTOR __attribute__ ((constructor)) #define DESTRUCTOR __attribute__ ((destructor)) #else +#if __GNUC__ && INIT_PRIORITY && ((GCC_VERSION >= 40300) || (CLANG_VERSION >= 20900)) #define CONSTRUCTOR __attribute__ ((constructor(101))) #define DESTRUCTOR __attribute__ ((destructor(101))) +#elif __GNUC__ && INIT_PRIORITY +#define CONSTRUCTOR __attribute__ ((constructor)) +#define DESTRUCTOR __attribute__ ((destructor)) +#else +#define CONSTRUCTOR +#define DESTRUCTOR #endif #ifdef DYNAMIC_ARCH From 93db123f7e36fafff65d151cf10f95c54dee3608 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 29 Mar 2018 13:13:49 +0200 Subject: [PATCH 2/3] Update memory.c --- driver/others/memory.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index 1cb7519b4..41937ca32 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -147,8 +147,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #elif (defined(OS_DARWIN) || defined(OS_SUNOS)) && defined(C_GCC) #define CONSTRUCTOR __attribute__ ((constructor)) #define DESTRUCTOR __attribute__ ((destructor)) -#else -#if __GNUC__ && INIT_PRIORITY && ((GCC_VERSION >= 40300) || (CLANG_VERSION >= 20900)) +#elif __GNUC__ && INIT_PRIORITY && ((GCC_VERSION >= 40300) || (CLANG_VERSION >= 20900)) #define CONSTRUCTOR __attribute__ ((constructor(101))) #define DESTRUCTOR __attribute__ ((destructor(101))) #elif __GNUC__ && INIT_PRIORITY From 01c4b82f045851615074fd1bdc7de06a8b253cf6 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sat, 31 Mar 2018 22:32:06 +0200 Subject: [PATCH 3/3] Update memory.c --- driver/others/memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index 41937ca32..a6d4e636c 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -150,12 +150,9 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #elif __GNUC__ && INIT_PRIORITY && ((GCC_VERSION >= 40300) || (CLANG_VERSION >= 20900)) #define CONSTRUCTOR __attribute__ ((constructor(101))) #define DESTRUCTOR __attribute__ ((destructor(101))) -#elif __GNUC__ && INIT_PRIORITY +#else #define CONSTRUCTOR __attribute__ ((constructor)) #define DESTRUCTOR __attribute__ ((destructor)) -#else -#define CONSTRUCTOR -#define DESTRUCTOR #endif #ifdef DYNAMIC_ARCH