Update ncc to version 2.7

Changes since 2.1:

New in 2.7
==========

- In the case where in a Makefile we had a target like:
	gcc foo.c bar.c zoo.c -o program
  using ncc instead of gcc would fail. Now this case is
  handled correctly.  If -ncgcc is specified gcc will be
  executed as above.  ncc instead will analyse each file
  and then link the generated .nccout files to program.nccout.
  (qemu)

- Fixed leaving ncurses mode -> xterm -> re-enter ncurses in
  nccnav.  Patch by Sylvain Beucler.

- New command line option -nccpp=<preprocessor>, useful for
  using ncc in cross compilation, from Jose Vasconcellos

New in 2.6
==========

- '-m*' flags are passed to the preprocessor.  For example if
  '-mmmx' is not used in preprocessing, the macro __MMX__ is not
  declared and importing <mmintrin.h> will fail.  (X11R71)

- If nccnav is executed from the root of the source tree, it will
  show relative file paths (good).

- Updated instructions for kernel hacking.  Some object files were
  missed.

- Fixed segfault with __gu_val.

- Speed up linking nccout object files.

- nccnav crashed if it couldn't open the temporary file.

New in 2.5
==========

- The nccnav viewer can show functions and files with "vi", thus
  with syntax coloring.  This will happen if you press 'v' on a
  function.

- The nccnav viewer can start from the list of global variables
  (by pressing 'g' in the initial screen).

- nccar will understand the "r" option and replace members in
  the archive instead of just appending the data.  That's the
  right thing because with the old version, linking archives
  into bigger archives would result in geometric explosion of
  the size of the files.

- Better type propagation in conditional expressions.
	(x ? (void*)0 : (struct A*)a)->x;
  now works (gcc/LIM_DATA)

- support for anonymous structures and unions (GNUC):
	struct X {
		union {
			int a, b, c;
		}
	};
	void f (struct X *x)
	{
		x->a = 1;
	}
  (linux 2.17)

- Fixes to hack linux 2.17:
  - The "__typeof__ (function)" can be used to declare another function
  - forward enum declarations
  - char X[] = ("hello");	// was error

- The expression in a Variable Length Array is not constant (and in fact
  it can call functions).
	int X [y = foo()];	// was error

- Debian package and Doc fixes by Anuradha Weeraman.

New in 2.4
==========

- Bugfix (segfault with gcc 4.x) from Florian Larysch.

- More configury for 'alloca()' in dbstree.

- new command line option '-ncnoerr'. When there are errors in
  expressions, ncc will not terminate the compilations. Instead
  it will link all functions that had errors with the special
  pseudo-function "NCC:syntax_error()".

New in 2.3
==========

- Bugfix (segfault with gcc 4.0) from Deepak Ravi.

- a typedef name used as a label would cause a syntax error (JamVM)

- Applying '*' on a function has no effect.  (pygame)
	void (*F)();
	(**F)();	// used to be error

- Support for '_Complex' as a declaration specifier.

New in 2.2
==========

- Included a LICENSE text in doc so ncc can be part of Debian.

- Bugfix/crash in nccnav.  Pressing the up-arrow in functions
  mode caused a segmentation violation because isalpha(KEY_UP)
  is true.

- if the last statement of a compound statement in expression
  was an __asm__ and that was the first expression of the program
  we had a segfault. Thanks to Thomas Petazzoni.

- Header file fixes for MacOS. (Adam Shostack)

- __inline__ is accepted as 'inline'.  gcc-3.4.4 broke things
  again.

- more pointer-to-function cases caught:
	fptr = flag ? p->tp_call : 0;
  now detects that calling fptr() may call p->tp_call()
  (python)
This commit is contained in:
Emil Sköldberg 2007-10-11 16:10:50 +00:00 committed by Thomas Klausner
parent c253c1271c
commit 51c974582e
6 changed files with 48 additions and 29 deletions

View file

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.6 2006/09/14 18:16:28 dhowland Exp $
# $NetBSD: Makefile,v 1.7 2007/10/11 16:10:50 emil_s Exp $
#
DISTNAME= ncc-2.1
DISTNAME= ncc-2.7
CATEGORIES= devel
MASTER_SITES= http://students.ceid.upatras.gr/~sxanth/ncc/
@ -14,6 +14,13 @@ CFLAGS+= -DNOGNU='"${PREFIX}/share/ncc/nognu"'
USE_LANGUAGES= c c++
SUBST_CLASSES+= prefix
SUBST_STAGE.prefix= pre-configure
SUBST_MESSAGE.prefix= Fixing hardcoded paths
SUBST_FILES.prefix= config.h
SUBST_SED.prefix= -e 's,@PREFIX@,${PREFIX},g'
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/objdir/ncc ${PREFIX}/bin
${LN} -s ncc ${PREFIX}/bin/nccar
@ -29,6 +36,7 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/doc/TROUBLES ${PREFIX}/share/doc/ncc
${INSTALL_DATA} ${WRKSRC}/doc/hacking.* ${PREFIX}/share/doc/ncc
${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/ncc
${INSTALL_DATA} ${WRKSRC}/doc/nognu ${PREFIX}/include
.include "../../devel/ncurses/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

View file

@ -1,10 +1,11 @@
@comment $NetBSD: PLIST,v 1.1.1.1 2004/12/27 14:26:58 thomasklausner Exp $
@comment $NetBSD: PLIST,v 1.2 2007/10/11 16:10:50 emil_s Exp $
bin/ncc
bin/nccar
bin/nccc++
bin/nccld
bin/nccnav
bin/nccnavi
include/nognu
man/man1/ncc.1
share/doc/ncc/KEYS.txt
share/doc/ncc/README
@ -13,6 +14,7 @@ share/doc/ncc/hacking.BIND
share/doc/ncc/hacking.GCC
share/doc/ncc/hacking.GLIBC
share/doc/ncc/hacking.LINUX-KERNEL
share/doc/ncc/hacking.QEMU
share/doc/ncc/hacking.README
share/ncc/nognu
@dirrm share/ncc

View file

@ -1,7 +1,8 @@
$NetBSD: distinfo,v 1.2 2005/09/28 06:41:31 rillig Exp $
$NetBSD: distinfo,v 1.3 2007/10/11 16:10:50 emil_s Exp $
SHA1 (ncc-2.1.tar.gz) = 5992ec4cec3ba28bf8d05ff542350859a3804de0
RMD160 (ncc-2.1.tar.gz) = d9b6b9f8472955c6a403bade1181bbe84b4ae96e
Size (ncc-2.1.tar.gz) = 84991 bytes
SHA1 (patch-aa) = 615105a09d5ebbbfec6c6163bc9c7bfe050011b0
SHA1 (patch-ab) = d9e3b00c83e3e222c9bf5dc12d9cc2bfba658a19
SHA1 (ncc-2.7.tar.gz) = e2cbd30df275b32e6d5afb10862cd3b57067cd43
RMD160 (ncc-2.7.tar.gz) = 1d88655eaabd67c7f5f4a07e010b43450916bf70
Size (ncc-2.7.tar.gz) = 103683 bytes
SHA1 (patch-aa) = 7a95f076a79774d043db12db6fe07dd5998bcbdf
SHA1 (patch-ab) = 92ada3f6f824d18a05a6e38d2f1086ebaa87e98e
SHA1 (patch-ac) = 437150dbe18e5d2c8c175667f3fa6b1d419f452a

View file

@ -1,21 +1,22 @@
$NetBSD: patch-aa,v 1.1.1.1 2004/12/27 14:26:58 thomasklausner Exp $
$NetBSD: patch-aa,v 1.2 2007/10/11 16:10:50 emil_s Exp $
--- config.h.orig 2004-12-10 21:24:06.000000000 +0100
--- config.h.orig 2007-08-28 21:51:44.000000000 +0000
+++ config.h
@@ -1,7 +1,7 @@
#ifdef __GCC__
@@ -3,7 +3,7 @@
#define alloca __builtin_alloca
#endif
#else
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <stdlib.h>
#else
#include <alloca.h>
@@ -12,7 +12,6 @@
@@ -14,7 +14,7 @@
#define GNU_VIOLATIONS
#define LABEL_VALUES
#define OUTPUT_EXT ".nccout"
-#define NOGNU "/usr/include/nognu"
+#define NOGNU "@PREFIX@/include"
#define NCC_INFILE_KEY "ncc-key"
#define FAKE_VARIABLE_ARRAYS
#define NCC_ISOC99

View file

@ -1,21 +1,15 @@
$NetBSD: patch-ab,v 1.1.1.1 2004/12/27 14:26:58 thomasklausner Exp $
$NetBSD: patch-ab,v 1.2 2007/10/11 16:10:50 emil_s Exp $
--- Makefile.orig 2004-12-27 10:14:37.000000000 +0100
--- Makefile.orig 2006-09-26 16:23:53.000000000 +0000
+++ Makefile
@@ -1,13 +1,13 @@
@@ -1,8 +1,8 @@
# these are set by config
-CC = g++
-LCFLAGS = -Wall -g -O2
+CC = $(CXX)
+LCFLAGS = -Wall -g
BINDIR = /usr/bin/
MANDIR = /usr/man/
NOGNU = /usr/include/nognu
#
-CFLAGS = $(LCFLAGS) -c
+CFLAGS+= $(LCFLAGS) -c
tout: objdir/ncc nccnav/nccnav
DESTDIR ?= /usr
-LCFLAGS = -g -O2
+LCFLAGS = -g
BINDIR = ${DESTDIR}/bin
MANDIR = ${DESTDIR}/share/man
INCLUDEDIR = ${DESTDIR}/include

13
ncc/patches/patch-ac Normal file
View file

@ -0,0 +1,13 @@
$NetBSD: patch-ac,v 1.1 2007/10/11 16:10:50 emil_s Exp $
--- dbstree.h.orig 2006-07-09 14:05:58.000000000 +0000
+++ dbstree.h
@@ -3,7 +3,7 @@
Check dbstree.tex for info.
******************************************************************************/
-#include <alloca.h>
+#include "config.h"
#ifndef HAVE_DBSTREE
#define HAVE_DBSTREE