From 7d93da3182729553937473995882be09c737014e Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 4 Mar 2016 13:20:51 +0000 Subject: [PATCH 1/4] Adding new platform fri3ll to support freebsd 10 and above, which have clang and not gcc by default. Copied from Perforce Change: 189622 ServerID: perforce.ravenbrook.com --- mps/code/.p4ignore | 1 + mps/code/fri3ll.gmk | 71 +++++++++++++++++++++++++++++++++++++++++++++ mps/code/mps.c | 6 ++-- mps/code/mpstd.h | 17 +++++++++++ 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 mps/code/fri3ll.gmk diff --git a/mps/code/.p4ignore b/mps/code/.p4ignore index 016e58eef6a..f64f4cd5d6b 100644 --- a/mps/code/.p4ignore +++ b/mps/code/.p4ignore @@ -5,6 +5,7 @@ anangc ananll ananmv fri3gc +fri3ll fri6gc fri6ll lii3gc diff --git a/mps/code/fri3ll.gmk b/mps/code/fri3ll.gmk new file mode 100644 index 00000000000..8801830e757 --- /dev/null +++ b/mps/code/fri3ll.gmk @@ -0,0 +1,71 @@ +# -*- makefile -*- +# +# fri3ll.gmk: BUILD FOR FreeBSD/i386/GCC PLATFORM +# +# $Id$ +# Copyright (c) 2001-2014 Ravenbrook Limited. See end of file for license. + +PFM = fri3ll + +MPMPF = \ + lockix.c \ + prmcan.c \ + prmci3fr.c \ + protix.c \ + protsgix.c \ + pthrdext.c \ + span.c \ + ssixi3.c \ + thix.c \ + vmix.c + +LIBS = -lm -pthread + +include ll.gmk + +# For SQLite3. +LINKFLAGS += -L/usr/local/lib +CFLAGSCOMPILER += -I/usr/local/include + +include comm.gmk + + +# C. COPYRIGHT AND LICENSE +# +# Copyright (C) 2001-2014 Ravenbrook Limited . +# All rights reserved. This is an open source license. Contact +# Ravenbrook for commercial licensing options. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# 3. Redistributions in any form must be accompanied by information on how +# to obtain complete source code for this software and any accompanying +# software that uses this software. The source code must either be +# included in the distribution or be available for no more than the cost +# of distribution plus a nominal fee, and must be freely redistributable +# under reasonable conditions. For an executable file, complete source +# code means the source code for all modules it contains. It does not +# include source code for modules or files that typically accompany the +# major components of the operating system on which the executable file +# runs. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/mps/code/mps.c b/mps/code/mps.c index e71a0af19e1..5c82e162594 100644 --- a/mps/code/mps.c +++ b/mps/code/mps.c @@ -140,9 +140,9 @@ #include "span.c" /* generic stack probe */ #include "ssixi6.c" /* Posix on 64-bit Intel stack scan */ -/* FreeBSD on 32-bit Intel built with GCC */ +/* FreeBSD on 32-bit Intel built with GCC or Clang */ -#elif defined(MPS_PF_FRI3GC) +#elif defined(MPS_PF_FRI3GC) || defined(MPS_PF_FRI3LL) #include "lockix.c" /* Posix locks */ #include "thix.c" /* Posix threading */ @@ -155,7 +155,7 @@ #include "span.c" /* generic stack probe */ #include "ssixi3.c" /* Posix on 32-bit Intel stack scan */ -/* FreeBSD on 64-bit Intel built with GCC */ +/* FreeBSD on 64-bit Intel built with GCC or Clang */ #elif defined(MPS_PF_FRI6GC) || defined(MPS_PF_FRI6LL) diff --git a/mps/code/mpstd.h b/mps/code/mpstd.h index a0a913b28c2..6147e2a40e7 100644 --- a/mps/code/mpstd.h +++ b/mps/code/mpstd.h @@ -261,6 +261,23 @@ #define MPS_PF_ALIGN 4 +#elif defined(__FreeBSD__) && defined (__i386__) && defined (__GNUC__) \ + && defined(__clang__) +#if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI3LL) +#error "specified CONFIG_PF_... inconsistent with detected fri3ll" +#endif +#define MPS_PF_FRI3LL +#define MPS_PF_STRING "fri3ll" +#define MPS_OS_FR +#define MPS_ARCH_I3 +#define MPS_BUILD_LL +#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 4 + + #elif defined(__FreeBSD__) && defined (__x86_64__) && defined (__GNUC__) \ && !defined(__clang__) #if defined(CONFIG_PF_STRING) && ! defined(CONFIG_PF_FRI6GC) From 75a200ecde50c98b85d37e6df1921603abf7eba7 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 4 Mar 2016 13:26:43 +0000 Subject: [PATCH 2/4] Adding platforms fri3ll and fri6ll to autoconf and generating configure script. Copied from Perforce Change: 189625 ServerID: perforce.ravenbrook.com --- mps/configure | 40 +++++++++++++++++++++++++++++++--------- mps/configure.ac | 20 ++++++++++++++++++++ 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/mps/configure b/mps/configure index edbc7320304..2aa767cd2d5 100755 --- a/mps/configure +++ b/mps/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Memory Pool System Kit release/1.114.0. +# Generated by GNU Autoconf 2.69 for Memory Pool System Kit release/1.115.0. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Memory Pool System Kit' PACKAGE_TARNAME='mps-kit' -PACKAGE_VERSION='release/1.114.0' -PACKAGE_STRING='Memory Pool System Kit release/1.114.0' +PACKAGE_VERSION='release/1.115.0' +PACKAGE_STRING='Memory Pool System Kit release/1.115.0' PACKAGE_BUGREPORT='mps-questions@ravenbrook.com' PACKAGE_URL='http://www.ravenbrook.com/project/mps/' @@ -1245,7 +1245,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Memory Pool System Kit release/1.114.0 to adapt to many kinds of systems. +\`configure' configures Memory Pool System Kit release/1.115.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1310,7 +1310,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Memory Pool System Kit release/1.114.0:";; + short | recursive ) echo "Configuration of Memory Pool System Kit release/1.115.0:";; esac cat <<\_ACEOF @@ -1391,7 +1391,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Memory Pool System Kit configure release/1.114.0 +Memory Pool System Kit configure release/1.115.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1693,7 +1693,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Memory Pool System Kit $as_me release/1.114.0, which was +It was created by Memory Pool System Kit $as_me release/1.115.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3524,6 +3524,28 @@ $as_echo "FreeBSD x86_64" >&6; } CPP="$CC -I/usr/local/include -E" PFMCFLAGS="$CFLAGS_GC" ;; + i*86-*-freebsd*/yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86" >&5 +$as_echo "FreeBSD x86" >&6; } + MPS_OS_NAME=fr + MPS_ARCH_NAME=i3 + MPS_BUILD_NAME=ll + # Need /usr/local/include in order to find sqlite3.h + CFLAGS="-I/usr/local/include" + CPP="$CC -I/usr/local/include -E" + PFMCFLAGS="$CFLAGS_LL" + ;; + amd64-*-freebsd*/no | x86_64-*-freebsd*/no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 +$as_echo "FreeBSD x86_64" >&6; } + MPS_OS_NAME=fr + MPS_ARCH_NAME=i6 + MPS_BUILD_NAME=ll + # Need /usr/local/include in order to find sqlite3.h + CFLAGS="-I/usr/local/include" + CPP="$CC -I/usr/local/include -E" + PFMCFLAGS="$CFLAGS_LL" + ;; *) as_fn_error $? "MPS does not support this platform out of the box. See manual/build.txt" "$LINENO" 5 esac @@ -4144,7 +4166,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Memory Pool System Kit $as_me release/1.114.0, which was +This file was extended by Memory Pool System Kit $as_me release/1.115.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4198,7 +4220,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Memory Pool System Kit config.status release/1.114.0 +Memory Pool System Kit config.status release/1.115.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/mps/configure.ac b/mps/configure.ac index f6a276ad0cc..940ca852cc2 100644 --- a/mps/configure.ac +++ b/mps/configure.ac @@ -117,6 +117,26 @@ case $host/$CLANG in CPP="$CC -I/usr/local/include -E" PFMCFLAGS="$CFLAGS_GC" ;; + i*86-*-freebsd*/yes) + AC_MSG_RESULT([FreeBSD x86]) + MPS_OS_NAME=fr + MPS_ARCH_NAME=i3 + MPS_BUILD_NAME=ll + # Need /usr/local/include in order to find sqlite3.h + CFLAGS="-I/usr/local/include" + CPP="$CC -I/usr/local/include -E" + PFMCFLAGS="$CFLAGS_LL" + ;; + amd64-*-freebsd*/no | x86_64-*-freebsd*/no) + AC_MSG_RESULT([FreeBSD x86_64]) + MPS_OS_NAME=fr + MPS_ARCH_NAME=i6 + MPS_BUILD_NAME=ll + # Need /usr/local/include in order to find sqlite3.h + CFLAGS="-I/usr/local/include" + CPP="$CC -I/usr/local/include -E" + PFMCFLAGS="$CFLAGS_LL" + ;; *) AC_MSG_ERROR([MPS does not support this platform out of the box. See manual/build.txt]) esac From 35d7ce99d639281a3f0306d6557c7293cac5733e Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sat, 5 Mar 2016 14:08:09 +0000 Subject: [PATCH 3/4] Fixing build on w3i6mv. Copied from Perforce Change: 189651 ServerID: perforce.ravenbrook.com --- mps/code/.p4ignore | 2 ++ mps/code/commpre.nmk | 2 ++ mps/code/scan.c | 8 ++++++++ mps/code/ssw3i6mv.c | 3 +-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mps/code/.p4ignore b/mps/code/.p4ignore index f64f4cd5d6b..7db90ebb062 100644 --- a/mps/code/.p4ignore +++ b/mps/code/.p4ignore @@ -51,3 +51,5 @@ tags 9 # Mac OS X Finder turds .DS_Store +# Emacs backups +*~ diff --git a/mps/code/commpre.nmk b/mps/code/commpre.nmk index eaaa46c84a0..c6738c64c02 100644 --- a/mps/code/commpre.nmk +++ b/mps/code/commpre.nmk @@ -146,6 +146,7 @@ MPMCOMMON=\ [mpm] \ [mpsi] \ [nailboard] \ + [policy] \ [pool] \ [poolabs] \ [poolmfs] \ @@ -160,6 +161,7 @@ MPMCOMMON=\ [root] \ [sa] \ [sac] \ + [scan] \ [seg] \ [shield] \ [splay] \ diff --git a/mps/code/scan.c b/mps/code/scan.c index 59bda4ba583..b4c4eceae3f 100644 --- a/mps/code/scan.c +++ b/mps/code/scan.c @@ -13,6 +13,14 @@ */ #include "mps.h" +#include "mpstd.h" /* for MPS_BUILD_MV */ + + +#ifdef MPS_BUILD_MV +/* MSVC warning 4127 = conditional expression is constant */ +/* Objects to: MPS_SCAN_AREA(1). */ +#pragma warning( disable : 4127 ) +#endif #define MPS_SCAN_AREA(test) \ diff --git a/mps/code/ssw3i6mv.c b/mps/code/ssw3i6mv.c index 884424d259c..c95f8c30608 100644 --- a/mps/code/ssw3i6mv.c +++ b/mps/code/ssw3i6mv.c @@ -31,8 +31,7 @@ SRCID(ssw3i6mv, "$Id$"); Res StackScan(ScanState ss, Word *stackCold, - mps_area_scan_t scan_area - void *closure) + mps_area_scan_t scan_area, void *closure) { jmp_buf jb; From 8d3b67be05a0e6f6e441c5bf68a047d21a5043f9 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Sat, 5 Mar 2016 14:08:43 +0000 Subject: [PATCH 4/4] Enabling keyword expansion on scan.c. Copied from Perforce Change: 189652 ServerID: perforce.ravenbrook.com