Bug 174837 - lang/intercal semantic incorrect compiler, when built with gcc 4.2.1
Summary: lang/intercal semantic incorrect compiler, when built with gcc 4.2.1
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: Johan van Selst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-30 17:40 UTC by Klaus Aehlig
Modified: 2012-12-31 13:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Aehlig 2012-12-30 17:40:00 UTC
        If build with gcc 4.2.1 (i.e., the base cc on stable/8), ick
        produces compile errors when trying to use the system libraries.

Fix: Enforce building with a specific version of gcc, i.e., by
        applying the following patch (intercal.diff).



PLEASE DO WRITE IN .1
       DO WRITE IN .2
       DO READ OUT .1
       DO READ OUT .2
       DO (1009) NEXT
PLEASE DO READ OUT .3
       DO GIVE UP
--- add.i ends here -----W8CQ1Au3XivCQl4w9hnnPxZXuB4pMi8dWYw6fMbcvlGjZrIw
Content-Type: text/plain; name="intercal.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="intercal.diff"

diff -ruN intercal.orig/Makefile intercal/Makefile
--- intercal.orig/Makefile	2012-12-30 17:44:48.000000000 +0100
+++ intercal/Makefile	2012-12-30 17:45:04.000000000 +0100
@@ -15,6 +15,7 @@
 
 GNU_CONFIGURE=	yes
 USE_GMAKE=	yes
+USE_GCC=	4.6
 CFLAGS+=	-D_POSIX_SOURCE
 DATADIR=	${PREFIX}/share/ick
How-To-Repeat: 	Build lang/intercal on stable/8 (where the base compiler is gcc 4.2.1).
        Try to compile the attached program with 'ick -b add.i'. You get
        the compiler error

ICL997I ILLEGAL POSSESSION OF A CONTROLLED UNARY OPERATOR.
        ON THE WAY TO 27
        CORRECT SOURCE AND RESUBNIT

        instead of the expected addition program. This happens with
        other system library calls as well. If lang/intercal is built with gcc46
        everything works as expected. I have not tried which other C compilers
        do or do not work.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-12-30 17:40:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->johans

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Johan van Selst 2012-12-30 23:19:30 UTC
Hi Klaus,

I cannot reproduce this issue on my FreeBSD 9.0 or 9.1 systems, also
using gcc 4.2.1. Unfortunately I don't have any FreeBSD 8.x server to
test with, but I'm inclined to chalk this up as a 8.x issue rather than
a gcc issue. Would you happen to have any FreeBSD 9.x system with a
similar environment to test with? If the problem occurs there as well,
it could be something else than (just) a gcc issue.

Even if it's an 8.x-only issue, the suggested patch would be the same;
but in that case it could be limited to older versions (and safely
dropped when 8.x is no longer supported at some point in the far future).


Best regards,
Johan van Selst
Comment 3 Klaus Aehlig 2012-12-31 12:39:15 UTC
Hi Johan,

thank you very much for your prompt reply!

> I cannot reproduce this issue on my FreeBSD 9.0 or 9.1 systems, also
> using gcc 4.2.1. Unfortunately I don't have any FreeBSD 8.x server to
> test with, but I'm inclined to chalk this up as a 8.x issue rather than
> a gcc issue. Would you happen to have any FreeBSD 9.x system with a
> similar environment to test with? If the problem occurs there as well,
> it could be something else than (just) a gcc issue.

I just tried it on my 9.0 box with a roughly similar environment and I
couldn't reproduce the bug there either. So it is probably an 8.x-only
issue. However, I don't have another 8.x box with a different setup; so
I can't really verify if it's a generic problem on 8.x or just something
wrong with my setup.

> Even if it's an 8.x-only issue, the suggested patch would be the same;
> but in that case it could be limited to older versions (and safely
> dropped when 8.x is no longer supported at some point in the far future).

I think it can safely be limited to 8.x versions.

Thank you for your help and best regards,
Klaus
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-12-31 13:34:55 UTC
Author: johans
Date: Mon Dec 31 13:34:42 2012
New Revision: 309739
URL: http://svnweb.freebsd.org/changeset/ports/309739

Log:
  - Force use of modern GCC (4.6+) on FreeBSD 8.x and older
    Otherwise, an unusable binary would be produced
  - Bump PR
  
  PR:		ports/174837
  Submitted by:	Klaus Aehlig <aehlig@linta.de>

Modified:
  head/lang/intercal/Makefile

Modified: head/lang/intercal/Makefile
==============================================================================
--- head/lang/intercal/Makefile	Mon Dec 31 13:11:02 2012	(r309738)
+++ head/lang/intercal/Makefile	Mon Dec 31 13:34:42 2012	(r309739)
@@ -1,12 +1,9 @@
-# New ports collection makefile for:	intercal
-# Date created:        20 March 1998
-# Whom:                Matthew Hunt <mph@freebsd.org>
-#
+# Created by: Matthew Hunt <mph@freebsd.org>
 # $FreeBSD$
-#
 
 PORTNAME=	intercal
 PORTVERSION=	0.29
+PORTREVISION=	1
 CATEGORIES=	lang
 MASTER_SITES=	http://www.catb.org/~esr/intercal/
 
@@ -25,4 +22,10 @@ post-patch:
 	@${REINPLACE_CMD} -e '/ICK_SPECIFIC_SUBDIR/s/-@PACKAGE_VERSION@// ' \
 		${WRKSRC}/buildaux/Makefile.in
 
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 900000
+USE_GCC=	4.6+
+.endif
+
+.include <bsd.port.post.mk>
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Johan van Selst freebsd_committer freebsd_triage 2012-12-31 13:35:39 UTC
State Changed
From-To: open->closed

Patch committed for FreeBSD 8.x and older. Thanks.