[Patch,MIPS] Add default SYS_futex definition in libgomp

2014-11-21 Thread Steve Ellcey
Here is another patch for the MIPS android build.  It is in the libgomp
subdirectory and it has been in the Android tree for a while but I would
like to check it in to the official GCC tree so we do not need to keep
porting it to new versions of GCC.

This patch defines SYS_futex if it is not already defined and the same type
of define is already in the x86 and alpha futex.h header files in libgomp.

Tested on mips-mti-linux-gnu and mips android builds.  OK for checkin?
Since this is bug fix (inability to build on android) I think it qualifies
under the stage 3 rules.

Steve Ellcey
sell...@imgtec.com


2014-11-21  Steve Ellcey  sell...@imgtec.com

* config/linux/mips/futex.h (SYS_futex): Define if not already done.


diff --git a/libgomp/config/linux/mips/futex.h 
b/libgomp/config/linux/mips/futex.h
index ae32b80..641308c 100644
--- a/libgomp/config/linux/mips/futex.h
+++ b/libgomp/config/linux/mips/futex.h
@@ -25,6 +25,11 @@
 /* Provide target-specific access to the futex system call.  */
 
 #include sys/syscall.h
+
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
+
 #define FUTEX_WAIT 0
 #define FUTEX_WAKE 1
 


Re: [Patch,MIPS] Add default SYS_futex definition in libgomp

2014-11-21 Thread Jakub Jelinek
On Fri, Nov 21, 2014 at 02:30:06PM -0800, Steve Ellcey  wrote:
 2014-11-21  Steve Ellcey  sell...@imgtec.com
 
   * config/linux/mips/futex.h (SYS_futex): Define if not already done.

Ok.

 --- a/libgomp/config/linux/mips/futex.h
 +++ b/libgomp/config/linux/mips/futex.h
 @@ -25,6 +25,11 @@
  /* Provide target-specific access to the futex system call.  */
  
  #include sys/syscall.h
 +
 +#if !defined(SYS_futex)
 +#define SYS_futex __NR_futex
 +#endif
 +
  #define FUTEX_WAIT 0
  #define FUTEX_WAKE 1
  

Jakub