Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  9 Jan 2005 10:37:02 -0500 (EST)
From:      Aubrey Jaffer <agj@alum.mit.edu>
To:        inukai.d@jeans.ocn.ne.jp
Cc:        ports@FreeBSD.org
Subject:   Re: /usr/ports/lang/scm on 5.3-STABLE and 6.0-CURRENT
Message-ID:  <20050109153702.3C5131B772C@voluntocracy.org>
In-Reply-To: <20041031.041810.74752652.inukai.d@jeans.ocn.ne.jp>
References:  <20041031.041810.74752652.inukai.d@jeans.ocn.ne.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
 | Date: Sun, 31 Oct 2004 04:18:10 +0900 (JST)
 | From: "dai inukai" <inukai.d@jeans.ocn.ne.jp>
 | 
 | I recently realized and regret that "scm-5d9_1 is marked as broken:
 | Segfault during build." This seems not the scm fault but due to the
 | bug introduced by the gcc FreeBSD adopted for STABLE and CURRENT. I
 | say gcc bug because scm compiles correctly with gcc-3.4.3
 | (prerelease from the port.)

Thanks for your patch.

I put your (regex freebsd "-I/usr/include/gnu" "-lgnuregex" "" () ())
into build.scm.  The development version is updated:
http://swissnet.ai.mit.edu/ftpdir/users/jaffer/scm.zip

Rather than modify "build.scm" to include -DGCC_SPARC_BUG, I suggest
building thus:

 ./build -DGCC_SPARC_BUG --linker-options=-DGCC_SPARC_BUG

 | My system: 1 CPU Athlon XP 1800+ on M/B K7T266 PRO2
 | 
 | 5.3-STABLE: % uname -a 
 | FreeBSD daip 5.3-STABLE FreeBSD 5.3-STABLE #0: Tue Oct 26 21:47:52 JST
 | 2004 daip@daip:/usr/obj/usr/src/sys/DAIKERNEL i386
 | 
 | 6.0-CURRENT: % uname -a
 | FreeBSD daip 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Sat Oct 23 02:55:12
 | JST 2004 daip@daip:/usr/obj/usr/src/sys/DAIKERNEL i386
 | 
 | % cc --version
 | cc (GCC) 3.4.2 [FreeBSD] 20040728
 | 
 | When compiled with FreeBSD defaults, scmlit and scm crash with
 | Segmentation Fault in eval.c at the line 2090 with core dump output:
 | 
 | eval.c: 2090 x = arg1;
 | 
 | If I trace the program with gdb and dumped core files, the variable
 | arg1 in the function "static SCM ceval_1(x)" disappears except the
 | case compiled with the optimization option "-O0 (gcc default)."
 | 
 | This seems to be a similar bug to:
 | 
 | http://gcc.gnu.org/ml/gcc-bugs/2003-10/msg00520.html
 | 
 | and can be avoided with "-DGCC_SPARC_BUG" during the make.
 | 
 | I propose the attached patches until the next version of gcc is
 | adopted as default.
 | 
 | dai -- http://www4.ocn.ne.jp/~inukai/scheme.html
 | 
 | 
 | ----Next_Part(Sun_Oct_31_04:18:10_2004_586)--
 | Content-Type: Text/Plain; charset=us-ascii
 | Content-Transfer-Encoding: 7bit
 | Content-Disposition: inline; filename="Makefile.diff"
 | 
 | *** Makefile.orig	Mon Dec  1 13:49:57 2003
 | --- Makefile	Sat Oct 30 20:58:29 2004
 | ***************
 | *** 40,54 ****
 |   
 |   # "Makefile" for scm Scheme Interpreter
 |   # Author: Aubrey Jaffer
 |   
 |   SHELL = /bin/sh
 | ! #CC = gcc
 |   #CFLAGS = -g
 |   #LIBS =
 |   #LD = $(CC) -g
 | ! LD = $(CC)
 |   SCMLIT = ./scmlit
 |   SCMEXE = ./scm
 |   
 |   #BUILD = ./build -hsystem -p svr4-gcc-sun-ld
 |   BUILD = ./build -hsystem
 | --- 40,54 ----
 |   
 |   # "Makefile" for scm Scheme Interpreter
 |   # Author: Aubrey Jaffer
 |   
 |   SHELL = /bin/sh
 | ! #CC = ccache cc
 |   #CFLAGS = -g
 |   #LIBS =
 |   #LD = $(CC) -g
 | ! LD = $(CC) -O3 -DGCC_SPARC_BUG
 |   SCMLIT = ./scmlit
 |   SCMEXE = ./scm
 |   
 |   #BUILD = ./build -hsystem -p svr4-gcc-sun-ld
 |   BUILD = ./build -hsystem
 | 
 | ----Next_Part(Sun_Oct_31_04:18:10_2004_586)--
 | Content-Type: Text/Plain; charset=us-ascii
 | Content-Transfer-Encoding: 7bit
 | Content-Disposition: inline; filename="build.scm.diff"
 | 
 | *** build.scm.orig	Fri Aug 27 21:55:10 2004
 | --- build.scm	Sun Oct 31 02:45:32 2004
 | ***************
 | *** 623,633 ****
 |        (regex darwin "" "" #f () ())
 |   
 |        (c freebsd "" "-export-dynamic" #f () ())
 |        (m freebsd "" "-lm" #f () ())
 |        (curses freebsd "" "-lncurses" "/usr/lib/libncurses.a" () ())
 | !      (regex freebsd "" "-lgnuregex" "" () ())
 |        (editline freebsd "" "-lreadline" "" () ())
 |        (dlll freebsd "-DSUN_DL" "-export-dynamic" "" () ())
 |        (nostart freebsd "" "-e start -dc -dp -Bstatic -lgnumalloc" #f ("pre-crt0.c") ())
 |        (dump freebsd "" "/usr/lib/crt0.o" "" ("unexsunos4.c") ())
 |        (curses netbsd "-I/usr/pkg/include" "-lncurses" "-Wl,-rpath -Wl,/usr/pkg/lib -L/usr/pkg/lib" () ())
 | --- 623,633 ----
 |        (regex darwin "" "" #f () ())
 |   
 |        (c freebsd "" "-export-dynamic" #f () ())
 |        (m freebsd "" "-lm" #f () ())
 |        (curses freebsd "" "-lncurses" "/usr/lib/libncurses.a" () ())
 | !      (regex freebsd "-I/usr/include/gnu" "-lgnuregex" "" () ())
 |        (editline freebsd "" "-lreadline" "" () ())
 |        (dlll freebsd "-DSUN_DL" "-export-dynamic" "" () ())
 |        (nostart freebsd "" "-e start -dc -dp -Bstatic -lgnumalloc" #f ("pre-crt0.c") ())
 |        (dump freebsd "" "/usr/lib/crt0.o" "" ("unexsunos4.c") ())
 |        (curses netbsd "-I/usr/pkg/include" "-lncurses" "-Wl,-rpath -Wl,/usr/pkg/lib -L/usr/pkg/lib" () ())
 | ***************
 | *** 1586,1596 ****
 |   
 |   (defcommand compile-c-files freebsd
 |     (lambda (files parms)
 |       (and (batch:try-chopped-command
 |   	  parms
 | ! 	  "cc" "-O3 -pipe " "-c"
 |   	  (c-includes parms)
 |   	  (c-flags parms)
 |   	  files)
 |   	 (map c->o files))))
 |   (defcommand link-c-program freebsd
 | --- 1586,1597 ----
 |   
 |   (defcommand compile-c-files freebsd
 |     (lambda (files parms)
 |       (and (batch:try-chopped-command
 |   	  parms
 | ! ;	  "cc" "-O3 -pipe " "-c";;gcc 3.4.2 for FreeBSD does not allow options other than default i.e. -O0 if NO -DGCC_SPARC_BUG - dai 2004-10-30
 | ! 	  "cc" "-O3 -pipe -DGCC_SPARC_BUG " "-c"
 |   	  (c-includes parms)
 |   	  (c-flags parms)
 |   	  files)
 |   	 (map c->o files))))
 |   (defcommand link-c-program freebsd
 | 
 | ----Next_Part(Sun_Oct_31_04:18:10_2004_586)----
 | 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050109153702.3C5131B772C>