|
|
bdc76f |
commit 48c3c1238925410b4e777dc94e2fde4cc9132d44
|
|
|
bdc76f |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
bdc76f |
Date: Fri Jun 14 16:28:41 2019 +0200
|
|
|
bdc76f |
|
|
|
bdc76f |
Linux: Fix __glibc_has_include use for <sys/stat.h> and statx
|
|
|
bdc76f |
|
|
|
bdc76f |
The identifier linux is used as a predefined macro, so the actually
|
|
|
bdc76f |
used path is 1/stat.h or 1/stat64.h. Using the quote-based version
|
|
|
bdc76f |
triggers a file lookup for /usr/include/bits/linux/stat.h (or whatever
|
|
|
bdc76f |
directory is used to store bits/statx.h), but since bits/ is pretty
|
|
|
bdc76f |
much reserved by glibc, this appears to be acceptable.
|
|
|
bdc76f |
|
|
|
bdc76f |
This is related to GCC PR 80005: incorrect macro expansion of the
|
|
|
bdc76f |
argument of __has_include.
|
|
|
bdc76f |
|
|
|
bdc76f |
Suggested by Zack Weinberg.
|
|
|
bdc76f |
|
|
|
bdc76f |
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
|
|
|
bdc76f |
|
|
|
bdc76f |
diff --git a/sysdeps/unix/sysv/linux/bits/statx.h b/sysdeps/unix/sysv/linux/bits/statx.h
|
|
|
bdc76f |
index d36f44efc60a0bed..206878723fd37881 100644
|
|
|
bdc76f |
--- a/sysdeps/unix/sysv/linux/bits/statx.h
|
|
|
bdc76f |
+++ b/sysdeps/unix/sysv/linux/bits/statx.h
|
|
|
bdc76f |
@@ -23,8 +23,11 @@
|
|
|
bdc76f |
#endif
|
|
|
bdc76f |
|
|
|
bdc76f |
/* Use the Linux kernel header if available. */
|
|
|
bdc76f |
-#if __glibc_has_include (<linux/stat.h>)
|
|
|
bdc76f |
-# include <linux/stat.h>
|
|
|
bdc76f |
+
|
|
|
bdc76f |
+/* Use "" to work around incorrect macro expansion of the
|
|
|
bdc76f |
+ __has_include argument (GCC PR 80005). */
|
|
|
bdc76f |
+#if __glibc_has_include ("linux/stat.h")
|
|
|
bdc76f |
+# include "linux/stat.h"
|
|
|
bdc76f |
# ifdef STATX_TYPE
|
|
|
bdc76f |
# define __statx_timestamp_defined 1
|
|
|
bdc76f |
# define __statx_defined 1
|