Bug 71684 - lang/scm does not compile on FreeBSD 5.3BETA
Summary: lang/scm does not compile on FreeBSD 5.3BETA
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-12 21:50 UTC by J. Martin Petersen
Modified: 2004-12-15 13:20 UTC (History)
0 users

See Also:


Attachments
Makefile.bug_sparc.diff (698 bytes, patch)
2004-11-03 13:39 UTC, dai inukai
no flags Details | Diff
build.scm.bug_sparc.diff (2.07 KB, patch)
2004-11-03 13:39 UTC, dai inukai
no flags Details | Diff
patch-eval.c (256 bytes, text/plain)
2004-12-07 18:37 UTC, Florent Thoumie
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description J. Martin Petersen 2004-09-12 21:50:28 UTC
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

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.
How-To-Repeat: cd /usr/ports/lang/scm && make
Comment 1 dai inukai 2004-11-03 13:39:08 UTC
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

Comment 2 Florent Thoumie 2004-12-07 18:37:45 UTC
	Attached patch seems to solve this problem.

-- 
Florent Thoumie
flz@xbsd.org
Comment 3 Sergey Matveychuk freebsd_committer freebsd_triage 2004-12-12 15:33:06 UTC
State Changed
From-To: open->closed

Fixed, thanks!
Comment 4 dai inukai 2004-12-15 13:16:22 UTC
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