bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison testing on Solaris (with FAILURES)


From: Akim Demaille
Subject: Re: Bison testing on Solaris (with FAILURES)
Date: Thu, 25 Jul 2013 14:22:10 +0200

Le 3 juil. 2013 à 17:31, Akim Demaille <address@hidden> a écrit :

> Well I tried to fix the problem with the appended patch.
> Could you please try this tarball:
> 
> http://www.lrde.epita.fr/~akim/download/bison-2.7.91.3-8f9f.tar.xz
> 
> If the issue is not fixed with it (and I doubt it is), could you
> please try
> 
> http://www.lrde.epita.fr/~akim/download/bison-2.7.91.3-b717.tar.xz
> 
> which has a different approach?  Thanks in advance!

Well, I install the "different" approach, shown below.  I will release
3.0 now.

commit b7171c45f4eab4d06810d7e9617193cf62d08d38
Author: Akim Demaille <address@hidden>
Date:   Wed Jul 3 17:16:04 2013 +0200

    tests: skip C++ tests if we can't compile a simple program
    
    There are possible conflicts between gnulib replacement functions (in
    <stdio.h>) and their C++ wrappers (in <stream>).  Trying to address
    these in configure seems too hard, and I don't know how to fix the issue
    in gnulib.  Cowardly avoid the problem by skipping C++ tests when this
    happens.
    Reported by Stefano Lattarini.
    http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html
    
    * tests/atlocal.in (BISON_CXX_WORKS): Also set it to "skip" if we can't
    compile a simple program using <stream>.
    * tests/local.at: Comment changes.

diff --git a/tests/atlocal.in b/tests/atlocal.in
index 763ca90..19ecfd7 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -50,6 +50,37 @@ CXXFLAGS="$NO_WERROR_CXXFLAGS @WERROR_CXXFLAGS@"
 # If 'exit 77'; skip all C++ tests; otherwise ':'.
 BISON_CXX_WORKS='@BISON_CXX_WORKS@'
 
+# Be sure that the C++ compiler is not broken because of gnulib.  This
+# cannot be checked in configure (gnulib is not parameterized yet),
+# and checking this in every C++ test in AC_COMPILE_CXX is too costly.
+#
+# http://lists.gnu.org/archive/html/bug-bison/2013-06/msg00001.html
+#
+# FIXME: Check (say 2014) whether this is still needed.
+if $BISON_CXX_WORKS; then
+  # See AT_DATA_SOURCE_PROLOGUE.
+  cat >conftest.cc <<EOF
+#include <config.h>
+/* We don't need perfect functions for these tests. */
+#undef malloc
+#undef memcmp
+#undef realloc
+#include <iostream>
+
+int main ()
+{
+  std::cout << "Works" << std::endl;
+}
+EOF
+  ls
+  $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS -o conftest conftest.cc
+  case $? in
+   0);;
+   *) BISON_CXX_WORKS="as_fn_error 77 cannot-compile-simple-program";;
+  esac
+  rm -f conftest*
+fi
+
 # Whether the compiler supports POSIXLY_CORRECT defined.
 : ${C_COMPILER_POSIXLY_CORRECT='@C_COMPILER_POSIXLY_CORRECT@'}
 : ${CXX_COMPILER_POSIXLY_CORRECT='@CXX_COMPILER_POSIXLY_CORRECT@'}
diff --git a/tests/local.at b/tests/local.at
index e6afd36..7948faa 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -339,9 +339,9 @@ m4_define([AT_LANG_DISPATCH],
 
 
 # AT_DATA_SOURCE_PROLOGUE
-# ------------------------
+# -----------------------
 # The prologue that should be included in any source code that is
-# meant to be compiled.
+# meant to be compiled.  Keep atlocal.in sync (BISON_CXX_WORKS).
 m4_define([AT_DATA_SOURCE_PROLOGUE],
 [[#include <config.h>
 /* We don't need perfect functions for these tests. */
@@ -754,6 +754,7 @@ AT_CHECK(m4_join([ ],
                   [m4_bmatch([$1], [[.]], [], [$LIBS])]),
            0, [ignore], [ignore])])
 
+
 # AT_COMPILE_CXX(OUTPUT, [SOURCES = OUTPUT.cc])
 # ---------------------------------------------
 # Compile SOURCES into OUTPUT.  If the C++ compiler does not work,
@@ -761,7 +762,7 @@ AT_CHECK(m4_join([ ],
 #
 # If OUTPUT does not contain '.', assume that we are linking too,
 # otherwise pass "-c"; this is a hack.  The default SOURCES is OUTPUT
-# with trailing .o removed, and ".cc" appended.
+# with trailing ".o" removed, and ".cc" appended.
 m4_define([AT_COMPILE_CXX],
 [AT_KEYWORDS(c++)
 AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]