Merge pull request #1327 from tehnick/gcc6-related-fixes

Gcc6 related fixes
This commit is contained in:
Tony Theodore 2016-05-07 14:43:18 +10:00
commit a742eed04a
7 changed files with 122 additions and 12 deletions

View File

@ -33,24 +33,24 @@ or using above mentioned workaround. See the table below for details. If some
MXE packages or your personal projects are still FTBFS you may look how other
packages were fixed and use similar approach.
Please ensure that proposed fixes for packages [also build with earlier GCC
versions](https://github.com/mxe/mxe/commit/a1cc019).
Please ensure that proposed fixes for packages also build with earlier GCC
versions [[4](https://github.com/mxe/mxe/commit/a1cc019)].
| package | target | fixed in commit |
| ------------------ | --------------------------------------- | ---------------------------------------------------- |
| boost | all | [7ca2bce](https://github.com/mxe/mxe/commit/7ca2bce) |
| cgal | all | - |
| dcmtk | static (all) | - |
| fdk-aac | all | - |
| flann | all | - |
| freeimage | static (all) | - |
| dcmtk | static (all) | [8608e13](https://github.com/mxe/mxe/commit/8608e13) |
| fdk-aac | all | [363aec7](https://github.com/mxe/mxe/commit/363aec7) |
| flann | all | [73cd813](https://github.com/mxe/mxe/commit/73cd813) |
| freeimage | static (all) | [adc74c9](https://github.com/mxe/mxe/commit/adc74c9) |
| glib | all | [58c2c96](https://github.com/mxe/mxe/commit/58c2c96) |
| gtkimageview | static (all) | - |
| gtkmm2 | static (all) | - |
| gtkmm3 | static (all) | - |
| guile | i686-w64-mingw32.static (all) | - |
| itk | all | - |
| jsoncpp | all | [a1cc019](https://github.com/mxe/mxe/commit/a1cc019) |
| jsoncpp | all | [0bc73f7](https://github.com/mxe/mxe/commit/0bc73f7) |
| json_spirit | all | - |
| librsvg | all | - |
| libxml++ | all | - |
@ -59,7 +59,7 @@ versions](https://github.com/mxe/mxe/commit/a1cc019).
| opencv | all | - |
| ossim | all | - |
| qt | all | [5aac1c3](https://github.com/mxe/mxe/commit/5aac1c3) |
| qt3d | all | - |
| qt3d | all | [d52961f](https://github.com/mxe/mxe/commit/d52961f) |
| qtwebkit | i686-w64-mingw32.shared | - |
| sdl_sound | static (all) | - |
| smpeg | all | [57cb6bb](https://github.com/mxe/mxe/commit/57cb6bb) |
@ -67,4 +67,4 @@ versions](https://github.com/mxe/mxe/commit/a1cc019).
| ucl | all | - |
| vtk | static (all) | - |
| vtk6 | all | - |
| wxwidgets | static (all) | - |
| wxwidgets | static (all) | [6869e3b](https://github.com/mxe/mxe/commit/6869e3b) |

View File

@ -0,0 +1,16 @@
From: Boris Pek
Date: Thu, 05 May 2016 15:38:47 +0300
Subject: [PATCH] fix build with GCC >= 6.x
diff --git a/ofstd/libsrc/ofstd.cc b/ofstd/libsrc/ofstd.cc
--- a/ofstd/libsrc/ofstd.cc
+++ b/ofstd/libsrc/ofstd.cc
@@ -175,7 +175,7 @@
// some systems don't properly define isnan()
-#ifdef HAVE_ISNAN
+#if defined(HAVE_ISNAN) && (__cplusplus < 201103L)
#ifndef HAVE_PROTOTYPE_ISNAN
extern "C"
{

View File

@ -22,7 +22,8 @@ endef
define $(PKG)_BUILD
cd '$(1)' && ./configure \
$(MXE_CONFIGURE_OPTS)
$(MXE_CONFIGURE_OPTS) \
CXXFLAGS='-Wno-narrowing'
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install
endef

View File

@ -0,0 +1,31 @@
This file is part of MXE.
See index.html for further information.
Taken from: https://github.com/mariusmuja/flann/commit/3645f0c30a47267e56e5acdecfc7bac2b76bc3d5
From 3645f0c30a47267e56e5acdecfc7bac2b76bc3d5 Mon Sep 17 00:00:00 2001
From: Alastair Quadros <alastair.j.quadros@gmail.com>
Date: Sun, 15 Mar 2015 10:58:57 +1100
Subject: [PATCH] abs -> std::abs
diff --git a/src/cpp/flann/algorithms/kdtree_index.h b/src/cpp/flann/algorithms/kdtree_index.h
index 42659ca..fc12d8f 100644
--- a/src/cpp/flann/algorithms/kdtree_index.h
+++ b/src/cpp/flann/algorithms/kdtree_index.h
@@ -36,6 +36,7 @@
#include <cassert>
#include <cstring>
#include <stdarg.h>
+#include <cmath>
#include "flann/general.h"
#include "flann/algorithms/nn_index.h"
@@ -663,7 +664,7 @@
ElementType max_span = 0;
size_t div_feat = 0;
for (size_t i=0;i<veclen_;++i) {
- ElementType span = abs(point[i]-leaf_point[i]);
+ ElementType span = std::abs(point[i]-leaf_point[i]);
if (span > max_span) {
max_span = span;
div_feat = i;

View File

@ -76,3 +76,23 @@ index 1111111..2222222 100644
CXXFLAGS += $(INCLUDE)
ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Pek <tehnick-8@mail.ru>
Date: Wed, 04 May 2016 18:43:16 +0300
Subject: [PATCH] fix build with GCC >= 6.x
diff --git a/Makefile.mingw b/Makefile.mingw
index 1111111..2222222 100644
--- a/Makefile.mingw
+++ b/Makefile.mingw
@@ -67,7 +67,7 @@ MODULES := $(MODULES:.cpp=.o)
RESOURCE = $(RCFILE:.rc=.coff)
CFLAGS ?= -O3 -fexceptions -DNDEBUG $(WIN32_CFLAGS)
CFLAGS += $(INCLUDE)
-CXXFLAGS ?= -O3 -fexceptions -Wno-ctor-dtor-privacy -DNDEBUG $(WIN32_CXXFLAGS)
+CXXFLAGS ?= -O3 -fexceptions -Wno-ctor-dtor-privacy -Wno-narrowing -DNDEBUG $(WIN32_CXXFLAGS)
CXXFLAGS += $(INCLUDE)
RCFLAGS ?= -DNDEBUG
LDFLAGS ?= -s -shared -static -Wl,-soname,$(SOLIBNAME) $(WIN32_LDFLAGS)

View File

@ -33,6 +33,21 @@ index cb5f1d1..8d2be9b 100644
CONFIG += dll
}
--
1.8.4.5
From: Boris Pek <tehnick-8@mail.ru>
Date: Wed, 04 May 2016 11:41:04 +0300
Subject: [PATCH] fix build with GCC >= 6.x
diff --git a/3rdparty/assimp/code/DXFLoader.cpp b/3rdparty/assimp/code/DXFLoader.cpp
index e372d60..2c1a13d 100644
--- a/3rdparty/assimp/code/DXFLoader.cpp
+++ b/3rdparty/assimp/code/DXFLoader.cpp
@@ -84,7 +84,7 @@
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
-DXFImporter::DXFImporter() : buffer(0), groupCode(0), bRepeat(false), mDefaultLayer(false)
+DXFImporter::DXFImporter() : buffer(0), groupCode(0), bRepeat(false)
{
memset(cursor,0,sizeof(cursor));
}

View File

@ -0,0 +1,27 @@
From: Boris Pek <tehnick-8@mail.ru>
Date: Thu, 05 May 2016 19:11:19 +0300
Subject: [PATCH] fix build with GCC >= 6.x
diff --git a/src/stc/scintilla/src/Editor.cxx b/src/stc/scintilla/src/Editor.cxx
--- a/src/stc/scintilla/src/Editor.cxx
+++ b/src/stc/scintilla/src/Editor.cxx
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <ctype.h>
#include <assert.h>
+#include <math.h>
#include <string>
#include <vector>
@@ -5841,9 +5842,9 @@
}
static bool Close(Point pt1, Point pt2) {
- if (abs(pt1.x - pt2.x) > 3)
+ if (fabs(pt1.x - pt2.x) > 3)
return false;
- if (abs(pt1.y - pt2.y) > 3)
+ if (fabs(pt1.y - pt2.y) > 3)
return false;
return true;
}