OSDN Git Service

mksysinfo: Fix syscall.F_GETLK and friends for 32-bit x86.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2012 05:29:43 +0000 (05:29 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2012 05:29:43 +0000 (05:29 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@190555 138bc75d-0d04-0410-961f-82ee72b054a4

libgo/mksysinfo.sh

index 3955344..315d60c 100755 (executable)
@@ -211,6 +211,16 @@ if ! grep '^const O_CLOEXEC' ${OUT} >/dev/null 2>&1; then
   echo "const O_CLOEXEC = 0" >> ${OUT}
 fi
 
+# These flags can be lost on i386 GNU/Linux when using
+# -D_FILE_OFFSET_BITS=64, because we see "#define F_SETLK F_SETLK64"
+# before we see the definition of F_SETLK64.
+for flag in F_GETLK F_SETLK F_SETLKW; do
+  if ! grep "^const ${flag} " ${OUT} >/dev/null 2>&1 \
+      && grep "^const ${flag}64 " ${OUT} >/dev/null 2>&1; then
+    echo "const ${flag} = ${flag}64" >> ${OUT}
+  fi
+done
+
 # The signal numbers.
 grep '^const _SIG[^_]' gen-sysinfo.go | \
   grep -v '^const _SIGEV_' | \