From 24aa3c6508b9d8c93629c8afd6539ab54609e0a2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 10 Sep 2016 12:24:06 +0100 Subject: [PATCH] -Ob not working on my FreeBSD, use -O1. Better LP64 detection for OpenBSD. --- src/system/SYSTEM.h | 21 +++++++++++++-------- src/tools/make/configure.c | 8 ++++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 881004ba..e32fb677 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,11 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + // Temporary while bootstrapping and clearing up SYSTEM.c. #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -24,7 +30,7 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; typedef long long address; @@ -45,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -205,7 +211,6 @@ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - extern int64 SYSTEM_DIV(int64 x, int64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index b3c46d3e..10886067 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -131,9 +131,9 @@ void determineCCompiler() { #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g -Og"; + cc = "i686-w64-mingw32-gcc -g -O1"; } else { - cc = "x86_64-w64-mingw32-gcc -g -Og"; + cc = "x86_64-w64-mingw32-gcc -g -O1"; } #elif defined(__clang__) compiler = "clang"; @@ -142,9 +142,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -Og"; + cc = "gcc -g -O1"; } else { - cc = "gcc -fPIC -g -Og"; + cc = "gcc -fPIC -g -O1"; } #elif defined(_MSC_VER) compiler = "MSC";