Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Feb 2008 08:32:31 GMT
From:      Dominic Fandrey <kamikaze@bsdforen.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/120985: [patch] math/suitesparse does not build on amd64, because it ignores CFLAGS
Message-ID:  <200802230832.m1N8WV2v099567@www.freebsd.org>
Resent-Message-ID: <200802230840.m1N8e0mT070272@freefall.freebsd.org>

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

>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 23 08:40:00 UTC 2008
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



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