Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jul 2011 11:41:30 GMT
From:      Rainer Hurling <rhurlin@gwdg.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/159328: [PATCH] fix math/ggobi to build with clang
Message-ID:  <201107311141.p6VBfUJc017234@red.freebsd.org>
Resent-Message-ID: <201107311150.p6VBo8hV084669@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         159328
>Category:       ports
>Synopsis:       [PATCH] fix math/ggobi to build with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 31 11:50:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Rainer Hurling
>Release:        9.0-CURRENT (amd64)
>Organization:
>Environment:
FreeBSD xxx.xxx 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sun Jul 17 12:47:15 CEST 2011 xxx@xxx.xxx:/usr/obj/usr/src/sys/XXX amd64
>Description:
As criticised by pointyhad on 16/06/2011 and 24/07/2011 for amd64, port math/ggobi does not run with clang compiler. 

It seems, the main error is in the 'line control' statement of src/ggobi-data.c, l.45: #line 0 "data.gob" (and others). The GObject builder produced a line number 0 (zero) on this and some other places in GGobi's code.


The official cpp online docs on http://gcc.gnu.org/onlinedocs/cpp/Line-Control.html define

#line linenum
linenum is a non-negative decimal integer constant. It specifies the line number which should be reported for the following line of input. Subsequent lines are counted from linenum.


It seems gcc accepts the 0 as valid, whilst clang produces an error '#line directive requires a positive integer argument'.

I think in this case it would be correct to change value 0 into 1 (#line 1). GCC is able to build that and it seems to work fine. I tried to contact the ggobi developers without success for more than a month now.

At least with gcc this solution seems to work right. I had not been able to test it with clang. Please test with clang before committing.

>How-To-Repeat:
Build math/ggobi with clang.
>Fix:
Apply the attached patch.


Patch attached with submission follows:

diff -Naur ggobi.orig/Makefile ggobi/Makefile
--- ggobi.orig/Makefile	2011-05-25 15:18:55.000000000 +0200
+++ ggobi/Makefile	2011-07-31 12:10:34.000000000 +0200
@@ -26,6 +26,11 @@
 post-patch:
 	@${REINPLACE_CMD} -e 's|ND_coord_i|ND_coord|' \
 		${WRKSRC}/plugins/GraphLayout/graphviz.c
+	@${REINPLACE_CMD} -e 's|#line 0|#line 1|' \
+		${WRKSRC}/src/ggobi-data.c \
+		${WRKSRC}/src/ggobi-renderer-cairo.c \
+		${WRKSRC}/src/ggobi-renderer-factory.c \
+		${WRKSRC}/src/ggobi-renderer.c
 
 post-install:
 	${MKDIR} ${PREFIX}/etc/xdg/ggobi


>Release-Note:
>Audit-Trail:
>Unformatted:



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