From 17977ef9c84ff8d5de6dc171591fd264426b4c23 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Mon, 3 Sep 2012 00:49:02 +0100 Subject: Eliminating pfmdefs from makefiles by moving them to mpstd.h so that the mps can be built with a simpler compiler command. Copied from Perforce Change: 179180 ServerID: perforce.ravenbrook.com --- mps/code/mpstd.h | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'mps/code/mpstd.h') diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index 10d3d2833a6..2f3f3f4d94b 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h @@ -127,6 +127,7 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 4 /* I'm just guessing. */ + /* Apple clang version 3.1, clang -E -dM */ #elif defined(__APPLE__) && defined(__i386__) && defined(__MACH__) \ @@ -145,6 +146,7 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 4 /* I'm just guessing. */ + /* Apple clang version 3.1, clang -E -dM */ #elif defined(__APPLE__) && defined(__x86_64__) && defined(__MACH__) \ @@ -163,6 +165,7 @@ #define MPS_WORD_SHIFT 6 #define MPS_PF_ALIGN 8 + /* GCC 2.6.3, gcc -E -dM * The actual granularity of GNU malloc is 8, but field alignments are * all 4. @@ -183,6 +186,11 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 4 +#define _REENTRANT /* FIXME: What for? */ +#define _XOPEN_SOURCE 500 /* to get POSIX signal handling */ +#define _GNU_SOURCE /* to get register numbers for prmci3li.c */ + + /* GCC 4.6.3, gcc -E -dM */ #elif defined(__linux__) && defined(__x86_64) && defined(__GNUC__) @@ -200,22 +208,10 @@ #define MPS_WORD_SHIFT 6 #define MPS_PF_ALIGN 8 -/* GCC 2.7.2, gcc -E -dM */ +#define _REENTRANT /* FIXME: What for? */ +#define _XOPEN_SOURCE 500 /* to get POSIX signal handling */ +#define _GNU_SOURCE /* to get register numbers for prmci3li.c */ -#elif defined(__linux__) && defined(__PPC__) && defined(__GNUC__) -#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_LIPPGC) -#error "specified CONFIG_PF_... inconsistent with detected lippgc" -#endif -#define MPS_PF_LIPPGC -#define MPS_PF_STRING "lippgc" -#define MPS_OS_LI -#define MPS_ARCH_PP -#define MPS_BUILD_GC -#define MPS_T_WORD unsigned long -#define MPS_T_ULONGEST unsigned long -#define MPS_WORD_WIDTH 32 -#define MPS_WORD_SHIFT 5 -#define MPS_PF_ALIGN 8 /* @@@@ not tested */ /* GCC 2.95.3, gcc -E -dM */ @@ -234,6 +230,11 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 4 +/* FIXME: What is this for? Clues at + Discover whether it's still necessary and if so, document why. */ +#define _REENTRANT + + #elif defined(__FreeBSD__) && defined (__x86_64__) && defined (__GNUC__) #if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI6GC) #error "specified CONFIG_PF_... inconsistent with detected fri6gc" @@ -249,6 +250,11 @@ #define MPS_WORD_SHIFT 6 #define MPS_PF_ALIGN 8 +/* FIXME: What is this for? Clues at + Discover whether it's still necessary and if so, document why. */ +#define _REENTRANT + + #else #error "Unable to detect target platform" #endif -- cgit v1.2.1 From b88b9d2d64e3d4c2c4e77e8b7836504122fcff7c Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Mon, 3 Sep 2012 01:09:09 +0100 Subject: Fixing up platform definitions after test build on ubuntu 12. Copied from Perforce Change: 179181 ServerID: perforce.ravenbrook.com --- mps/code/mpstd.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mps/code/mpstd.h') diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index 2f3f3f4d94b..a7b1783edc8 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h @@ -186,7 +186,9 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 4 -#define _REENTRANT /* FIXME: What for? */ +#ifndef _REENTRANT /* it's also defined by cc -pthread */ +#define _REENTRANT /* defines, e.g., pthread_mutexattr_settype */ +#endif #define _XOPEN_SOURCE 500 /* to get POSIX signal handling */ #define _GNU_SOURCE /* to get register numbers for prmci3li.c */ @@ -208,7 +210,9 @@ #define MPS_WORD_SHIFT 6 #define MPS_PF_ALIGN 8 -#define _REENTRANT /* FIXME: What for? */ +#ifndef _REENTRANT /* it's also defined by cc -pthread */ +#define _REENTRANT /* defines, e.g., pthread_mutexattr_settype */ +#endif #define _XOPEN_SOURCE 500 /* to get POSIX signal handling */ #define _GNU_SOURCE /* to get register numbers for prmci3li.c */ -- cgit v1.2.1 From d3d7860572e1d7d17850634bc4c46da23afc98a2 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Mon, 3 Sep 2012 14:48:51 +0100 Subject: Removing unnecessary definition of _reentrant on freebsd. cc -dm -e reveals that this is not set by -pthread, and inspection of headers reveals no effect. checked on freebsd 7 and 9. Copied from Perforce Change: 179201 ServerID: perforce.ravenbrook.com --- mps/code/mpstd.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'mps/code/mpstd.h') diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index a7b1783edc8..1725639691f 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h @@ -234,10 +234,6 @@ #define MPS_WORD_SHIFT 5 #define MPS_PF_ALIGN 4 -/* FIXME: What is this for? Clues at - Discover whether it's still necessary and if so, document why. */ -#define _REENTRANT - #elif defined(__FreeBSD__) && defined (__x86_64__) && defined (__GNUC__) #if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI6GC) @@ -254,10 +250,6 @@ #define MPS_WORD_SHIFT 6 #define MPS_PF_ALIGN 8 -/* FIXME: What is this for? Clues at - Discover whether it's still necessary and if so, document why. */ -#define _REENTRANT - #else #error "Unable to detect target platform" -- cgit v1.2.1