Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pcc/dist/pcc Import latest PCC snapshot 2014070...



details:   https://anonhg.NetBSD.org/src/rev/b6e74bb37cfb
branches:  trunk
changeset: 330865:b6e74bb37cfb
user:      plunky <plunky%NetBSD.org@localhost>
date:      Thu Jul 24 19:22:18 2014 +0000

description:
Import latest PCC snapshot 20140706; it has been over two years since
the last import, and some build framework has been changed so this
makes it easier for people to work with later versions.

The full list of changes in the meantime are available at the PCC
CVS server, and the bugs fixed are detailed at the PCC bug tracker,
but in summary, new features added are a C++ front end, m68k support
and unicode support.

and bugs fixed in the areas of the register allocator, floating point,
attributes, long long arithmetic, PIC support and code sections (for
shared libraries) among others.

This version compiles the vast majority of the NetBSD sources on i386,
and bug reports are welcome at the PCC JIRA server.

diffstat:

 external/bsd/pcc/dist/pcc/cc/cc/cc.c             |  2578 ++++++++++++---------
 external/bsd/pcc/dist/pcc/cc/ccom/Makefile.in    |    17 +-
 external/bsd/pcc/dist/pcc/cc/ccom/builtins.c     |   544 ++-
 external/bsd/pcc/dist/pcc/cc/ccom/cgram.y        |   470 ++-
 external/bsd/pcc/dist/pcc/cc/ccom/init.c         |    91 +-
 external/bsd/pcc/dist/pcc/cc/ccom/inline.c       |    86 +-
 external/bsd/pcc/dist/pcc/cc/ccom/optim.c        |    67 +-
 external/bsd/pcc/dist/pcc/cc/ccom/stabs.c        |     6 +-
 external/bsd/pcc/dist/pcc/cc/ccom/symtabs.c      |    12 +-
 external/bsd/pcc/dist/pcc/cc/cpp/Makefile.in     |    96 +-
 external/bsd/pcc/dist/pcc/cc/cpp/cpp.h           |    63 +-
 external/bsd/pcc/dist/pcc/cc/cpp/cpy.y           |     8 +-
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res14     |    11 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res15     |    18 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res15C    |    18 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res16     |   108 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res16C    |   108 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res17     |    21 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res3      |     1 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/res6      |     2 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test14    |     9 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test15    |    16 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test16    |    97 +
 external/bsd/pcc/dist/pcc/cc/cpp/tests/test17    |    19 +
 external/bsd/pcc/dist/pcc/cc/cpp/token.c         |  1037 ++++---
 external/bsd/pcc/dist/pcc/cc/cxxcom/Makefile.in  |     9 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/builtins.c   |   408 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/cgram.y      |    81 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/cxxcode.c    |    16 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/gcc_compat.c |    50 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/init.c       |    35 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/inline.c     |    17 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/main.c       |     7 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/optim.c      |     9 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/pass1.h      |    44 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/pftn.c       |   416 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/scan.l       |    21 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/stabs.c      |     6 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/symtabs.c    |    12 +-
 external/bsd/pcc/dist/pcc/cc/cxxcom/trees.c      |    76 +-
 external/bsd/pcc/dist/pcc/cc/driver/Makefile.in  |    35 +-
 external/bsd/pcc/dist/pcc/cc/driver/platform.c   |    34 +-
 external/bsd/pcc/dist/pcc/f77/f77/Makefile.in    |    33 +-
 external/bsd/pcc/dist/pcc/f77/fcom/Makefile.in   |     9 +-
 external/bsd/pcc/dist/pcc/mip/manifest.h         |    21 +-
 external/bsd/pcc/dist/pcc/mip/match.c            |    17 +-
 external/bsd/pcc/dist/pcc/mip/mkext.c            |    10 +-
 external/bsd/pcc/dist/pcc/mip/pass2.h            |    29 +-
 external/bsd/pcc/dist/pcc/mip/reader.c           |   189 +-
 external/bsd/pcc/dist/pcc/mip/regs.c             |   188 +-
 external/bsd/pcc/dist/pcc/mip/unicode.c          |   218 +
 external/bsd/pcc/dist/pcc/mip/unicode.h          |    15 +
 external/bsd/pcc/dist/pcc/os/bsd/ccconfig.h      |    18 +-
 external/bsd/pcc/dist/pcc/os/darwin/ccconfig.h   |    80 +-
 external/bsd/pcc/dist/pcc/os/freebsd/ccconfig.h  |    23 +-
 external/bsd/pcc/dist/pcc/os/inc/amd64.h         |    45 +
 external/bsd/pcc/dist/pcc/os/linux/ccconfig.h    |    45 +-
 external/bsd/pcc/dist/pcc/os/mirbsd/ccconfig.h   |    53 +-
 external/bsd/pcc/dist/pcc/os/netbsd/ccconfig.h   |    41 +-
 external/bsd/pcc/dist/pcc/os/openbsd/ccconfig.h  |    13 +-
 external/bsd/pcc/dist/pcc/os/sunos/ccconfig.h    |    16 +-
 external/bsd/pcc/dist/pcc/os/sysv4/ccconfig.h    |    56 +
 external/bsd/pcc/dist/pcc/os/win32/ccconfig.h    |     8 +-
 external/bsd/pcc/dist/pcc/os/win32/config.h      |     1 -
 64 files changed, 4691 insertions(+), 3216 deletions(-)

diffs (truncated from 12807 to 300 lines):

diff -r 94601ff461ff -r b6e74bb37cfb external/bsd/pcc/dist/pcc/cc/cc/cc.c
--- a/external/bsd/pcc/dist/pcc/cc/cc/cc.c      Thu Jul 24 19:11:58 2014 +0000
+++ b/external/bsd/pcc/dist/pcc/cc/cc/cc.c      Thu Jul 24 19:22:18 2014 +0000
@@ -1,5 +1,35 @@
-/*     Id: cc.c,v 1.215 2011/11/14 11:52:13 plunky Exp         */      
-/*     $NetBSD: cc.c,v 1.1.1.5 2012/01/11 20:33:05 plunky Exp $        */
+/*     Id: cc.c,v 1.278 2014/07/01 16:09:00 ragge Exp  */      
+/*     $NetBSD: cc.c,v 1.1.1.6 2014/07/24 19:22:18 plunky Exp $        */
+
+/*-
+ * Copyright (c) 2011 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * 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 AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR 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.
+ */
+
 /*
  * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
  *
@@ -70,6 +100,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#include <assert.h>
 
 #ifdef os_win32
 #include <windows.h>
@@ -83,95 +114,155 @@
 
 #include "compat.h"
 
+#include "macdefs.h"
+
+#include "xalloc.h"
+#include "strlist.h"
+
 #include "ccconfig.h"
-#include "macdefs.h"
 /* C command */
 
 #define        MKS(x) _MKS(x)
 #define _MKS(x) #x
 
-/*
- * Many specific definitions, should be declared elsewhere.
- */
+/* default program names in pcc */
+/* May be overridden if cross-compiler is generated */
+#ifndef CPPROGNAME
+#define        CPPROGNAME      "cpp"   /* cc used as cpp */
+#endif
+#ifndef PREPROCESSOR
+#define        PREPROCESSOR    "cpp"   /* "real" preprocessor name */
+#endif
+#ifndef COMPILER
+#define COMPILER       "ccom"
+#endif
+#ifndef CXXCOMPILER
+#define CXXCOMPILER    "cxxcom"
+#endif
+#ifndef ASSEMBLER
+#define ASSEMBLER      "as"
+#endif
+#ifndef LINKER
+#define LINKER         "ld"
+#endif
+char   *passp = PREPROCESSOR;
+char   *pass0 = COMPILER;
+char   *passxx0 = CXXCOMPILER;
+char   *as = ASSEMBLER;
+char   *ld = LINKER;
+char   *sysroot = "", *isysroot;
+
 
+/* crt files using pcc default names */
+#ifndef CRTBEGIN_S
+#define        CRTBEGIN_S      "crtbeginS.o"
+#endif
+#ifndef CRTEND_S
+#define        CRTEND_S        "crtendS.o"
+#endif
+#ifndef CRTBEGIN_T
+#define        CRTBEGIN_T      "crtbeginT.o"
+#endif
+#ifndef CRTEND_T
+#define        CRTEND_T        "crtendT.o"
+#endif
+#ifndef CRTBEGIN
+#define        CRTBEGIN        "crtbegin.o"
+#endif
+#ifndef CRTEND
+#define        CRTEND          "crtend.o"
+#endif
+#ifndef CRTI
+#define        CRTI            "crti.o"
+#endif
+#ifndef CRTN
+#define        CRTN            "crtn.o"
+#endif
+#ifndef CRT0
+#define        CRT0            "crt0.o"
+#endif
+#ifndef GCRT0
+#define        GCRT0           "gcrt0.o"
+#endif
+
+/* preprocessor stuff */
 #ifndef STDINC
 #define        STDINC          "/usr/include/"
 #endif
 
-#ifndef LIBDIR
-#define LIBDIR         "/usr/lib/"
-#endif
+char *cppadd[] = CPPADD;
+char *cppmdadd[] = CPPMDADD;
 
-#ifndef PREPROCESSOR
-#define PREPROCESSOR   "cpp"
-#endif
-
-#ifndef COMPILER
-#define COMPILER       "ccom"
-#endif
-
-#ifndef ASSEMBLER
-#define ASSEMBLER      "as"
+/* Dynamic linker definitions, per-target */
+#ifndef DYNLINKER
+#define        DYNLINKER { 0 }
 #endif
 
-#ifndef LINKER
-#define LINKER         "ld"
+/* Default libraries and search paths */
+#ifndef PCCLIBDIR      /* set by autoconf */
+#define PCCLIBDIR      NULL
+#endif
+#ifndef DEFLIBDIRS     /* default library search paths */
+#define DEFLIBDIRS     { "/usr/lib/", 0 }
 #endif
-
-#ifndef MULTIOSDIR
-#define MULTIOSDIR     "."
+#ifndef DEFLIBS                /* default libraries included */
+#define        DEFLIBS         { "-lpcc", "-lc", "-lpcc", 0 }
+#endif
+#ifndef DEFPROFLIBS    /* default profiling libraries */
+#define        DEFPROFLIBS     { "-lpcc", "-lc_p", "-lpcc", 0 }
+#endif
+#ifndef DEFCXXLIBS     /* default c++ libraries */
+#define        DEFCXXLIBS      { "-lp++", "-lpcc", "-lc", "-lpcc", 0 }
+#endif
+#ifndef STARTLABEL
+#define STARTLABEL "__start"
 #endif
 
+char *dynlinker[] = DYNLINKER;
+char *pcclibdir = PCCLIBDIR;
+char *deflibdirs[] = DEFLIBDIRS;
+char *deflibs[] = DEFLIBS;
+char *defproflibs[] = DEFPROFLIBS;
+char *defcxxlibs[] = DEFCXXLIBS;
 
-#define MAXFIL 10000
-#define MAXLIB 10000
-#define MAXAV  10000
-#define MAXOPT 200
-char   *tmp3;
-char   *tmp4;
-char   *outfile, *ermfile;
-static void add_prefix(const char *);
-static char *find_file(const char *, int);
-char *copy(const char *, int);
+char   *outfile, *MFfile, *fname;
+static char **lav;
+static int lac;
+static char *find_file(const char *file, struct strlist *path, int mode);
+static int preprocess_input(char *input, char *output, int dodep);
+static int compile_input(char *input, char *output);
+static int assemble_input(char *input, char *output);
+static int run_linker(void);
+static int strlist_exec(struct strlist *l);
+
 char *cat(const char *, const char *);
 char *setsuf(char *, char);
 int cxxsuf(char *);
 int getsuf(char *);
 char *getsufp(char *s);
 int main(int, char *[]);
-void error(char *, ...);
 void errorx(int, char *, ...);
-int callsys(char [], char *[]);
 int cunlink(char *);
+void exandrm(char *);
 void dexit(int);
 void idexit(int);
 char *gettmp(void);
-void *ccmalloc(int size);
+void oerror(char *);
+char *argnxt(char *, char *);
+char *nxtopt(char *o);
+void setup_cpp_flags(void);
+void setup_ccom_flags(void);
+void setup_as_flags(void);
+void setup_ld_flags(void);
+static void expand_sysroot(void);
 #ifdef os_win32
 char *win32pathsubst(char *);
-char *win32commandline(char *, char *[]);
+char *win32commandline(struct strlist *l);
 #endif
-char   *av[MAXAV];
-char   *clist[MAXFIL];
-char    *olist[MAXFIL];
-char   *llist[MAXLIB];
-char   *aslist[MAXAV];
-char   *cpplist[MAXAV];
-char   *xlist[100];
-int    xnum;
-char   *mlist[100];
-char   *flist[100];
-char   *wlist[100];
-char   *idirafter;
-int    nm;
-int    nf;
-int    nw;
 int    sspflag;
 int    freestanding;
-int    pflag;
-int    sflag;
+int    Sflag;
 int    cflag;
-int    eflag;
 int    gflag;
 int    rflag;
 int    vflag;
@@ -181,17 +272,13 @@
 int    kflag;  /* generate PIC/pic code */
 #define F_PIC  1
 #define F_pic  2
-int    Mflag;  /* dependencies only */
+int    Mflag, needM, MDflag;   /* dependencies only */
 int    pgflag;
-int    exfail;
 int    Xflag;
-int    Wallflag;
-int    Wflag;
 int    nostartfiles, Bstatic, shared;
 int    nostdinc, nostdlib;
-int    onlyas;
 int    pthreads;
-int    xcflag, xgnu89, xgnu99;
+int    xgnu89, xgnu99;
 int    ascpp;
 #ifdef CHAR_UNSIGNED
 int    xuchar = 1;
@@ -199,73 +286,15 @@
 int    xuchar = 0;
 #endif
 int    cxxflag;
+int    cppflag;
+int    printprogname, printfilename;
 
-char   *passp = LIBEXECDIR PREPROCESSOR;
-char   *pass0 = LIBEXECDIR COMPILER;
-char   *passxx0 = LIBEXECDIR "cxxcom";
-char   *as = ASSEMBLER;
-char   *ld = LINKER;
-char   *sysroot;
-char *cppadd[] = CPPADD;
-#ifdef DYNLINKER
-char *dynlinker[] = DYNLINKER;
-#endif
-#ifdef CRT0FILE
-char *crt0file = CRT0FILE;
-#endif
-#ifdef CRT0FILE_PROFILE



Home | Main Index | Thread Index | Old Index