# DP: Fix GCC_LINUX_FUTEX to work with C99 compilers

config/

2019-09-06  Florian Weimer  <fweimer@redhat.com>

	* futex.m4 (GCC_LINUX_FUTEX): Include <unistd.h> for the syscall
	function.

libitm/ libgomp/ libstdc++-v3/

2019-09-06  Florian Weimer  <fweimer@redhat.com>

	* configure: Regenerate.
 
Index: b/src/config/futex.m4
===================================================================
--- a/src/config/futex.m4
+++ b/src/config/futex.m4
@@ -22,6 +22,7 @@ case "$target" in
 	AC_LINK_IFELSE(
 	 [AC_LANG_PROGRAM(
 	  [#include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;],
 	  [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],
 	  [save_LIBS="$LIBS"
@@ -48,6 +49,7 @@ If so, please configure with --disable-l
 	AC_LINK_IFELSE(
 	 [AC_LANG_PROGRAM(
 	  [#include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;],
 	  [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],[],
 	  [AC_MSG_ERROR([SYS_gettid and SYS_futex required for --enable-linux-futex])])
Index: b/src/libitm/configure
===================================================================
--- a/src/libitm/configure
+++ b/src/libitm/configure
@@ -16481,6 +16481,7 @@ case "$target" in
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;
 int
 main ()
@@ -16533,6 +16534,7 @@ rm -f core conftest.err conftest.$ac_obj
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;
 int
 main ()
Index: b/src/libgomp/configure
===================================================================
--- a/src/libgomp/configure
+++ b/src/libgomp/configure
@@ -793,6 +793,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -886,6 +887,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1138,6 +1140,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1275,7 +1286,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1428,6 +1439,7 @@ Fine tuning of the installation director
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -4581,8 +4593,9 @@ fi
 save_CFLAGS="$CFLAGS"
 
 # Add -Wall -Werror if we are using GCC.
+# FIXME: -Werror fails in the x32 multilib variant
 if test "x$GCC" = "xyes"; then
-  XCFLAGS="$XCFLAGS -Wall -Werror"
+  XCFLAGS="$XCFLAGS -Wall"
 fi
 
 # Find other programs we need.
@@ -11393,7 +11406,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11396 "configure"
+#line 11409 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11499,7 +11512,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11502 "configure"
+#line 11515 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15376,7 +15389,7 @@ fi
 
 # Plugins for offload execution, configure.ac fragment.  -*- mode: autoconf -*-
 #
-# Copyright (C) 2014-2018 Free Software Foundation, Inc.
+# Copyright (C) 2014-2019 Free Software Foundation, Inc.
 #
 # Contributed by Mentor Embedded.
 #
@@ -15824,8 +15837,7 @@ for ac_func in aligned_alloc posix_memal
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-eval as_val=\$$as_ac_var
-   if test "x$as_val" = x""yes; then :
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
@@ -15888,6 +15900,7 @@ case "$target" in
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;
 int
 main ()
@@ -15940,6 +15953,7 @@ rm -f core conftest.err conftest.$ac_obj
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;
 int
 main ()
Index: b/src/libstdc++-v3/configure
===================================================================
--- a/src/libstdc++-v3/configure
+++ b/src/libstdc++-v3/configure
@@ -78981,6 +78981,7 @@ fi
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;
 int
 main ()
@@ -79039,6 +79040,7 @@ fi
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/syscall.h>
+	   #include <unistd.h>
 	   int lk;
 int
 main ()
