From nobody@FreeBSD.org  Sat Feb 23 08:35:09 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A506416A401
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Feb 2008 08:35:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 88C3713C459
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Feb 2008 08:35:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1N8WVkV099568
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 23 Feb 2008 08:32:31 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m1N8WV2v099567;
	Sat, 23 Feb 2008 08:32:31 GMT
	(envelope-from nobody)
Message-Id: <200802230832.m1N8WV2v099567@www.freebsd.org>
Date: Sat, 23 Feb 2008 08:32:31 GMT
From: Dominic Fandrey <kamikaze@bsdforen.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] math/suitesparse does not build on amd64, because it ignores CFLAGS
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120985
>Category:       ports
>Synopsis:       [patch] math/suitesparse does not build on amd64, because it ignores CFLAGS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    maho
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 23 08:40:00 UTC 2008
>Closed-Date:    Wed Feb 27 05:21:12 UTC 2008
>Last-Modified:  Wed Feb 27 05:30:00 UTC 2008
>Originator:     Dominic Fandrey
>Release:        RELENG_7
>Organization:
private
>Environment:
FreeBSD mobileKamikaze.norad 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #3: Wed Feb 13 17:52:28 CET 2008     root@mobileKamikaze.norad:/usr/obj/HP6510b/amd64/usr/src/sys/HP6510b  amd64

>Description:
Building terminates in the following way:


/usr/bin/find 
/usr/obj/mobileKamikaze.norad/usr/ports/math/suitesparse/work/SuiteSparse_shared 
-name "*\.a" -exec /bin/mv {} 
/usr/obj/mobileKamikaze.norad/usr/ports/math/suitesparse/work/tmp_shared \;
cd /usr/obj/mobileKamikaze.norad/usr/ports/math/suitesparse/work/tmp_shared 
; for i in `ls *.a | /usr/bin/sed  's/\.a//' `; do  ld -Bshareable -o 
${i}.so.1 -x -soname ${i}.so.1 --whole-archive ${i}.a ; /bin/ln -s ${i}.so.1 
${i}.so ; done
ld: libcsparse.a(cs_add.o): relocation R_X86_64_32 can not be used when 
making a shared object; recompile with -fPIC
libcsparse.a(cs_add.o): could not read symbols: Bad value
*** Error code 1

Stop in /usr/ports/math/suitesparse.


As you see in the following snippet both CC and CFLAGS are ignored 
throughout the build process. Thus the -fPic parameter that gets properly 
set by the ports Makefile does not get through.

cc -O -I../../UFconfig -I../Include -DCS_LONG -DCS_COMPLEX -c 
./Source/cs_print.c -o cs_print_cl.o
cc -O -I../../UFconfig -I../Include -DCS_LONG -DCS_COMPLEX -c 
./Source/cs_norm.c -o cs_norm_cl.o
cc -O -I../../UFconfig -I../Include -DCS_LONG -DCS_COMPLEX -c 
./Source/cs_load.c -o cs_load_cl.o
cc -O -I../../UFconfig -I../Include -DCS_LONG -DCS_COMPLEX -c 
./Source/cs_dfs.c -o cs_dfs_cl.o


Only at the beginning of the build CC and CFLAGS is obeyed:

/usr/local/bin/ccache cc -O2 -fno-strict-aliasing -pipe -march=nocona -fPIC 
-DGETRUSAGE -I../Include -I../Source -I../../AMD/Include -I../../UFconfig 
-DZLONG -c ../Source/umfpack_symbolic.c -o umfpack_zl_symbolic.o
/usr/local/bin/ccache cc -O2 -fno-strict-aliasing -pipe -march=nocona -fPIC 
-DGETRUSAGE -I../Include -I../Source -I../../AMD/Include -I../../UFconfig 
-DZLONG -c ../Source/umfpack_transpose.c -o umfpack_zl_transpose.o
/usr/local/bin/ccache cc -O2 -fno-strict-aliasing -pipe -march=nocona -fPIC 
-DGETRUSAGE -I../Include -I../Source -I../../AMD/Include -I../../UFconfig 
-DZLONG -c ../Source/umfpack_triplet_to_col.c -o umfpack_zl_triplet_to_col.o
/usr/local/bin/ccache cc -O2 -fno-strict-aliasing -pipe -march=nocona -fPIC 
-DGETRUSAGE -I../Include -I../Source -I../../AMD/Include -I../../UFconfig 
-DZLONG -c ../Source/umfpack_scale.c -o umfpack_zl_scale.o
>How-To-Repeat:
Try to build on amd64.
>Fix:
--- /usr/ports/math/suitesparse/Makefile.orig	2008-02-23 09:29:28.000000000 +0100
+++ /usr/ports/math/suitesparse/Makefile	2008-02-23 09:30:29.000000000 +0100
@@ -90,12 +90,17 @@
 
 	@${REINPLACE_CMD}  -e 's,%%CFLAGS%%,${CFLAGS},g' \
 			   -e 's,%%FFLAGS%%,${FFLAGS},g' \
-				 ${WRKSRC}/UFconfig/UFconfig.mk \
+				 ${WRKSRC}/UFconfig/UFconfig.mk
 
 	@${REINPLACE_CMD}  -e 's,%%CFLAGS%%,${CFLAGS_SHARED},g' \
 			   -e 's,%%FFLAGS%%,${FFLAGS_SHARED},g' \
 				 ${WRKSRC_SHARED}/UFconfig/UFconfig.mk
 
+	@${FIND} ${WRKSRC} ${WRKSRC_SHARED} -name Makefile -exec \
+		${REINPLACE_CMD} -Ee 's,(CC =).*,\1 ${CC},1' \
+				 -Ee 's,(CFLAGS =).*,\1 ${CFLAGS_SHARED},1' \
+					\{} \;
+
 do-build:
 	cd ${WRKSRC} ; ${GMAKE}
 	cd ${WRKSRC_SHARED} ; ${GMAKE}


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->maho 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Feb 23 08:40:06 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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

From: Dominic Fandrey <kamikaze@bsdforen.de>
To: bug-followup@FreeBSD.org, kamikaze@bsdforen.de
Cc:  
Subject: Re: ports/120985: [patch] math/suitesparse does not build on amd64,
 because it ignores CFLAGS
Date: Sat, 23 Feb 2008 09:50:52 +0100

 Cursed be my impatience. I sent the wrong version of the patch. This is the 
 working one:
 
 --- /usr/ports/math/suitesparse/Makefile.orig	2008-02-23 09:29:28.000000000 +0100
 +++ /usr/ports/math/suitesparse/Makefile	2008-02-23 09:45:15.000000000 +0100
 @@ -90,12 +90,22 @@
 
   	@${REINPLACE_CMD}  -e 's,%%CFLAGS%%,${CFLAGS},g' \
   			   -e 's,%%FFLAGS%%,${FFLAGS},g' \
 -				 ${WRKSRC}/UFconfig/UFconfig.mk \
 +				 ${WRKSRC}/UFconfig/UFconfig.mk
 
   	@${REINPLACE_CMD}  -e 's,%%CFLAGS%%,${CFLAGS_SHARED},g' \
   			   -e 's,%%FFLAGS%%,${FFLAGS_SHARED},g' \
   				 ${WRKSRC_SHARED}/UFconfig/UFconfig.mk
 
 +	@${FIND} ${WRKSRC} -name Makefile -exec \
 +		${REINPLACE_CMD} -Ee 's,(CC =).*,\1 ${CC},1' \
 +				 -Ee 's,(CFLAGS =.*),\1 ${CFLAGS},1' \
 +					\{} \;
 +
 +	@${FIND} ${WRKSRC_SHARED} -name Makefile -exec \
 +		${REINPLACE_CMD} -Ee 's,(CC =).*,\1 ${CC},1' \
 +				 -Ee 's,(CFLAGS =.*),\1 ${CFLAGS_SHARED},1' \
 +					\{} \;
 +
   do-build:
   	cd ${WRKSRC} ; ${GMAKE}
   	cd ${WRKSRC_SHARED} ; ${GMAKE}
 
State-Changed-From-To: open->closed 
State-Changed-By: maho 
State-Changed-When: Wed Feb 27 05:20:58 UTC 2008 
State-Changed-Why:  
Fixed. Thanks!  

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/120985: commit references a PR
Date: Wed, 27 Feb 2008 05:20:30 +0000 (UTC)

 maho        2008-02-27 05:20:25 UTC
 
   FreeBSD ports repository
 
   Modified files:
     math/suitesparse     Makefile 
   Added files:
     math/suitesparse/files patch-CSparse+Lib+Makefile 
                            patch-CXSparse+Lib+Makefile 
   Log:
   Build fix on amd64. I fixed differently, though.
   
   Submitted by:   Dominic Fandrey
   PR:             120985
   
   Revision  Changes    Path
   1.26      +10 -2     ports/math/suitesparse/Makefile
   1.1       +11 -0     ports/math/suitesparse/files/patch-CSparse+Lib+Makefile (new)
   1.1       +11 -0     ports/math/suitesparse/files/patch-CXSparse+Lib+Makefile (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
