This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix GCC_LINUX_FUTEX to work with C99 compilers
- From: Florian Weimer <fweimer at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jeff Law <law at redhat dot com>, libstdc++ at gcc dot gnu dot org
- Date: Fri, 06 Sep 2019 10:57:06 +0200
- Subject: Fix GCC_LINUX_FUTEX to work with C99 compilers
Without this change, libstdc++ is built without futex symbols if GCC
rejects implicit function declarations in default mode.
Thanks,
Florian
config/ChangeLog:
2019-09-06 Florian Weimer <fweimer@redhat.com>
* futex.m4 (GCC_LINUX_FUTEX): Include <unistd.h> for the syscall
function.
libgomp/ChangeLog, libitm/ChangeLog, libstdc++-v3/ChangeLog:
2019-09-06 Florian Weimer <fweimer@redhat.com>
* configure: Regenerate.
Index: config/futex.m4
===================================================================
--- config/futex.m4 (revision 275450)
+++ config/futex.m4 (working copy)
@@ -22,6 +22,7 @@
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 @@
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: libgomp/configure
===================================================================
--- libgomp/configure (revision 275450)
+++ libgomp/configure (working copy)
@@ -15888,6 +15888,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/syscall.h>
+ #include <unistd.h>
int lk;
int
main ()
@@ -15940,6 +15941,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/syscall.h>
+ #include <unistd.h>
int lk;
int
main ()
Index: libitm/configure
===================================================================
--- libitm/configure (revision 275450)
+++ libitm/configure (working copy)
@@ -16481,6 +16481,7 @@
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 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/syscall.h>
+ #include <unistd.h>
int lk;
int
main ()
Index: libstdc++-v3/configure
===================================================================
--- libstdc++-v3/configure (revision 275450)
+++ libstdc++-v3/configure (working copy)
@@ -72670,6 +72670,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/syscall.h>
+ #include <unistd.h>
int lk;
int
main ()
@@ -72728,6 +72729,7 @@
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/syscall.h>
+ #include <unistd.h>
int lk;
int
main ()