]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sysinfo: add Flags to Statfs_t if not already there
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2019 20:49:21 +0000 (20:49 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2019 20:49:21 +0000 (20:49 +0000)
    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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269401 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/MERGE
libgo/mksysinfo.sh

index de7a3e10074125e83f99fdb61b59cff9d9e2310f..b80033039df30be110ec4ba0365e98fb98331746 100644 (file)
@@ -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.
index 1273d9b26aee85f72d4cddc3c502bfebc3497bd4..e0ae30f6ba2deac3a5dbd985d6034b270664bb04 100755 (executable)
@@ -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