Bug 186946 - science/netcdf: ia64 11-current build failure: configure: error: C compiler cannot create executables
Summary: science/netcdf: ia64 11-current build failure: configure: error: C compiler c...
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: Sunpoet Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-21 14:50 UTC by Anton Shterenlikht
Modified: 2014-03-06 16:40 UTC (History)
0 users

See Also:


Attachments
fortran.mk.patch (647 bytes, patch)
2014-02-24 11:08 UTC, Tijl Coosemans
no flags Details | Diff
netcdf.patch (1.98 KB, patch)
2014-02-27 14:27 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Shterenlikht 2014-02-21 14:50:00 UTC
building in a poudriere jail,
fails with:

configure: finding C compiler
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.

The full build log:
http://eis.bris.ac.uk/~mexas/logs/netcdf3-3.6.3_5.log

config.log:
http://eis.bris.ac.uk/~mexas/logs/ia64-11-current-netcdf-config.log
Comment 1 Edwin Groothuis freebsd_committer 2014-02-21 14:50:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Tijl Coosemans freebsd_committer 2014-02-24 10:30:48 UTC
Hi,

With lang/gcc installed, does this command fail on ia64:

echo "int main(void) { return 0; }" | cc -o test -L/usr/local/lib/gcc46 -x c -

How about this one:

echo "int main(void) { return 0; }" | cc -o test -B/usr/local/bin -L/usr/local/lib/gcc46 -x c -
Comment 3 Anton Shterenlikht 2014-02-24 10:34:48 UTC
$ echo "int main(void) { return 0; }" | cc -o test -L/usr/local/lib/gcc46 -x c -
/usr/local/lib/gcc46/libgcc_s.so: could not read symbols: File in wrong format
$ echo "int main(void) { return 0; }" | cc -o test -B/usr/local/bin -L/usr/local/lib/gcc46 -x c -
$
Comment 4 Tijl Coosemans freebsd_committer 2014-02-24 11:08:13 UTC
On Mon, 24 Feb 2014 02:34:48 -0800 (PST) Anton Shterenlikht wrote:
> $ echo "int main(void) { return 0; }" | cc -o test -L/usr/local/lib/gcc46 -x c -
> /usr/local/lib/gcc46/libgcc_s.so: could not read symbols: File in wrong format
> $ echo "int main(void) { return 0; }" | cc -o test -B/usr/local/bin -L/usr/local/lib/gcc46 -x c -
> $ 

Give the attached patch a try, also for PR 187000.
Comment 5 Anton Shterenlikht 2014-02-24 12:13:34 UTC
Now fails at:

--- libnetcdff.la ---
/bin/sh ../libtool --tag=CC    --mode=link cc  -O2 -pipe -fno-strict-aliasing  -L/lib -version-info 4:0:0 -Wl,-rpath=/usr/local/lib/gcc46  -L/usr/local/lib/gcc46 -B/usr/local/bin -o libnetcdff.la -rpath /usr/local/lib fort-attio.lo fort-control.lo fort-dim.lo  fort-genatt.lo fort-geninq.lo fort-genvar.lo fort-lib.lo  fort-misc.lo fort-v2compat.lo fort-vario.lo fort-var1io.lo  fort-varaio.lo fort-varmio.lo fort-varsio.lo  ../f90/libnetcdff90.la 
libtool: link: cc -shared  .libs/fort-attio.o .libs/fort-control.o .libs/fort-dim.o .libs/fort-genatt.o .libs/fort-geninq.o .libs/fort-genvar.o .libs/fort-lib.o .libs/fort-misc.o .libs/fort-v2compat.o .libs/fort-vario.o .libs/fort-var1io.o .libs/fort-varaio.o .libs/fort-varmio.o .libs/fort-varsio.o  -Wl,--whole-archive ../f90/.libs/libnetcdff90.a -Wl,--no-whole-archive  -L/lib -L/usr/local/lib/gcc46  -Wl,-rpath=/usr/local/lib/gcc46   -Wl,-soname -Wl,libnetcdff.so.4 -o .libs/libnetcdff.so.4
/usr/local/lib/gcc46/libgcc_s.so: could not read symbols: File in wrong format
*** [libnetcdff.la] Error code 1

make[5]: stopped in /usr/ports/science/netcdf/work/netcdf-3.6.3/fortran
1 error
Comment 6 dfilter service freebsd_committer 2014-02-26 11:44:57 UTC
Author: tijl
Date: Wed Feb 26 11:44:49 2014
New Revision: 346193
URL: http://svnweb.freebsd.org/changeset/ports/346193
QAT: https://qat.redports.org/buildarchive/r346193/

Log:
  Add -B${LOCALBASE}/bin to LDFLAGS just like compiler.mk does.  This fixes
  linking problems when base system cc/c++ is used to link object files
  generated by gfortran.  This affects FreeBSD/i386 8.x and all versions of
  FreeBSD/ia64.
  
  PR:		ports/186946

Modified:
  head/Mk/Uses/fortran.mk

Modified: head/Mk/Uses/fortran.mk
==============================================================================
--- head/Mk/Uses/fortran.mk	Wed Feb 26 11:27:56 2014	(r346192)
+++ head/Mk/Uses/fortran.mk	Wed Feb 26 11:44:49 2014	(r346193)
@@ -25,7 +25,7 @@ FC=		gfortran${_GCC_VER}
 FFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
 FCFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER}
 LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc${_GCC_VER} \
-		-L${LOCALBASE}/lib/gcc${_GCC_VER}
+		-L${LOCALBASE}/lib/gcc${_GCC_VER} -B${LOCALBASE}/bin
 .elif ${fortran_ARGS} == ifort
 BUILD_DEPENDS+=	${LOCALBASE}/intel_fc_80/bin/ifort:${PORTSDIR}/lang/ifc
 RUN_DEPENDS+=	${LOCALBASE}/intel_fc_80/bin/ifort:${PORTSDIR}/lang/ifc
_______________________________________________
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 7 dfilter service freebsd_committer 2014-02-27 09:51:52 UTC
Author: tijl
Date: Thu Feb 27 09:51:45 2014
New Revision: 346312
URL: http://svnweb.freebsd.org/changeset/ports/346312
QAT: https://qat.redports.org/buildarchive/r346312/

Log:
  - Some ports ship with libtool 1.5.x + "anygcc" patch.  This modified
    version calls "gcc" in two places.  Replace that with $CC.
  - r346193 added -B${LOCALBASE}/bin in Uses/fortran.mk, just like
    compiler.mk, but libtool doesn't recognise this flag and discards it.
    Patch ltmain.sh so it passes the flag to the linker unmodified.
    This only works on libtool 2.x for now, but that's good enough to fix
    the PRs below and a linker error in math/octave on FreeBSD/i386 8.x.
    (When those ports set USES=libtool.)
  
  PR:		ports/186946, ports/187000
  Approved by:	bapt

Modified:
  head/Mk/Uses/libtool.mk

Modified: head/Mk/Uses/libtool.mk
==============================================================================
--- head/Mk/Uses/libtool.mk	Thu Feb 27 09:49:51 2014	(r346311)
+++ head/Mk/Uses/libtool.mk	Thu Feb 27 09:51:45 2014	(r346312)
@@ -19,12 +19,18 @@ _INCLUDE_USES_LIBTOOL_POST_MK=	yes
 patch-libtool:
 	@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \)	\
 		-type f | ${XARGS} ${REINPLACE_CMD}			\
+		-e '/gcc_dir=\\`/s/gcc /$$CC /'				\
+		-e '/gcc_ver=\\`/s/gcc /$$CC /'				\
 		-e '/link_all_deplibs[0-9A-Z_]*=/s/=unknown/=no/'	\
 		-e 's,freebsd\*),freebsd\*|dragonfly\*),g'		\
 		-e '/objformat=/s/echo aout/echo elf/'			\
 		-e "/freebsd-elf\\*)/,/;;/ {				\
 		    /deplibs_check_method=/s/=.*/=pass_all/; }"	
 
+	@${FIND} ${WRKDIR} -type f -name ltmain.sh |			\
+		${XARGS} ${REINPLACE_CMD}				\
+		-e 's/|-p|-pg|/|-B*|-p|-pg|/'
+
 .if ! ${libtool_ARGS:Moldver}
 	@${FIND} ${WRKDIR} \( -name configure -or -name ltconfig \)	\
 		-type f | ${XARGS} ${REINPLACE_CMD}			\
_______________________________________________
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 8 Tijl Coosemans freebsd_committer 2014-02-27 14:27:44 UTC
Hi Anton,

Can you try the attached patch for science/netcdf?  You also need at least
revision 346312 of the ports tree.
Comment 9 Anton Shterenlikht 2014-02-27 14:29:08 UTC
still the same error:

libtool: link: cc -shared  .libs/fort-attio.o .libs/fort-control.o .libs/fort-dim.o .libs/fort-genat.o .libs/fort-geninq.o .libs/fort-genvar.o .libs/fort-lib.o .libs/fort-misc.o .libs/fort-v2compat. .libs/fort-vario.o .libs/fort-var1io.o .libs/fort-varaio.o .libs/fort-varmio.o .libs/fort-varsio.o -Wl,--whole-archive ../f90/.libs/libnetcdff90.a -Wl,--no-whole-archive  -L/lib -L/usr/local/lib/gc46  -Wl,-rpath=/usr/local/lib/gcc46   -Wl,-soname -Wl,libnetcdff.so.4 -o .libs/libnetcdff.so.4
/usr/local/lib/gcc46/libgcc_s.so: could not read symbols: File in wrong format
*** [libnetcdff.la] Error code 1

make[5]: stopped in /usr/ports/science/netcdf/work/netcdf-3.6.3/fortran

The ports are at 346342
Comment 10 Anton Shterenlikht 2014-02-27 14:51:10 UTC
yes, this patch seems to solve the problem:

====> Compressing man pages (compress-man)
====> Running Q/A tests (stage-qa)
Warning: /usr/ports/science/netcdf/work/stage/usr/local/lib/libnetcdff.so.4.0.0 is not stripped consider using ${STRIP_CMD}
Warning: /usr/ports/science/netcdf/work/stage/usr/local/lib/libnetcdf.so.4.0.0 is not stripped consider using ${STRIP_CMD}
Warning: /usr/ports/science/netcdf/work/stage/usr/local/lib/libnetcdf_c++.so.4.0.0 is not stripped consider using ${STRIP_CMD}
===>  Installing for netcdf3-3.6.3_6
===>  Checking if science/netcdf already installed
===>   Registering installation for netcdf3-3.6.3_6
Installing netcdf3-3.6.3_6... done
# 

I understand these warnings are benign.

Many thanks

Anton
Comment 11 Tijl Coosemans freebsd_committer 2014-02-27 15:25:04 UTC
On Thu, 27 Feb 2014 06:51:10 -0800 (PST) Anton Shterenlikht wrote:
> yes, this patch seems to solve the problem:
> 
> ====> Compressing man pages (compress-man)
> ====> Running Q/A tests (stage-qa)
> Warning: /usr/ports/science/netcdf/work/stage/usr/local/lib/libnetcdff.so.4.0.0 is not stripped consider using ${STRIP_CMD}
> Warning: /usr/ports/science/netcdf/work/stage/usr/local/lib/libnetcdf.so.4.0.0 is not stripped consider using ${STRIP_CMD}
> Warning: /usr/ports/science/netcdf/work/stage/usr/local/lib/libnetcdf_c++.so.4.0.0 is not stripped consider using ${STRIP_CMD}
> ===>  Installing for netcdf3-3.6.3_6
> ===>  Checking if science/netcdf already installed
> ===>   Registering installation for netcdf3-3.6.3_6
> Installing netcdf3-3.6.3_6... done
> # 
> 
> I understand these warnings are benign.
> 
> Many thanks
> 
> Anton

Ok, I'll let Sunpoet deal with this further.
Comment 12 Anton Shterenlikht 2014-03-05 08:58:42 UTC
I'm now using a poudriere jail at  r262690,
and the ports tree at r347001, but the error
is still there:

http://eis.bris.ac.uk/~mexas/logs/netcdf3-3.6.3_5.log

So the patch hasn't been committed yet?

Thanks

Anton
Comment 13 Anton Shterenlikht 2014-03-06 10:59:30 UTC
seems fixed in r347176.

Please close this PR
Comment 14 Thierry Thomas freebsd_committer 2014-03-06 13:03:46 UTC
State Changed
From-To: open->closed


Closed at maintainer's request.
Comment 15 dfilter service freebsd_committer 2014-03-06 16:35:46 UTC
Author: tijl
Date: Thu Mar  6 16:35:32 2014
New Revision: 347269
URL: http://svnweb.freebsd.org/changeset/ports/347269
QAT: https://qat.redports.org/buildarchive/r347269/

Log:
  - Add USES=libtool to fix linker problem on FreeBSD/i386 8.x and
    FreeBSD/ia64 (binutils too old).
  - Staging.
  
  PR:		ports/186946
  Approved by:	sunpoet (maintainer)

Modified:
  head/science/netcdf/Makefile
  head/science/netcdf/pkg-plist

Modified: head/science/netcdf/Makefile
==============================================================================
--- head/science/netcdf/Makefile	Thu Mar  6 16:33:17 2014	(r347268)
+++ head/science/netcdf/Makefile	Thu Mar  6 16:35:32 2014	(r347269)
@@ -3,7 +3,7 @@
 
 PORTNAME=	netcdf
 PORTVERSION=	3.6.3
-PORTREVISION?=	5
+PORTREVISION?=	6
 CATEGORIES=	science
 MASTER_SITES=	http://www.unidata.ucar.edu/downloads/netcdf/ftp/ \
 		ftp://ftp.unidata.ucar.edu/pub/netcdf/ \
@@ -19,17 +19,15 @@ PORTSCOUT=	limit:^3\.
 CONFIGURE_ARGS=	--enable-shared
 CPPFLAGS+=	-I${LOCALBASE}/include -fPIC -DPIC
 GNU_CONFIGURE=	yes
+USES=		libtool
 USE_LDCONFIG=	yes
 
 INFO=		netcdf netcdf-c netcdf-cxx netcdf-f77 netcdf-f90 \
 		netcdf-install netcdf-tutorial
-MAN1=		ncdump.1 ncgen.1
-MAN3=		netcdf.3
 
 OPTIONS_DEFINE=	FORTRAN DOCS
 FORTRAN_DESC=	Build library for Fortran
 
-NO_STAGE=	yes
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MDOCS}
@@ -41,7 +39,6 @@ CONFIGURE_ARGS+=--disable-docs-install
 .if ${PORT_OPTIONS:MFORTRAN}
 CPPFLAGS+=	-DpgiFortran
 CONFLICTS+=	netcdf-3.*
-MAN3+=		netcdf_f77.3 netcdf_f90.3
 PLIST_SUB+=	FORTRAN=""
 USES+=		fortran
 .else

Modified: head/science/netcdf/pkg-plist
==============================================================================
--- head/science/netcdf/pkg-plist	Thu Mar  6 16:33:17 2014	(r347268)
+++ head/science/netcdf/pkg-plist	Thu Mar  6 16:35:32 2014	(r347269)
@@ -11,14 +11,22 @@ lib/libnetcdf.a
 lib/libnetcdf.la
 lib/libnetcdf.so
 lib/libnetcdf.so.4
+lib/libnetcdf.so.4.0.0
 lib/libnetcdf_c++.a
 lib/libnetcdf_c++.la
 lib/libnetcdf_c++.so
 lib/libnetcdf_c++.so.4
+lib/libnetcdf_c++.so.4.0.0
 %%FORTRAN%%lib/libnetcdff.a
 %%FORTRAN%%lib/libnetcdff.la
 %%FORTRAN%%lib/libnetcdff.so
 %%FORTRAN%%lib/libnetcdff.so.4
+%%FORTRAN%%lib/libnetcdff.so.4.0.0
+man/man1/ncdump.1.gz
+man/man1/ncgen.1.gz
+man/man3/netcdf.3.gz
+%%FORTRAN%%man/man3/netcdf_f77.3.gz
+%%FORTRAN%%man/man3/netcdf_f90.3.gz
 %%PORTDOCS%%%%DOCSDIR%%/ncgen-man-1.html
 %%PORTDOCS%%%%DOCSDIR%%/ncdump-man-1.html
 %%PORTDOCS%%%%DOCSDIR%%/netcdf-c.html
_______________________________________________
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"