Source: libamplsolver
Version: 0~20190702-2
Severity: serious
Tags: patch upstream ftbfs
Justification: fails to build from source (but built successfully in the past)
User: debian-ri...@lists.debian.org
Usertags: riscv64

Dear maintainer,

libamplsolver fails to build from source on a few architectures that call
fedisableexcept(), which from a quick look seems to be !x86 !arm !alpha:

| make[1]: Entering directory '/<<PKGBUILDDIR>>'
| cd ${OBJDIR=sys.`uname -m`.`uname -s`}; make
| make[2]: Entering directory '/<<PKGBUILDDIR>>/sys.riscv64.Linux'
| make[2]: warning: jobserver unavailable: using -j1.  Add '+' to parent make 
rule.
| cc -c -g -O2 -Werror=implicit-function-declaration 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -pipe -DASL_BUILD -fPIC -DPIC -DASL_NO_FPINITMT fpinit.c
| fpinit.c: In function ‘fpinit_ASL’:
| fpinit.c:143:9: error: implicit declaration of function ‘fedisableexcept’; 
did you mean ‘feraiseexcept’? [-Werror=implicit-function-declaration]
|   143 |         fedisableexcept(FE_ALL_EXCEPT);
|       |         ^~~~~~~~~~~~~~~
|       |         feraiseexcept
| cc1: some warnings being treated as errors
| make[2]: *** [makefile:240: arith.h] Error 1
| make[2]: Leaving directory '/<<PKGBUILDDIR>>/sys.riscv64.Linux'
| make[1]: *** [makefile:2: amplsolver] Error 2
| make[1]: Leaving directory '/<<PKGBUILDDIR>>'
| dh_auto_build: error: make -j4 returned exit code 2
| make: *** [debian/rules:15: binary-arch] Error 25
| dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit 
status 2

A full build log is available there:
https://buildd.debian.org/status/fetch.php?pkg=libamplsolver&arch=riscv64&ver=0%7E20190702-2%2Bb2&stamp=1715411707&raw=0

The problem has been introduced with dpkg 1.22.5, which changed the
build flags to include -Werror=implicit-function-declaration as part of
the time_t transition. fedisableexcept() is a GNU extension, so it has
to be enabled by building with -D_GNU_SOURCE. The patch belows implement
that.

Regards
Aurelien


--- libamplsolver-0~20190702.orig/fpinit.c
+++ libamplsolver-0~20190702/fpinit.c
@@ -49,6 +49,7 @@ int isatty_ASL; /* for use with "sw" und
 #undef WIN32
 #define WIN32
 #else
+#define _GNU_SOURCE /* needed for fedisableexcept */
 #include "fenv.h"
 #endif

--- libamplsolver-0~20190702.orig/solvers/fpinit.c
+++ libamplsolver-0~20190702/solvers/fpinit.c
@@ -49,6 +49,7 @@ int isatty_ASL; /* for use with "sw" und
 #undef WIN32
 #define WIN32
 #else
+#define _GNU_SOURCE /* needed for fedisableexcept */
 #include "fenv.h"
 #endif

Reply via email to