Re: [PPL-devel] Parma Polyhedra Library 0.11.1

On 02/22/2011 06:04 AM, Dongsheng Song wrote:
When I build on i686-w64-mingw32 target:
libtool: compile: i686-w64-mingw32-g++ -DHAVE_CONFIG_H -I. -I/home/oracle/src/ppl-0.11.1/src -I.. -I.. -I/home/oracle/src/ppl-0.11.1/src -I/home/oracle/tmp/gcc-4.5-windows-obj/misc//include -g -O2 -frounding-math -march=x86-64 -O2 -flto -pipe -D_WIN32 -W -Wall -MT fpu-ia32.lo -MD -MP -MF .deps/fpu-ia32.Tpo -c /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc -DDLL_EXPORT -DPIC -o .libs/fpu-ia32.o /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc: In function 'void Parma_Polyhedra_Library::detect_sse_unit()': /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc:52:7: error: 'NULL' was not declared in this scope make[3]: *** [fpu-ia32.lo] Error 1 make[3]: Leaving directory `/tmp/x/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/tmp/x/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/x' make: *** [all] Error 2
Here is my patch:
$ git diff src/fpu-ia32.cc diff --git a/src/fpu-ia32.cc b/src/fpu-ia32.cc index d361411..8a2a6a2 100644 --- a/src/fpu-ia32.cc +++ b/src/fpu-ia32.cc @@ -30,6 +30,7 @@ site: http://www.cs.unipr.it/ppl/ . */ #include "fpu.defs.hh" #include<csetjmp> #include<csignal> +#include<cstddef>
namespace {
Hi Dongsheng,
I don't see any occurrences of NULL in fpu-ia32.cc. Perhaps this is a bug in the <csetjmp> or related header file in your system?
And I'm doubt the assumption GMP does not support exception when cross compiling:
$ git diff m4/ac_check_gmp.m4 diff --git a/m4/ac_check_gmp.m4 b/m4/ac_check_gmp.m4 index c5dd1c9..8c2af74 100644 --- a/m4/ac_check_gmp.m4 +++ b/m4/ac_check_gmp.m4 @@ -181,8 +181,8 @@ int main() { ac_cv_gmp_supports_exceptions=yes, AC_MSG_RESULT(no) ac_cv_gmp_supports_exceptions=no,
- AC_MSG_RESULT([assuming not])
- ac_cv_gmp_supports_exceptions=no)
AC_MSG_RESULT([assuming yes])
ac_cv_gmp_supports_exceptions=yes)
gmp_supports_exceptions=${ac_cv_gmp_supports_exceptions} if test x"$gmp_supports_exceptions" = xyes
How does this affect you? I mean, that setting only affects the PPL testsuite and if you are cross-compiling you are not using it. All the best,
Roberto

On Tue, Feb 22, 2011 at 17:05, Roberto Bagnara bagnara@cs.unipr.it wrote:
And I'm doubt the assumption GMP does not support exception when cross compiling:
$ git diff m4/ac_check_gmp.m4 diff --git a/m4/ac_check_gmp.m4 b/m4/ac_check_gmp.m4 index c5dd1c9..8c2af74 100644 --- a/m4/ac_check_gmp.m4 +++ b/m4/ac_check_gmp.m4 @@ -181,8 +181,8 @@ int main() { ac_cv_gmp_supports_exceptions=yes, AC_MSG_RESULT(no) ac_cv_gmp_supports_exceptions=no,
- AC_MSG_RESULT([assuming not])
- ac_cv_gmp_supports_exceptions=no)
- AC_MSG_RESULT([assuming yes])
- ac_cv_gmp_supports_exceptions=yes)
gmp_supports_exceptions=${ac_cv_gmp_supports_exceptions} if test x"$gmp_supports_exceptions" = xyes
How does this affect you? I mean, that setting only affects the PPL testsuite and if you are cross-compiling you are not using it.
But after the configure script done, I got the following warning:
... config.status: executing libtool commands configure: WARNING: CANNOT PROPAGATE EXCEPTIONS BACK FROM GMP: *** MEMORY EXHAUSTION MAY RESULT IN ABRUPT TERMINATION. *** This is OK, if you do not plan to use the bounded memory capabilities *** offered by the PPL. Otherwise, if you are using GCC or the Intel C/C++ *** compiler, please make sure you use a version of GMP compiled with the *** `-fexceptions' compiler option. *** To build such a version, you can configure GMP as follows: *** CPPFLAGS=-fexceptions ./configure --enable-cxx --prefix=/usr/local
Since the most gcc distro already support exceptions at default, so I think we had better assume gmp support exceptions at default.
-- Dongsheng

On Tue, Feb 22, 2011 at 17:05, Roberto Bagnara bagnara@cs.unipr.it wrote:
On 02/22/2011 06:04 AM, Dongsheng Song wrote:
When I build on i686-w64-mingw32 target:
libtool: compile: i686-w64-mingw32-g++ -DHAVE_CONFIG_H -I. -I/home/oracle/src/ppl-0.11.1/src -I.. -I.. -I/home/oracle/src/ppl-0.11.1/src -I/home/oracle/tmp/gcc-4.5-windows-obj/misc//include -g -O2 -frounding-math -march=x86-64 -O2 -flto -pipe -D_WIN32 -W -Wall -MT fpu-ia32.lo -MD -MP -MF .deps/fpu-ia32.Tpo -c /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc -DDLL_EXPORT -DPIC -o .libs/fpu-ia32.o /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc: In function 'void Parma_Polyhedra_Library::detect_sse_unit()': /home/oracle/src/ppl-0.11.1/src/fpu-ia32.cc:52:7: error: 'NULL' was not declared in this scope make[3]: *** [fpu-ia32.lo] Error 1 make[3]: Leaving directory `/tmp/x/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/tmp/x/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/tmp/x' make: *** [all] Error 2
Here is my patch:
$ git diff src/fpu-ia32.cc diff --git a/src/fpu-ia32.cc b/src/fpu-ia32.cc index d361411..8a2a6a2 100644 --- a/src/fpu-ia32.cc +++ b/src/fpu-ia32.cc @@ -30,6 +30,7 @@ site: http://www.cs.unipr.it/ppl/ . */ #include "fpu.defs.hh" #include<csetjmp> #include<csignal> +#include<cstddef>
namespace {
Hi Dongsheng,
I don't see any occurrences of NULL in fpu-ia32.cc. Perhaps this is a bug in the <csetjmp> or related header file in your system?
When I use gcc 4.5 (version 4.5.3 20110221) with mingw-w64 trunk, after preprocessing, setjmp(env) extend to _setjmp3((env), NULL) .
When I use gcc 4.6 (version 4.6.0 20110221) with mingw-w64 trunk, after preprocessing, setjmp(env) extend to _setjmp3((env), __null) .
So gcc 4.5 run into trouble, but gcc 4.6 OK. I don't know why and how to fix in GCC or mingw-w64, but just add one line '#include<cstddef>' in the source is the simplest way.
-- Dongsheng
participants (2)
-
Dongsheng Song
-
Roberto Bagnara