Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Apr 2011 09:18:26 GMT
From:      Carl <k0802647@telus.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/156607: print/ghostscript8: setting TARGET_ARCH variable prevents compilation
Message-ID:  <201104240918.p3O9IQmU058857@red.freebsd.org>
Resent-Message-ID: <201104240920.p3O9K8S2046219@freefall.freebsd.org>

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

>Number:         156607
>Category:       ports
>Synopsis:       print/ghostscript8: setting TARGET_ARCH variable prevents compilation
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 24 09:20:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Carl
>Release:        FreeBSD-8.1-RELEASE-amd64/i386
>Organization:
>Environment:
FreeBSD xxxxxxxx 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
Trying to build /usr/ports/print/ghostscript8 with the following command results in a compilation failure:

env TARGET_ARCH=i386 make

as seen in this excerpted output:

===== start excerpt =====
cc -O2 -pipe -fno-strict-aliasing -DUPD_SIGNAL=0 -I.  -I/usr/workdir/usr/ports/print/ghostscript8/work/ghostscript-8.71/jasper/src/libjasper/include  -I/usr/local/include/libpng  -I/usr/local/include i386 -c -o ert.o ert.c
cc: i386: No such file or directory
ert.c: In function 'printUsageAndExit':
ert.c:34: warning: incompatible implicit declaration of built-in function 'exit'
ert.c: In function 'main':
ert.c:52: warning: incompatible implicit declaration of built-in function 'malloc'
ert.c:55: warning: incompatible implicit declaration of built-in function 'exit'
ert.c:63: warning: incompatible implicit declaration of built-in function 'strlen'
ert.c:73: warning: incompatible implicit declaration of built-in function 'exit'
ert.c:82: warning: incompatible implicit declaration of built-in function 'exit'
ert.c:87: warning: incompatible implicit declaration of built-in function 'exit'
ert.c:116: warning: incompatible implicit declaration of built-in function 'exit'
gmake: *** [ert.o] Error 1
*** Error code 2

Stop in /usr/ports/print/ghostscript8.
===== end excerpt =====

Note the incorrect inclusion of "i386" just before the -c option in the "cc" command line.

This is the same problem found in the following problem reports:

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

It seems to me that someone knowledgeable about this problem should take on the task of searching the entire ports collection for all instances of this same bug, rather than hoping random end users will eventually discover and report them all one at a time. I wasted a lot of time trying to solve this problem before I eventually ran across those other PRs - this should not be repeated.

>How-To-Repeat:
env TARGET_ARCH=i386 make

>Fix:
The attached patch worked for me, although I admit to not really understanding the problem. Note that this is essentially the same fix as for PR ports/147853 (see mail/ssmtp/Makefile, revision 1.32), but I am wondering whether there is some reason why the fix for PR ports/151224 as implemented in multimedia/x264/Makefile, revision 1.79 includes the clearing of not only TARGET_ARCH, but also ARCH.

Patch attached with submission follows:

--- Makefile.orig	2011-04-21 23:40:00.000000000 -0700
+++ Makefile	2011-04-22 00:22:43.000000000 -0700
@@ -43,7 +43,7 @@
 
 MAKE_ENV=	CFLAGS_STANDARD="${CFLAGS}" \
 		XCFLAGS="${XCFLAGS}" XLDFLAGS="${XLDFLAGS}" \
-		EXTRALIBS="${EXTRALIBS}" \
+		EXTRALIBS="${EXTRALIBS}" TARGET_ARCH= \
 		SOC_LOADER="dxmainc.c"
 CONFIGURE_ENV=	${MAKE_ENV} CPPFLAGS="${CPPFLAGS}" \
 		LDFLAGS="-L${LOCALBASE}/lib"


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



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