Bug#890271: libcgns: FTBFS with glibc 2.27: undefined reference to `matherr'

Aurelien Jarno aurel32 at debian.org
Mon Feb 12 19:49:33 UTC 2018


Source: libcgns
Version: 3.3.0-5
Severity: important
Tags: patch

libcgns 3.3.0-5 fails to build with glibc 2.27 (2.27-0experimental0 from
experimental):

| cd /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/cgnstools/cgnsview && /usr/bin/cmake -E cmake_link_script CMakeFiles/cgiowish.dir/link.txt --verbose=1
| /usr/bin/cc -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -Wl,-z,relro -rdynamic CMakeFiles/cgiowish.dir/cgiowish.c.o CMakeFiles/cgiowish.dir/cgiotcl.c.o  -o cgiowish  -L. -Wl,-rpath,.:/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src:/usr/lib/x86_64-linux-gnu/hdf5/serial: ../../libcgns.so.3.3 -ltcl -ltk /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so -lpthread -lsz -lz -ldl -lm -lX11 -lm 
| CMakeFiles/cgiowish.dir/cgiowish.c.o:./obj-x86_64-linux-gnu/src/cgnstools/cgnsview/./src/cgnstools/cgnsview/cgiowish.c:24: undefined reference to `matherr'
| collect2: error: ld returned 1 exit status
| src/cgnstools/cgnsview/CMakeFiles/cgiowish.dir/build.make:133: recipe for target 'src/cgnstools/cgnsview/cgiowish' failed
| make[3]: *** [src/cgnstools/cgnsview/cgiowish] Error 1
| make[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
| CMakeFiles/Makefile2:2735: recipe for target 'src/cgnstools/cgnsview/CMakeFiles/cgiowish.dir/all' failed
| make[2]: *** [src/cgnstools/cgnsview/CMakeFiles/cgiowish.dir/all] Error 2
| make[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
| Makefile:165: recipe for target 'all' failed
| make[1]: *** [all] Error 2
| make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
| dh_auto_build: cd obj-x86_64-linux-gnu && make -j1 returned exit code 2
| debian/rules:20: recipe for target 'build-arch' failed
| make: *** [build-arch] Error 2
| dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2

A full build logs is available there:
http://aws-logs.debian.net/2018/02/07/glibc-exp/libcgns_3.3.0-5_unstable_glibc-exp.log

Starting with glibc 2.27, support for matherr (part of SVID
specification) has been removed, causing this FTBFS. It is only used in
libcgns as a workaround for Sun shared libraries. The best way to fix
this FTBFS for Debian is therefore to just disable that part. This is
what the attached patch does.
-------------- next part --------------
diff -Nru libcgns-3.3.0/debian/patches/no-matherr.patch libcgns-3.3.0/debian/patches/no-matherr.patch
--- libcgns-3.3.0/debian/patches/no-matherr.patch
+++ libcgns-3.3.0/debian/patches/no-matherr.patch
@@ -0,0 +1,58 @@
+Description: Remove matherr hack
+ Remove matherr hack, that is only needed for Sun shared libraries and
+ causes an FTBFS with glibc 2.27 onwards, as SVID error handling has
+ been removed.
+Author: Aurelien Jarno <aurel32 at debian.org>
+Last-Update: 2018-02-12
+
+--- libcgns-3.3.0.orig/src/cgnstools/cgnscalc/calcwish.c
++++ libcgns-3.3.0/src/cgnstools/cgnscalc/calcwish.c
+@@ -15,14 +15,6 @@
+ #include "tk.h"
+ #include "locale.h"
+ 
+-/*
+- * The following variable is a special hack that is needed in order for
+- * Sun shared libraries to be used for Tcl.
+- */
+-
+-extern int matherr();
+-int *tclDummyMathPtr = (int *) matherr;
+-
+ #ifdef TK_TEST
+ extern int		Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
+ extern int		Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
+--- libcgns-3.3.0.orig/src/cgnstools/cgnsplot/plotwish.c
++++ libcgns-3.3.0/src/cgnstools/cgnsplot/plotwish.c
+@@ -15,14 +15,6 @@
+ #include "tk.h"
+ #include "locale.h"
+ 
+-/*
+- * The following variable is a special hack that is needed in order for
+- * Sun shared libraries to be used for Tcl.
+- */
+-
+-extern int matherr();
+-int *tclDummyMathPtr = (int *) matherr;
+-
+ extern int Cgnstcl_Init _ANSI_ARGS_((Tcl_Interp *interp));
+ extern int Tkogl_Init _ANSI_ARGS_((Tcl_Interp *interp));
+ 
+--- libcgns-3.3.0.orig/src/cgnstools/cgnsview/cgiowish.c
++++ libcgns-3.3.0/src/cgnstools/cgnsview/cgiowish.c
+@@ -15,14 +15,6 @@
+ #include "tk.h"
+ #include "locale.h"
+ 
+-/*
+- * The following variable is a special hack that is needed in order for
+- * Sun shared libraries to be used for Tcl.
+- */
+-
+-extern int matherr();
+-int *tclDummyMathPtr = (int *) matherr;
+-
+ #ifdef TK_TEST
+ extern int		Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
+ extern int		Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
diff -Nru libcgns-3.3.0/debian/patches/series libcgns-3.3.0/debian/patches/series
--- libcgns-3.3.0/debian/patches/series
+++ libcgns-3.3.0/debian/patches/series
@@ -2,3 +2,4 @@
 cgnstools-path.patch
 fix-p3dfout.patch
 no-rpath.patch
+no-matherr.patch


More information about the debian-science-maintainers mailing list