From owner-freebsd-ports@FreeBSD.ORG Sat Oct 30 19:18:13 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7B69216A4CE for ; Sat, 30 Oct 2004 19:18:13 +0000 (GMT) Received: from smtp.jeans.ocn.ne.jp (jeans.ocn.ne.jp [222.146.40.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB1A643D49 for ; Sat, 30 Oct 2004 19:18:12 +0000 (GMT) (envelope-from inukai.d@jeans.ocn.ne.jp) Received: from localhost (p0435-ip01yosida.nagano.ocn.ne.jp [61.119.155.181]) by smtp.jeans.ocn.ne.jp (Postfix) with ESMTP id 298A61013E; Sun, 31 Oct 2004 04:18:10 +0900 (JST) Date: Sun, 31 Oct 2004 04:18:10 +0900 (JST) Message-Id: <20041031.041810.74752652.inukai.d@jeans.ocn.ne.jp> To: ports@FreeBSD.org From: "dai inukai" X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sun_Oct_31_04:18:10_2004_586)--" Content-Transfer-Encoding: 7bit cc: inukai.d@jeans.ocn.ne.jp cc: agj@alum.mit.edu Subject: /usr/ports/lang/scm on 5.3-STABLE and 6.0-CURRENT X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2004 19:18:13 -0000 ----Next_Part(Sun_Oct_31_04:18:10_2004_586)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi 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.) 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)----