From nobody@FreeBSD.org  Sun Sep 12 20:45:19 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9FBB716A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Sep 2004 20:45:19 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 19ECB43D1D
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Sep 2004 20:45:09 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i8CKj8kf020789
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Sep 2004 20:45:08 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i8CKj85i020788;
	Sun, 12 Sep 2004 20:45:08 GMT
	(envelope-from nobody)
Message-Id: <200409122045.i8CKj85i020788@www.freebsd.org>
Date: Sun, 12 Sep 2004 20:45:08 GMT
From: "J. Martin Petersen" <jmp@alvorlig.dk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: lang/scm does not compile on FreeBSD 5.3BETA
X-Send-Pr-Version: www-2.3

>Number:         71684
>Category:       ports
>Synopsis:       lang/scm does not compile on FreeBSD 5.3BETA
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 20:50:28 GMT 2004
>Closed-Date:    Sun Dec 12 15:33:16 GMT 2004
>Last-Modified:  Wed Dec 15 13:20:23 GMT 2004
>Originator:     J. Martin Petersen
>Release:        RELENG_5
>Organization:
>Environment:
FreeBSD glitter.sadmachines.org 5.3-BETA2 FreeBSD 5.3-BETA2 #1: Wed Sep  8 16:08:45 CEST 2004     root@glitter.sadmachines.org:/usr/obj/usr/src/sys/JMP  i386

>Description:
The port lang/scm does not compile. It has been tested on two different machines (5.3BETA2 and 5.3BETA4). 

/usr/ports/lang/scm> sudo make clean
===>  Cleaning for unzip-5.51
===>  Cleaning for libiconv-1.9.2_1
===>  Cleaning for gettext-0.13.1_1
===>  Cleaning for gmake-3.80_2
===>  Cleaning for libtool-1.3.5_2
===>  Cleaning for libtool-1.5.8
===>  Cleaning for expat-1.95.8
===>  Cleaning for scm-5d9_1
/usr/ports/lang/scm> sudo make
===>  Extracting for scm-5d9_1
>How-To-Repeat:
cd /usr/ports/lang/scm && make

>Fix:
The error from sys.c can be fixed by adding an ifdef __FREEBSD__ (like the  Open and Net-BSD ones). This doesn't solve the problem, though.
>Release-Note:
>Audit-Trail:

From: DaiP <inukai.d@jeans.ocn.ne.jp>
To: freebsd-gnats-submit@FreeBSD.org, jmp@alvorlig.dk
Cc: inukai.d@jeans.ocn.ne.jp
Subject: Re: ports/71684: lang/scm does not compile on FreeBSD 5.3BETA
Date: Wed, 03 Nov 2004 22:39:08 +0900

 This is a multi-part message in MIME format.
 --------------080801070804080605070009
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Hi, this is dai inukai.
 
 The problem seems due to gcc (GCC) 3.4.2 [FreeBSD] 20040728 bug in 
 -STABLE and -CURRENT.
 
 The compiled scmlit and scm core dump with Segmentation Fault at the 
 line 2090 in the function "static SCM ceval_1(x)" in the file "eval.c":
 
       x = arg1;
 
 Becasue the variiable arg1 is lost or disappears while compiling except 
 when the optimization option "-O0 (gcc default)  is used due to the bug 
 and the reference to the non-existing varibale causes the segmentation 
 fault.
 
 Fix:
 
 Use "-DGCC_SPARC_BUG" as compile option (see attached files) with the 
 gcc-3.4.2 or use the gcc-3.4.3 or later from the port.
 
 My systems: 1 CPU Athlon XP 1800+ on M/B MSI K7T266 PRO2
 
 5.3-STABLE% 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% FreeBSD daip 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Sun Oct 31 
 17:14:35 JST 2004  
   daip@daip:/usr/obj/usr/src/sys/DAIKERNEL  i386
 
 dai -- http://www4.ocn.ne.jp/~inukai/scheme.html
 
 
 
 --------------080801070804080605070009
 Content-Type: text/plain;
  name="Makefile.bug_sparc.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="Makefile.bug_sparc.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
 
 --------------080801070804080605070009
 Content-Type: text/plain;
  name="build.scm.bug_sparc.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="build.scm.bug_sparc.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
 
 --------------080801070804080605070009--

From: Florent Thoumie <flz@xbsd.org>
To: freebsd-gnats-submit@FreeBSD.org, jmp@alvorlig.dk,
	inukai.d@jeans.ocn.ne.jp
Cc:  
Subject: Re: ports/71684: lang/scm does not compile on FreeBSD 5.3BETA
Date: Tue, 07 Dec 2004 19:37:45 +0100

 This is a multi-part message in MIME format.
 --------------030005000506090905040801
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 	Attached patch seems to solve this problem.
 
 -- 
 Florent Thoumie
 flz@xbsd.org
 
 --------------030005000506090905040801
 Content-Type: text/plain;
  name="patch-eval.c"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch-eval.c"
 
 --- eval.c.old	Tue Dec  7 19:31:35 2004
 +++ eval.c	Tue Dec  7 19:31:48 2004
 @@ -2051,7 +2051,7 @@
  #ifdef GCC_SPARC_BUG
    SCM arg1;
  #else
 -  struct {SCM arg_1;} t;
 +  volatile struct {SCM arg_1;} t;
  # define arg1 t.arg_1
  #endif
    SCM arg2, arg3, proc;
 
 --------------030005000506090905040801--
State-Changed-From-To: open->closed 
State-Changed-By: sem 
State-Changed-When: Sun Dec 12 15:33:06 GMT 2004 
State-Changed-Why:  
Fixed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71684 

From: DaiP <inukai.d@jeans.ocn.ne.jp>
To: freebsd-gnats-submit@FreeBSD.org, jmp@alvorlig.dk, flz@xbsd.org
Cc: dai <inukai.d@jeans.ocn.ne.jp>
Subject: Re: ports/71684: lang/scm does not compile on FreeBSD 5.3BETA
Date: Wed, 15 Dec 2004 22:16:22 +0900

 Hi, this is dai inukai
 
 Florent Thoumie wrote:
 
 >Attached patch seems to solve this problem.
 >
 
 Though the port is fixed now, another approach might have been 
 possible.  The 'volatile' modifier excludes the varibale from the 
 optimization process by the compiler and I would have prefered not to 
 change the source code because the problem seems to me  due to a 
 transitory regression of the actual system C compiler.  The ports' 
 Makefile is flexible enough to accept various options.
 
 After cd-ing to /usr/ports/lang/scm, the followings would have done 
 without changing thte source soce.
 
 With the actual system C compiler (gcc version 3.4.2 [FreeBSD] 20040728):
 
 % make  "CFLAGS=-O3 -DGCC_SPARC_BUG"
 
 or
 
 % make CC=gcc34 CFLAGS=-O3
 
 if gcc34 is istalled from the port.
 
 -- 
 dai -- http://www.dinukai.org/programming/scheme/scheme.html
 
 
>Unformatted:
 >> Checksum OK for scm5d9.zip.
 >> Checksum OK for slib3a1.zip.
 >> Checksum OK for slib-psd1-3.tar.gz.
 ===>   scm-5d9_1 depends on executable: unzip - found
 ===>  Patching for scm-5d9_1
 ===>  Applying FreeBSD patches for scm-5d9_1
 ===>   scm-5d9_1 depends on executable: gmake - found
 ===>  Configuring for scm-5d9_1
 ===>  Building for scm-5d9_1
 Makefile:69: srcdir.mk: No such file or directory
 echo "CPROTO=`type cproto | sed 's%.* %%'`" > srcdir.mk
 echo "srcdir=`pwd`/" >> srcdir.mk
 echo "#ifndef IMPLINIT" > newflags.h
 echo "#define IMPLINIT \"/usr/ports/lang/scm/work/scm/Init5d9.scm\"" >> newflags.h
 echo "#endif" >> newflags.h
 echo "#define CAUTIOUS" >> newflags.h
 if (diff newflags.h scmflags.h) then rm newflags.h; \
          else mv newflags.h scmflags.h; fi
 diff: scmflags.h: No such file or directory
 cc -c -O -pipe  scm.c -o scm.o
 cc -c -O -pipe  time.c -o time.o
 cc -c -O -pipe  repl.c -o repl.o
 cc -c -O -pipe  scl.c -o scl.o
 cc -c -O -pipe  sys.c -o sys.o
 sys.c: In function `prinport':
 sys.c:369: warning: passing arg 1 of `lputs' makes pointer from integer withouta cast
 cc -c -O -pipe  eval.c -o eval.o
 cc -c -O -pipe  subr.c -o subr.o
 cc -c -O -pipe  unif.c -o unif.o
 cc -c -O -pipe  rope.c -o rope.o
 cc -c -O -pipe  continue.c -o continue.o
 cc -c -O -pipe  findexec.c -o findexec.o
 cc -c -O -pipe  script.c -o script.o
 cc -c -O -pipe  debug.c -o debug.o
 cc -c -O -pipe  scmmain.c -o scmmain.o
 cp -p requires.scm require.scm
 cc -o scmlit scm.o time.o repl.o scl.o sys.o eval.o subr.o unif.o rope.o continue.o findexec.o script.o debug.o scmmain.o
 sys.o(.text+0x4dc): In function `ltmpnam':
 : warning: warning: tmpnam() possibly used unsafely; consider using mkstemp()
 gmake checklit
 gmake[1]: Entering directory `/usr/ports/lang/scm/work/scm'
 ./scmlit -fr4rstest.scm -e'(test-sc4)(test-cont)(test-delay)(gc)' \
 -e '(or (null? errs) (quit 1))'
 gmake[1]: *** [checklit] Segmentation fault (core dumped)
 gmake[1]: Leaving directory `/usr/ports/lang/scm/work/scm'
 gmake: *** [scmlit] Error 2
 *** Error code 2
 
 Stop in /usr/ports/lang/scm.
 /usr/ports/lang/scm> 
