On 2016-07-14 09:28, Lucas Nussbaum wrote:
> Source: torcs
> Version: 1.3.3+dfsg-0.3
> Severity: serious
> Tags: stretch sid
> User: debian...@lists.debian.org
> Usertags: qa-ftbfs-20160713 qa-ftbfs
> Justification: FTBFS with GCC 6 on amd64
> 
> Hi,
> 
> During a rebuild of all packages in sid using the gcc-defaults package
> available in experimental to make GCC default to version 6, your package 
> failed
> to build on amd64. For more information about GCC 6 and Stretch, see:
> - https://wiki.debian.org/GCC6
> - https://lists.debian.org/debian-devel-announce/2016/06/msg00007.html
> 
> Relevant part (hopefully):
> > g++ -I/«BUILDDIR»/torcs-1.3.3+dfsg/export/include 
> > -I/«BUILDDIR»/torcs-1.3.3+dfsg -g -O2 -fstack-protector-strong -Wformat 
> > -Werror=format-security -Wall -fPIC -fno-strict-aliasing -O2 
> > -DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES -Wall -fPIC -fno-strict-aliasing -O2 
> > -DUSE_RANDR_EXT -DGL_GLEXT_PROTOTYPES -Wdate-time -D_FORTIFY_SOURCE=2 
> > -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DHAVE_CONFIG_H  -c geometry.cpp
> > In file included from 
> > /usr/include/x86_64-linux-gnu/c++/6/bits/os_defines.h:39:0,
> >                  from 
> > /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h:495,
> >                  from /usr/include/c++/6/bits/stl_algobase.h:59,
> >                  from /usr/include/c++/6/vector:60,
> >                  from geometry.h:24,
> >                  from geometry.cpp:21:
> > /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and 
> > _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
> >  # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use 
> > _DEFAULT_SOURCE"
> >    ^~~~~~~
> > geometry.cpp: In function 'void EstimateSphere(std::vector<Vector>, 
> > ParametricSphere*)':
> > geometry.cpp:373:15: error: 'isnan' was not declared in this scope
> >     if (isnan(r)) {
> >                ^
> > geometry.cpp:373:15: note: suggested alternative:
> > In file included from geometry.cpp:23:0:
> > /usr/include/c++/6/cmath:655:5: note:   'std::isnan'
> >      isnan(_Tp __x)
> >      ^~~~~
> > make[5]: *** [geometry.o] Error 1
> 
> The full build log is available from:
>    
> http://people.debian.org/~lucas/logs/2016/07/13/torcs_1.3.3+dfsg-0.3_unstable_gcc6.log
> 

As the package has been removed from stretch, I have just done an NMU to
fix the issue. Please find the diff attached.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                 http://www.aurel32.net
diff -Nru torcs-1.3.3+dfsg/debian/changelog torcs-1.3.3+dfsg/debian/changelog
--- torcs-1.3.3+dfsg/debian/changelog	2016-07-11 14:27:24.000000000 +0000
+++ torcs-1.3.3+dfsg/debian/changelog	2016-07-27 22:05:13.000000000 +0000
@@ -1,3 +1,15 @@
+torcs (1.3.3+dfsg-0.4) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Replace fix-ftbfs-glib.patch by 0003-fix-glibc-isnan-isinf.patch: better
+    patch to fix the build failure with glibc 2.23.
+  * Add 0004-fix-gcc6-isnan.patch: fix the build failure with GCC 6 (Closes:
+    #831201).
+  * Add 0005-fix-glibc-default-source.patch: kill deprecation warnings when
+    building with glibc >= 2.23.
+
+ -- Aurelien Jarno <aure...@debian.org>  Wed, 27 Jul 2016 22:05:12 +0000
+
 torcs (1.3.3+dfsg-0.3) unstable; urgency=medium
 
   * d/p/fix-ftbfs-glib.patch: Fix build failure
diff -Nru torcs-1.3.3+dfsg/debian/patches/0003-fix-glibc-isnan-isinf.patch torcs-1.3.3+dfsg/debian/patches/0003-fix-glibc-isnan-isinf.patch
--- torcs-1.3.3+dfsg/debian/patches/0003-fix-glibc-isnan-isinf.patch	1970-01-01 00:00:00.000000000 +0000
+++ torcs-1.3.3+dfsg/debian/patches/0003-fix-glibc-isnan-isinf.patch	2016-07-27 22:00:27.000000000 +0000
@@ -0,0 +1,23 @@
+From: Aurelien Jarno <aurel...@aurel32.net> 
+Date: Wed, 27 Jul 2016 23:57:49 +0200
+Subject: fix is isnan/isinf on an integer value.
+
+car->ctrl->gear is defined as int, therefore it can never be infinite or
+NaN. Just drop the tests.
+
+--- torcs-1.3.3+dfsg.orig/src/modules/simu/simuv2/simu.cpp
++++ torcs-1.3.3+dfsg/src/modules/simu/simuv2/simu.cpp
+@@ -61,13 +61,11 @@ ctrlCheck(tCar *car)
+     if (isnan(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
+     if (isnan(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
+     if (isnan(car->ctrl->steer)) car->ctrl->steer = 0;
+-    if (isnan(car->ctrl->gear)) car->ctrl->gear = 0;
+ #else
+     if (isnan(car->ctrl->accelCmd) || isinf(car->ctrl->accelCmd)) car->ctrl->accelCmd = 0;
+     if (isnan(car->ctrl->brakeCmd) || isinf(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
+     if (isnan(car->ctrl->clutchCmd) || isinf(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
+     if (isnan(car->ctrl->steer) || isinf(car->ctrl->steer)) car->ctrl->steer = 0;
+-    if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
+ #endif
+ 
+     /* When the car is broken try to send it on the track side */
diff -Nru torcs-1.3.3+dfsg/debian/patches/0004-fix-gcc6-isnan.patch torcs-1.3.3+dfsg/debian/patches/0004-fix-gcc6-isnan.patch
--- torcs-1.3.3+dfsg/debian/patches/0004-fix-gcc6-isnan.patch	1970-01-01 00:00:00.000000000 +0000
+++ torcs-1.3.3+dfsg/debian/patches/0004-fix-gcc6-isnan.patch	2016-07-27 22:01:22.000000000 +0000
@@ -0,0 +1,15 @@
+From: Aurelien Jarno <aurel...@aurel32.net> 
+Date: Thu, 28 Jul 2016 00:00:42 +0200 
+Subject: fix is isnan with gcc 6
+
+--- torcs-1.3.3+dfsg.orig/src/drivers/olethros/geometry.cpp
++++ torcs-1.3.3+dfsg/src/drivers/olethros/geometry.cpp
+@@ -370,7 +370,7 @@ void EstimateSphere (std::vector<Vector>
+ 				}
+ 				delta_total += delta;
+ 			}
+-			if (isnan(r)) {
++			if (std::isnan(r)) {
+ 				for (i=0; i<d; i++) {
+ 					center[i] =  ((*(sphere->C))[i] - mean[i]) / scale;
+ 				}
diff -Nru torcs-1.3.3+dfsg/debian/patches/0005-fix-glibc-default-source.patch torcs-1.3.3+dfsg/debian/patches/0005-fix-glibc-default-source.patch
--- torcs-1.3.3+dfsg/debian/patches/0005-fix-glibc-default-source.patch	1970-01-01 00:00:00.000000000 +0000
+++ torcs-1.3.3+dfsg/debian/patches/0005-fix-glibc-default-source.patch	2016-07-27 22:22:22.000000000 +0000
@@ -0,0 +1,18 @@
+From: Aurelien Jarno <aurel...@aurel32.net> 
+Date: Thu, 28 Jul 2016 00:01:33 +0200 
+Subject: kill deprecation warnings with glibc >= 2.23
+
+_SVID_SOURCE and _BSD_SOURCE are deprecated, using _DEFAULT_SOURCE
+instead.
+
+--- torcs-1.3.3+dfsg.orig/Make-config.in
++++ torcs-1.3.3+dfsg/Make-config.in
+@@ -48,7 +48,7 @@ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ 
+-CFLAGSD = -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DHAVE_CONFIG_H
++CFLAGSD = -D_DEFAULT_SOURCE -DSHM -DHAVE_CONFIG_H
+ CXXFLAGS =  @CXXFLAGS@ @CPPFLAGS@ ${CFLAGSD}
+ CFLAGS   =  @CFLAGS@ ${CFLAGSD}
+
diff -Nru torcs-1.3.3+dfsg/debian/patches/fix-ftbfs-glib.patch torcs-1.3.3+dfsg/debian/patches/fix-ftbfs-glib.patch
--- torcs-1.3.3+dfsg/debian/patches/fix-ftbfs-glib.patch	2016-04-29 13:49:13.000000000 +0000
+++ torcs-1.3.3+dfsg/debian/patches/fix-ftbfs-glib.patch	1970-01-01 00:00:00.000000000 +0000
@@ -1,15 +0,0 @@
-Description: fix build failure with glib 2.23
-
-Author: Gianfranco Costamagna
-
---- torcs-1.3.3+dfsg.orig/src/modules/simu/simuv2/simu.cpp
-+++ torcs-1.3.3+dfsg/src/modules/simu/simuv2/simu.cpp
-@@ -67,7 +67,7 @@ ctrlCheck(tCar *car)
-     if (isnan(car->ctrl->brakeCmd) || isinf(car->ctrl->brakeCmd)) car->ctrl->brakeCmd = 0;
-     if (isnan(car->ctrl->clutchCmd) || isinf(car->ctrl->clutchCmd)) car->ctrl->clutchCmd = 0;
-     if (isnan(car->ctrl->steer) || isinf(car->ctrl->steer)) car->ctrl->steer = 0;
--    if (isnan(car->ctrl->gear) || isinf(car->ctrl->gear)) car->ctrl->gear = 0;
-+    if (isnan((double)car->ctrl->gear) || isinf((double)car->ctrl->gear)) car->ctrl->gear = 0;
- #endif
- 
-     /* When the car is broken try to send it on the track side */
diff -Nru torcs-1.3.3+dfsg/debian/patches/series torcs-1.3.3+dfsg/debian/patches/series
--- torcs-1.3.3+dfsg/debian/patches/series	2016-04-29 13:44:18.000000000 +0000
+++ torcs-1.3.3+dfsg/debian/patches/series	2016-07-27 22:02:36.000000000 +0000
@@ -1,3 +1,5 @@
 0001-add-format-argument.patch
 0002-fix-as-needed-build.patch
-fix-ftbfs-glib.patch
+0003-fix-glibc-isnan-isinf.patch
+0004-fix-gcc6-isnan.patch
+0005-fix-glibc-default-source.patch

Reply via email to