mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
On platform lii6gc, the mps needs a bunch of symbols which are not defined if the -ansi option is given to gcc. these can be enabled by defining features like _gnu_source, but all headers share a common set of features (via <feature.h>) and so all sources in the same compilation unit must turn on the same set of features. make sure this happens by turning on the features in config.h (not mpstd.h).
Remove <string.h> from mpsi.h (not needed). Copied from Perforce Change: 182124 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
ef4d65299d
commit
3c48eff730
9 changed files with 60 additions and 42 deletions
|
|
@ -330,6 +330,37 @@
|
|||
#define VMParamSize (sizeof(Word))
|
||||
|
||||
|
||||
/* .feature.li: Linux feature specification
|
||||
*
|
||||
* The MPS needs the following symbols which are not defined if the
|
||||
* -ansi option is given to GCC:
|
||||
*
|
||||
* Source Symbols Header Feature
|
||||
* =========== ========================= ============= ====================
|
||||
* lockli.c pthread_mutexattr_settype <pthread.h> _XOPEN_SOURCE >= 500
|
||||
* prmci3li.c REG_EAX etc. <ucontext.h> _GNU_SOURCE
|
||||
* prmci6li.c REG_RAX etc. <ucontext.h> _GNU_SOURCE
|
||||
* prmcix.h stack_t, siginfo_t <signal.h> _XOPEN_SOURCE
|
||||
* pthrdext.c sigaction etc. <signal.h> _XOPEN_SOURCE
|
||||
* vmix.c MAP_ANON <sys/mman.h> _GNU_SOURCE
|
||||
*
|
||||
* Unfortunately it's not possible to localize these feature
|
||||
* specifications around the individual headers: all headers share a
|
||||
* common set of features (via <feature.h>) and so all sources in the
|
||||
* same compilation unit must turn on the same set of features.
|
||||
*
|
||||
* See "Feature Test Macros" in the GCC Manual:
|
||||
* <http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html>
|
||||
*/
|
||||
|
||||
#if defined(MPS_OS_LI)
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Protection Configuration see <code/prot*.c>
|
||||
|
||||
For each architecture/OS that uses protix.c or protsgix.c, we need to
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* lockli.c: RECURSIVE LOCKS FOR POSIX SYSTEMS
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
|
||||
*
|
||||
* .linux: This implementation currently just supports LinuxThreads
|
||||
* (platform MPS_OS_LI), Single Unix i/f.
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
#include "lock.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#include <pthread.h> /* see .feature.li in config.h */
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ void LockReleaseGlobal(void)
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
#include "mpsavm.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
SRCID(mpsi, "$Id$");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* mpstd.h: RAVENBROOK MEMORY POOL SYSTEM TARGET DETECTION
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
|
||||
* Portions copyright (C) 2001 Global Graphics Software.
|
||||
*
|
||||
* Detect the target platform using predefined preprocessor symbols
|
||||
|
|
@ -156,12 +156,6 @@
|
|||
#define MPS_WORD_SHIFT 5
|
||||
#define MPS_PF_ALIGN 4
|
||||
|
||||
#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 */
|
||||
|
||||
|
||||
/* GCC 4.6.3, gcc -E -dM */
|
||||
|
||||
|
|
@ -180,12 +174,6 @@
|
|||
#define MPS_WORD_SHIFT 6
|
||||
#define MPS_PF_ALIGN 8
|
||||
|
||||
#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 */
|
||||
|
||||
|
||||
/* GCC 2.95.3, gcc -E -dM */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* prmci3li.c: PROTECTION MUTATOR CONTEXT INTEL 386 (LINUX)
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
|
||||
*
|
||||
* .purpose: This module implements the part of the protection module
|
||||
* that decodes the MutatorFaultContext.
|
||||
|
|
@ -41,8 +41,9 @@ MRef Prmci3AddressHoldingReg(MutatorFaultContext mfc, unsigned int regnum)
|
|||
|
||||
/* .source.i486 */
|
||||
/* .assume.regref */
|
||||
/* The REG_EAX etc. symbols are only present if _GNU_SOURCE is defined.
|
||||
Currently this is in lii3gc.gmk in PFMDEFS. */
|
||||
/* The register numbers (REG_EAX etc.) are defined in <ucontext.h>
|
||||
but only if _GNU_SOURCE is defined: see .feature.li in
|
||||
config.h. */
|
||||
/* TODO: The current arrangement of the fix operation (taking a Ref *)
|
||||
forces us to pun these registers (actually `int` on LII3GC). We can
|
||||
suppress the warning my casting through `char *` and this might make
|
||||
|
|
@ -106,7 +107,7 @@ Res MutatorFaultContextScan(ScanState ss, MutatorFaultContext mfc)
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* prmci6li.c: PROTECTION MUTATOR CONTEXT x64 (LINUX)
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
|
||||
*
|
||||
* .purpose: This module implements the part of the protection module
|
||||
* that decodes the MutatorFaultContext.
|
||||
|
|
@ -41,8 +41,9 @@ MRef Prmci6AddressHoldingReg(MutatorFaultContext mfc, unsigned int regnum)
|
|||
gregs = (Word *)&mfc->ucontext->uc_mcontext.gregs;
|
||||
|
||||
/* .assume.regref */
|
||||
/* The REG_EAX etc. symbols are only present if _GNU_SOURCE is defined.
|
||||
* Currently this is in lii6gc.gmk in PFMDEFS. */
|
||||
/* The register numbers (REG_RAX etc.) are defined in <ucontext.h>
|
||||
but only if _GNU_SOURCE is defined: see .feature.li in
|
||||
config.h. */
|
||||
switch (regnum) {
|
||||
case 0: return &gregs[REG_RAX];
|
||||
case 1: return &gregs[REG_RCX];
|
||||
|
|
@ -110,7 +111,7 @@ Res MutatorFaultContextScan(ScanState ss, MutatorFaultContext mfc)
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* prmcix.h: PROTECTION MUTATOR CONTEXT (UNIX)
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
|
||||
*
|
||||
* .readership: MPS developers.
|
||||
*/
|
||||
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
#include "mpm.h"
|
||||
|
||||
#include <ucontext.h>
|
||||
#include <signal.h> /* siginfo_t -- see .feature.li in config.h */
|
||||
#include <ucontext.h> /* ucontext_t */
|
||||
|
||||
typedef struct MutatorFaultContextStruct { /* Protection fault context data */
|
||||
siginfo_t *info;
|
||||
|
|
@ -24,7 +25,7 @@ typedef struct MutatorFaultContextStruct { /* Protection fault context data */
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* pthreadext.c: POSIX THREAD EXTENSIONS
|
||||
*
|
||||
* $Id$
|
||||
* Copyright (c) 2001 Ravenbrook Limited. See end of file for license.
|
||||
* Copyright (c) 2001-2013 Ravenbrook Limited. See end of file for license.
|
||||
*
|
||||
* .purpose: Provides extension to Pthreads.
|
||||
*
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <signal.h>
|
||||
#include <signal.h> /* see .feature.li in config.h */
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
|
@ -365,7 +365,7 @@ unlock:
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@
|
|||
* (MAP_PRIVATE) mapping with the flag MAP_ANON.
|
||||
*
|
||||
* .non-standard: Note that the MAP_ANON flag is non-standard; it is
|
||||
* available on Darwin and FreeBSD. .non-standard.linux: Linux
|
||||
* seems to use MAP_ANONYMOUS instead. Some Linux systems make MAP_ANON
|
||||
* available and deprecate it. .non-standard.sesame: On Linux getting
|
||||
* a definition of MAP_ANON requires a macro to be defined prior to
|
||||
* <sys/mman.h>.
|
||||
* available on Darwin and FreeBSD. .non-standard.linux: Linux seems
|
||||
* to use MAP_ANONYMOUS instead. Some Linux systems make MAP_ANON
|
||||
* available and deprecate it. .non-standard.sesame: On Linux getting
|
||||
* a definition of MAP_ANON requires a _BSD_SOURCE to be defined prior
|
||||
* to <sys/mman.h>; see config.h.
|
||||
*
|
||||
* .assume.not-last: The implementation of VMCreate assumes that
|
||||
* mmap() will not choose a region which contains the last page
|
||||
|
|
@ -38,12 +38,11 @@
|
|||
* seem to be a problem.
|
||||
*/
|
||||
|
||||
/* .non-standard.sesame */
|
||||
#define _BSD_SOURCE 1
|
||||
#include "mpm.h"
|
||||
|
||||
/* for mmap(2), munmap(2) */
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mman.h> /* see .feature.li in config.h */
|
||||
|
||||
/* for errno(2) */
|
||||
#include <errno.h>
|
||||
|
|
@ -51,8 +50,6 @@
|
|||
/* for getpagesize(3) */
|
||||
#include <unistd.h>
|
||||
|
||||
#include "mpm.h"
|
||||
|
||||
|
||||
#if !defined(MPS_OS_FR) && !defined(MPS_OS_XC) && !defined(MPS_OS_LI)
|
||||
#error "vmix.c is Unix-like specific, currently MPS_OS_FR XC LI"
|
||||
|
|
@ -322,7 +319,7 @@ void VMUnmap(VM vm, Addr base, Addr limit)
|
|||
|
||||
/* C. COPYRIGHT AND LICENSE
|
||||
*
|
||||
* Copyright (C) 2001-2007 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* Copyright (C) 2001-2013 Ravenbrook Limited <http://www.ravenbrook.com/>.
|
||||
* All rights reserved. This is an open source license. Contact
|
||||
* Ravenbrook for commercial licensing options.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue