aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-03-05 20:49:21 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-03-05 20:49:21 +0000
commit9bf54c938ab8ab79a92a5f354686e103d66f1a1a (patch)
tree2b08ccbd0c0053a1d141eb2a6fbaabff0883ad84
parent77fa4c4275502fb4a030db1799d82704395a03ab (diff)
downloadgcc-9bf54c938ab8ab79a92a5f354686e103d66f1a1a.zip
gcc-9bf54c938ab8ab79a92a5f354686e103d66f1a1a.tar.gz
gcc-9bf54c938ab8ab79a92a5f354686e103d66f1a1a.tar.bz2
sysinfo: add Flags to Statfs_t if not already there
If there is no f_flags field in statfs_t then rename one of the f_spare fields, as happened in Linux kernel version 2.6.36. This fixes the build on CentOS 5.11. The CentOS kernel will hopefully not fill in the f_spare field, so the resulting flags will be zero. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/165417 From-SVN: r269401
-rw-r--r--gcc/go/gofrontend/MERGE2
-rwxr-xr-xlibgo/mksysinfo.sh4
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index de7a3e1..b800330 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-689d5bda159300dc12f559de2d47b8c1c762fcb9
+3ae3024cae07fe7e85968ad2583add350616b296
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 1273d9b..e0ae30f 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -1113,7 +1113,11 @@ grep '^const _FALLOC_' gen-sysinfo.go |
# The statfs struct.
# Prefer largefile variant if available.
+# CentOS 5 does not have f_flags, so pull from f_spare.
statfs=`grep '^type _statfs64 ' gen-sysinfo.go || true`
+if ! echo "$statfs" | grep f_flags; then
+ statfs=`echo "$statfs" | sed -e 's/f_spare \[4+1\]\([^ ;]*\)/f_flags \1; f_spare [3+1]\1/'`
+fi
if test "$statfs" != ""; then
grep '^type _statfs64 ' gen-sysinfo.go
else