public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] aix: handle 64bit inodes for include directories
@ 2021-05-17 11:44 CHIGOT, CLEMENT
  2021-05-17 19:05 ` David Edelsohn
  0 siblings, 1 reply; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-05-17 11:44 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Edelsohn

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
If the inode is larger, it will return -1 in st_ino.
Thus, in incpath.c when comparing include directories, if several
of them have 64bit inodes, they will be considered as duplicated.

gcc/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
	* incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
	(remove_duplicates): Use it.

libcpp/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* include/cpplib.h (INO_T_CPP): Change for AIX.
	(DEV_T_CPP): New macro.
	(struct cpp_dir): Use it.




[-- Attachment #2: 0001-aix-handle-64bit-inodes-for-include-directories.patch --]
[-- Type: application/octet-stream, Size: 10920 bytes --]

From 8c186f75b40f12c2d83dccff099505f5bc8da3dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Thu, 6 May 2021 16:08:15 +0200
Subject: [PATCH] aix: handle 64bit inodes for include directories
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
If the inode is larger, it will return -1 in st_ino.
Thus, in incpath.c when comparing include directories, if several
of them have 64bit inodes, they will be considered as duplicated.

gcc/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
	* incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
	(remove_duplicates): Use it.

libcpp/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* include/cpplib.h (INO_T_CPP): Change for AIX.
	(DEV_T_CPP): New macro.
	(struct cpp_dir): Use it.
---
 gcc/config.in           | 12 +++++++
 gcc/config/rs6000/aix.h |  6 ++++
 gcc/configure           | 70 +++++++++++++++++++++++++++++++++++++++--
 gcc/configure.ac        |  2 ++
 gcc/incpath.c           |  8 +++--
 libcpp/config.in        |  6 ++++
 libcpp/configure        | 67 +++++++++++++++++++++++++++++++++++++++
 libcpp/configure.ac     |  3 ++
 libcpp/include/cpplib.h | 10 +++++-
 9 files changed, 179 insertions(+), 5 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index e54f59ce0c3..6d1897b7cc2 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -2268,6 +2268,18 @@
 #endif
 
 
+/* The size of `dev_t', as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_DEV_T
+#endif
+
+
+/* The size of `ino_t', as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_INO_T
+#endif
+
+
 /* The size of `int', as computed by sizeof. */
 #ifndef USED_FOR_TARGET
 #undef SIZEOF_INT
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index 662785cc7db..0fc4d7151f0 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -286,3 +286,9 @@
 #define SUBTARGET_DRIVER_SELF_SPECS	\
 "%{m64:-maix64} %<m64",			\
 "%{m32:-maix32} %<m32"
+
+/* AIX needs to call stat64x in order to handle 64bit inodes,
+   even when large files is enabled.  */
+#ifdef _LARGE_FILES
+#define HOST_STAT_FOR_64BIT_INODES stat64x
+#endif
diff --git a/gcc/configure b/gcc/configure
index d9c9cca9ebb..8b7a7fc9774 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -6156,6 +6156,72 @@ rm -rf conftest*
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_ino_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_ino_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_dev_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_dev_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
 
 # sizeof(char) is 1 by definition.
 # The cast to long int works around a bug in the HP C Compiler
@@ -19435,7 +19501,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19438 "configure"
+#line 19504 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19541,7 +19607,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19544 "configure"
+#line 19610 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index e9ba2af548a..f37cef909d6 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -432,6 +432,8 @@ AC_PROG_CPP
 AC_C_INLINE
 
 AC_SYS_LARGEFILE
+AC_CHECK_SIZEOF(ino_t)
+AC_CHECK_SIZEOF(dev_t)
 
 # sizeof(char) is 1 by definition.
 AC_CHECK_SIZEOF(void *)
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 446d280321d..a240c49eba5 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -44,6 +44,10 @@
 #define DIRS_EQ(A, B) (!filename_cmp ((A)->canonical_name, (B)->canonical_name))
 #endif
 
+#ifndef HOST_STAT_FOR_64BIT_INODES
+#define HOST_STAT_FOR_64BIT_INODES stat
+#endif
+
 static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
 
 static void add_env_var_paths (const char *, incpath_kind);
@@ -246,7 +250,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
 		   int verbose)
 {
   struct cpp_dir **pcur, *tmp, *cur;
-  struct stat st;
+  struct HOST_STAT_FOR_64BIT_INODES st;
 
   for (pcur = &head; *pcur; )
     {
@@ -254,7 +258,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
 
       cur = *pcur;
 
-      if (stat (cur->name, &st))
+      if (HOST_STAT_FOR_64BIT_INODES (cur->name, &st))
 	{
 	  /* Dirs that don't exist or have denied permissions are 
 	     silently ignored, unless verbose.  */
diff --git a/libcpp/config.in b/libcpp/config.in
index 89aa6a1f30e..9983aee5912 100644
--- a/libcpp/config.in
+++ b/libcpp/config.in
@@ -258,6 +258,12 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* The size of `dev_t', as computed by sizeof. */
+#undef SIZEOF_DEV_T
+
+/* The size of `ino_t', as computed by sizeof. */
+#undef SIZEOF_INO_T
+
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
diff --git a/libcpp/configure b/libcpp/configure
index 7e28606f605..c36164538fe 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -6638,6 +6638,73 @@ $as_echo "#define HAVE_UCHAR 1" >>confdefs.h
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_ino_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_ino_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_dev_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_dev_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
+
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
 ac_ext=cpp
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 1efa96f7ca3..330858ab528 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -98,6 +98,9 @@ if test $ac_cv_type_uchar = yes; then
   [Define if <sys/types.h> defines \`uchar'.])
 fi
 
+AC_CHECK_SIZEOF(ino_t)
+AC_CHECK_SIZEOF(dev_t)
+
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
 AC_LANG_PUSH([C++])
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 41d75d9e731..4ad20c6f54c 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -732,10 +732,18 @@ struct cpp_callbacks
 
 #ifdef VMS
 #define INO_T_CPP ino_t ino[3]
+#elif defined (_AIX) && SIZEOF_INO_T == 4
+#define INO_T_CPP ino64_t ino
 #else
 #define INO_T_CPP ino_t ino
 #endif
 
+#if defined (_AIX) && SIZEOF_DEV_T == 4
+#define DEV_T_CPP dev64_t dev
+#else
+#define DEV_T_CPP dev_t dev
+#endif
+
 /* Chain of directories to look for include files in.  */
 struct cpp_dir
 {
@@ -770,7 +778,7 @@ struct cpp_dir
   /* The C front end uses these to recognize duplicated
      directories in the search path.  */
   INO_T_CPP;
-  dev_t dev;
+  DEV_T_CPP;
 };
 
 /* The kind of the cpp_macro.  */
-- 
2.31.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-05-17 11:44 [PATCH] aix: handle 64bit inodes for include directories CHIGOT, CLEMENT
@ 2021-05-17 19:05 ` David Edelsohn
  2021-05-22 23:42   ` David Edelsohn
  0 siblings, 1 reply; 14+ messages in thread
From: David Edelsohn @ 2021-05-17 19:05 UTC (permalink / raw)
  To: CHIGOT, CLEMENT; +Cc: gcc-patches

The aix.h change is okay with me, but you need to get approval for the
incpath.c and cpplib.h parts of the patch from the appropriate
maintainers.

Thanks, David

On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>
> On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
> If the inode is larger, it will return -1 in st_ino.
> Thus, in incpath.c when comparing include directories, if several
> of them have 64bit inodes, they will be considered as duplicated.
>
> gcc/ChangeLog:
> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>
>         * configure.ac: Check sizeof ino_t and dev_t.
>         * config.in: Regenerate.
>         * configure: Regenerate.
>         * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
>         * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
>         (remove_duplicates): Use it.
>
> libcpp/ChangeLog:
> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>
>         * configure.ac: Check sizeof ino_t and dev_t.
>         * config.in: Regenerate.
>         * configure: Regenerate.
>         * include/cpplib.h (INO_T_CPP): Change for AIX.
>         (DEV_T_CPP): New macro.
>         (struct cpp_dir): Use it.
>
>
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-05-17 19:05 ` David Edelsohn
@ 2021-05-22 23:42   ` David Edelsohn
  2021-06-23  6:53     ` CHIGOT, CLEMENT
  0 siblings, 1 reply; 14+ messages in thread
From: David Edelsohn @ 2021-05-22 23:42 UTC (permalink / raw)
  To: CHIGOT, CLEMENT, David Malcolm; +Cc: gcc-patches

+DavidMalcolm

Can you review this patch when you have a moment?

Thanks, David

On Mon, May 17, 2021 at 3:05 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>
> The aix.h change is okay with me, but you need to get approval for the
> incpath.c and cpplib.h parts of the patch from the appropriate
> maintainers.
>
> Thanks, David
>
> On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
> >
> > On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
> > If the inode is larger, it will return -1 in st_ino.
> > Thus, in incpath.c when comparing include directories, if several
> > of them have 64bit inodes, they will be considered as duplicated.
> >
> > gcc/ChangeLog:
> > 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
> >
> >         * configure.ac: Check sizeof ino_t and dev_t.
> >         * config.in: Regenerate.
> >         * configure: Regenerate.
> >         * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
> >         * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
> >         (remove_duplicates): Use it.
> >
> > libcpp/ChangeLog:
> > 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
> >
> >         * configure.ac: Check sizeof ino_t and dev_t.
> >         * config.in: Regenerate.
> >         * configure: Regenerate.
> >         * include/cpplib.h (INO_T_CPP): Change for AIX.
> >         (DEV_T_CPP): New macro.
> >         (struct cpp_dir): Use it.
> >
> >
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-05-22 23:42   ` David Edelsohn
@ 2021-06-23  6:53     ` CHIGOT, CLEMENT
  2021-06-24 19:17       ` Jeff Law
  0 siblings, 1 reply; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-06-23  6:53 UTC (permalink / raw)
  To: David Malcolm; +Cc: gcc-patches, David Edelsohn

Hi David,

Did you have a chance to take look at this patch ?

Thanks,
Clément


>
> +DavidMalcolm
>
> Can you review this patch when you have a moment?
>
> Thanks, David
>
> On Mon, May 17, 2021 at 3:05 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>>
>> The aix.h change is okay with me, but you need to get approval for the
>> incpath.c and cpplib.h parts of the patch from the appropriate
>> maintainers.
>>
>> Thanks, David
>>
>> On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>> >
>> > On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
>> > If the inode is larger, it will return -1 in st_ino.
>> > Thus, in incpath.c when comparing include directories, if several
>> > of them have 64bit inodes, they will be considered as duplicated.
>> >
>> > gcc/ChangeLog:
>> > 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>> >
>> >         * configure.ac: Check sizeof ino_t and dev_t.
>> >         * config.in: Regenerate.
>> >         * configure: Regenerate.
>> >         * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
>> >         * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
>> >         (remove_duplicates): Use it.
>> >
>> > libcpp/ChangeLog:
>> > 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>> >
>> >         * configure.ac: Check sizeof ino_t and dev_t.
>> >         * config.in: Regenerate.
>> >         * configure: Regenerate.
>> >         * include/cpplib.h (INO_T_CPP): Change for AIX.
>> >         (DEV_T_CPP): New macro.
>> >         (struct cpp_dir): Use it.
>> >
>> >
>> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-06-23  6:53     ` CHIGOT, CLEMENT
@ 2021-06-24 19:17       ` Jeff Law
  2021-06-28  7:16         ` CHIGOT, CLEMENT
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Law @ 2021-06-24 19:17 UTC (permalink / raw)
  To: CHIGOT, CLEMENT, David Malcolm; +Cc: gcc-patches, David Edelsohn



On 6/23/2021 12:53 AM, CHIGOT, CLEMENT via Gcc-patches wrote:
> Hi David,
>
> Did you have a chance to take look at this patch ?
>
> Thanks,
> Clément
>
>
>> +DavidMalcolm
>>
>> Can you review this patch when you have a moment?
>>
>> Thanks, David
>>
>> On Mon, May 17, 2021 at 3:05 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>>> The aix.h change is okay with me, but you need to get approval for the
>>> incpath.c and cpplib.h parts of the patch from the appropriate
>>> maintainers.
>>>
>>> Thanks, David
>>>
>>> On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>>>> On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
>>>> If the inode is larger, it will return -1 in st_ino.
>>>> Thus, in incpath.c when comparing include directories, if several
>>>> of them have 64bit inodes, they will be considered as duplicated.
>>>>
>>>> gcc/ChangeLog:
>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>
>>>>          * configure.ac: Check sizeof ino_t and dev_t.
>>>>          * config.in: Regenerate.
>>>>          * configure: Regenerate.
>>>>          * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>          * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>          (remove_duplicates): Use it.
>>>>
>>>> libcpp/ChangeLog:
>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>
>>>>          * configure.ac: Check sizeof ino_t and dev_t.
>>>>          * config.in: Regenerate.
>>>>          * configure: Regenerate.
>>>>          * include/cpplib.h (INO_T_CPP): Change for AIX.
>>>>          (DEV_T_CPP): New macro.
>>>>          (struct cpp_dir): Use it.
So my worry here is this is really a host property -- ie, this is 
behavior of where GCC runs, not the target for which GCC is generating code.

That implies that the change in aix.h is wrong.  aix.h is for the 
target, not the host -- you don't want to define something like 
HOST_STAT_FOR_64BIT_INODES there.

You'd want to be triggering this behavior via a host fragment, x-aix, or 
better yet via an autoconf test.

jeff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-06-24 19:17       ` Jeff Law
@ 2021-06-28  7:16         ` CHIGOT, CLEMENT
  2021-08-11 11:48           ` CHIGOT, CLEMENT
  2021-08-19 18:23           ` Jeff Law
  0 siblings, 2 replies; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-06-28  7:16 UTC (permalink / raw)
  To: Jeff Law, David Malcolm; +Cc: gcc-patches, David Edelsohn

[-- Attachment #1: Type: text/plain, Size: 2484 bytes --]

>On 6/23/2021 12:53 AM, CHIGOT, CLEMENT via Gcc-patches wrote:
>> Hi David,
>>
>> Did you have a chance to take look at this patch ?
>>
>> Thanks,
>> Clément
>>
>>
>>> +DavidMalcolm
>>>
>>> Can you review this patch when you have a moment?
>>>
>>> Thanks, David
>>>
>>> On Mon, May 17, 2021 at 3:05 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>>>> The aix.h change is okay with me, but you need to get approval for the
>>>> incpath.c and cpplib.h parts of the patch from the appropriate
>>>> maintainers.
>>>>
>>>> Thanks, David
>>>>
>>>> On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>>>>> On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
>>>>> If the inode is larger, it will return -1 in st_ino.
>>>>> Thus, in incpath.c when comparing include directories, if several
>>>>> of them have 64bit inodes, they will be considered as duplicated.
>>>>>
>>>>> gcc/ChangeLog:
>>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>>
>>>>>          * configure.ac: Check sizeof ino_t and dev_t.
>>>>>          * config.in: Regenerate.
>>>>>          * configure: Regenerate.
>>>>>          * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>>          * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>>          (remove_duplicates): Use it.
>>>>>
>>>>> libcpp/ChangeLog:
>>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>>
>>>>>          * configure.ac: Check sizeof ino_t and dev_t.
>>>>>          * config.in: Regenerate.
>>>>>          * configure: Regenerate.
>>>>>          * include/cpplib.h (INO_T_CPP): Change for AIX.
>>>>>          (DEV_T_CPP): New macro.
>>>>>          (struct cpp_dir): Use it.
> So my worry here is this is really a host property -- ie, this is 
> behavior of where GCC runs, not the target for which GCC is generating code.
> 
> That implies that the change in aix.h is wrong.  aix.h is for the 
> target, not the host -- you don't want to define something like 
> HOST_STAT_FOR_64BIT_INODES there.
>
> You'd want to be triggering this behavior via a host fragment, x-aix, or 
> better yet via an autoconf test.

Indeed, would this version be better ? I'm not sure about the configure test. 
But as we are retrieving the size of dev_t and ino_t just above, I'm assuming 
that the one being used in stat directly. At least, that's the case on AIX, and 
this test is only made for AIX. 

Clément

[-- Attachment #2: 0001-aix-handle-64bit-inodes-for-include-directories.patch --]
[-- Type: application/octet-stream, Size: 11167 bytes --]

From 67ae2d92e831bc36820c3d1075fae4e2dd9c6c27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Thu, 6 May 2021 16:08:15 +0200
Subject: [PATCH] aix: handle 64bit inodes for include directories
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
If the inode is larger, it will return -1 in st_ino.
Thus, in incpath.c when comparing include directories, if several
of them have 64bit inodes, they will be considered as duplicated.

gcc/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	(HOST_STAT_FOR_64BIT_INODES): New AC_DEFINE to provide stat
	syscall being able to handle 64bit inodes.
	* config.in: Regenerate.
	* configure: Regenerate.
	* incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
	(remove_duplicates): Use it.

libcpp/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* include/cpplib.h (INO_T_CPP): Change for AIX.
	(DEV_T_CPP): New macro.
	(struct cpp_dir): Use it.
---
 gcc/config.in           | 12 ++++++
 gcc/configure           | 83 ++++++++++++++++++++++++++++++++++++++++-
 gcc/configure.ac        | 14 +++++++
 gcc/incpath.c           |  8 +++-
 libcpp/config.in        |  6 +++
 libcpp/configure        | 67 +++++++++++++++++++++++++++++++++
 libcpp/configure.ac     |  3 ++
 libcpp/include/cpplib.h | 10 ++++-
 8 files changed, 198 insertions(+), 5 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index e54f59ce0c3..6d1897b7cc2 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -2268,6 +2268,18 @@
 #endif
 
 
+/* The size of `dev_t', as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_DEV_T
+#endif
+
+
+/* The size of `ino_t', as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_INO_T
+#endif
+
+
 /* The size of `int', as computed by sizeof. */
 #ifndef USED_FOR_TARGET
 #undef SIZEOF_INT
diff --git a/gcc/configure b/gcc/configure
index 4a9e4fa08ab..f209cbff9c6 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -6156,6 +6156,85 @@ rm -rf conftest*
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_ino_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_ino_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_dev_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_dev_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
+
+# Select the right stat being able to handle 64bit inodes, if needed.
+if test "$enable_largefile" != no; then
+  case "$target" in
+    *-*-aix*)
+      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
+
+$as_echo "#define HOST_STAT_FOR_64BIT_INODES stat64x" >>confdefs.h
+
+      fi;;
+  esac
+fi
+
 
 # sizeof(char) is 1 by definition.
 # The cast to long int works around a bug in the HP C Compiler
@@ -19435,7 +19514,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19438 "configure"
+#line 19517 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19541,7 +19620,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19544 "configure"
+#line 19623 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index d9fc3c219e8..9569ade00ef 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -432,6 +432,20 @@ AC_PROG_CPP
 AC_C_INLINE
 
 AC_SYS_LARGEFILE
+AC_CHECK_SIZEOF(ino_t)
+AC_CHECK_SIZEOF(dev_t)
+
+# Select the right stat being able to handle 64bit inodes, if needed.
+if test "$enable_largefile" != no; then
+  case "$target" in
+    *-*-aix*)
+      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
+	AC_DEFINE(HOST_STAT_FOR_64BIT_INODES, stat64x,
+	  [Define which stat syscall is able to handle 64bit indodes.])
+      fi;;
+  esac
+fi
+
 
 # sizeof(char) is 1 by definition.
 AC_CHECK_SIZEOF(void *)
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 52dbb806b1b..fdcf5247351 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -44,6 +44,10 @@
 #define DIRS_EQ(A, B) (!filename_cmp ((A)->canonical_name, (B)->canonical_name))
 #endif
 
+#ifndef HOST_STAT_FOR_64BIT_INODES
+#define HOST_STAT_FOR_64BIT_INODES stat
+#endif
+
 static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
 
 static void add_env_var_paths (const char *, incpath_kind);
@@ -246,7 +250,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
 		   int verbose)
 {
   struct cpp_dir **pcur, *tmp, *cur;
-  struct stat st;
+  struct HOST_STAT_FOR_64BIT_INODES st;
 
   for (pcur = &head; *pcur; )
     {
@@ -254,7 +258,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
 
       cur = *pcur;
 
-      if (stat (cur->name, &st))
+      if (HOST_STAT_FOR_64BIT_INODES (cur->name, &st))
 	{
 	  /* Dirs that don't exist or have denied permissions are 
 	     silently ignored, unless verbose.  */
diff --git a/libcpp/config.in b/libcpp/config.in
index 89aa6a1f30e..9983aee5912 100644
--- a/libcpp/config.in
+++ b/libcpp/config.in
@@ -258,6 +258,12 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* The size of `dev_t', as computed by sizeof. */
+#undef SIZEOF_DEV_T
+
+/* The size of `ino_t', as computed by sizeof. */
+#undef SIZEOF_INO_T
+
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
diff --git a/libcpp/configure b/libcpp/configure
index 9674cd9c7a7..cd944a1f927 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -6638,6 +6638,73 @@ $as_echo "#define HAVE_UCHAR 1" >>confdefs.h
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_ino_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_ino_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_dev_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_dev_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
+
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
 ac_ext=cpp
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 1efa96f7ca3..330858ab528 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -98,6 +98,9 @@ if test $ac_cv_type_uchar = yes; then
   [Define if <sys/types.h> defines \`uchar'.])
 fi
 
+AC_CHECK_SIZEOF(ino_t)
+AC_CHECK_SIZEOF(dev_t)
+
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
 AC_LANG_PUSH([C++])
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 7e840635a38..eeb026028e5 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -735,10 +735,18 @@ struct cpp_callbacks
 
 #ifdef VMS
 #define INO_T_CPP ino_t ino[3]
+#elif defined (_AIX) && SIZEOF_INO_T == 4
+#define INO_T_CPP ino64_t ino
 #else
 #define INO_T_CPP ino_t ino
 #endif
 
+#if defined (_AIX) && SIZEOF_DEV_T == 4
+#define DEV_T_CPP dev64_t dev
+#else
+#define DEV_T_CPP dev_t dev
+#endif
+
 /* Chain of directories to look for include files in.  */
 struct cpp_dir
 {
@@ -773,7 +781,7 @@ struct cpp_dir
   /* The C front end uses these to recognize duplicated
      directories in the search path.  */
   INO_T_CPP;
-  dev_t dev;
+  DEV_T_CPP;
 };
 
 /* The kind of the cpp_macro.  */
-- 
2.31.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-06-28  7:16         ` CHIGOT, CLEMENT
@ 2021-08-11 11:48           ` CHIGOT, CLEMENT
  2021-08-19 18:23           ` Jeff Law
  1 sibling, 0 replies; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-08-11 11:48 UTC (permalink / raw)
  To: Jeff Law, David Malcolm; +Cc: gcc-patches, David Edelsohn

Hi guys,

Did you have a chance to take a look at the new version of this patch ?

Thanks,
Clément
________________________________
From: CHIGOT, CLEMENT <clement.chigot@atos.net>
Sent: Monday, June 28, 2021 9:16 AM
To: Jeff Law <jeffreyalaw@gmail.com>; David Malcolm <dmalcolm@redhat.com>
Cc: gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>; David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] aix: handle 64bit inodes for include directories

>On 6/23/2021 12:53 AM, CHIGOT, CLEMENT via Gcc-patches wrote:
>> Hi David,
>>
>> Did you have a chance to take look at this patch ?
>>
>> Thanks,
>> Clément
>>
>>
>>> +DavidMalcolm
>>>
>>> Can you review this patch when you have a moment?
>>>
>>> Thanks, David
>>>
>>> On Mon, May 17, 2021 at 3:05 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>>>> The aix.h change is okay with me, but you need to get approval for the
>>>> incpath.c and cpplib.h parts of the patch from the appropriate
>>>> maintainers.
>>>>
>>>> Thanks, David
>>>>
>>>> On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>>>>> On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
>>>>> If the inode is larger, it will return -1 in st_ino.
>>>>> Thus, in incpath.c when comparing include directories, if several
>>>>> of them have 64bit inodes, they will be considered as duplicated.
>>>>>
>>>>> gcc/ChangeLog:
>>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>>
>>>>>          * configure.ac: Check sizeof ino_t and dev_t.
>>>>>          * config.in: Regenerate.
>>>>>          * configure: Regenerate.
>>>>>          * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>>          * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>>          (remove_duplicates): Use it.
>>>>>
>>>>> libcpp/ChangeLog:
>>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>>
>>>>>          * configure.ac: Check sizeof ino_t and dev_t.
>>>>>          * config.in: Regenerate.
>>>>>          * configure: Regenerate.
>>>>>          * include/cpplib.h (INO_T_CPP): Change for AIX.
>>>>>          (DEV_T_CPP): New macro.
>>>>>          (struct cpp_dir): Use it.
> So my worry here is this is really a host property -- ie, this is
> behavior of where GCC runs, not the target for which GCC is generating code.
>
> That implies that the change in aix.h is wrong.  aix.h is for the
> target, not the host -- you don't want to define something like
> HOST_STAT_FOR_64BIT_INODES there.
>
> You'd want to be triggering this behavior via a host fragment, x-aix, or
> better yet via an autoconf test.

Indeed, would this version be better ? I'm not sure about the configure test.
But as we are retrieving the size of dev_t and ino_t just above, I'm assuming
that the one being used in stat directly. At least, that's the case on AIX, and
this test is only made for AIX.

Clément

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-06-28  7:16         ` CHIGOT, CLEMENT
  2021-08-11 11:48           ` CHIGOT, CLEMENT
@ 2021-08-19 18:23           ` Jeff Law
  2021-08-24  7:57             ` CHIGOT, CLEMENT
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Law @ 2021-08-19 18:23 UTC (permalink / raw)
  To: CHIGOT, CLEMENT, David Malcolm; +Cc: gcc-patches, David Edelsohn



On 6/28/2021 1:16 AM, CHIGOT, CLEMENT wrote:
>> On 6/23/2021 12:53 AM, CHIGOT, CLEMENT via Gcc-patches wrote:
>>> Hi David,
>>>
>>> Did you have a chance to take look at this patch ?
>>>
>>> Thanks,
>>> Clément
>>>
>>>
>>>> +DavidMalcolm
>>>>
>>>> Can you review this patch when you have a moment?
>>>>
>>>> Thanks, David
>>>>
>>>> On Mon, May 17, 2021 at 3:05 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>>>>> The aix.h change is okay with me, but you need to get approval for the
>>>>> incpath.c and cpplib.h parts of the patch from the appropriate
>>>>> maintainers.
>>>>>
>>>>> Thanks, David
>>>>>
>>>>> On Mon, May 17, 2021 at 7:44 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>>>>>> On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
>>>>>> If the inode is larger, it will return -1 in st_ino.
>>>>>> Thus, in incpath.c when comparing include directories, if several
>>>>>> of them have 64bit inodes, they will be considered as duplicated.
>>>>>>
>>>>>> gcc/ChangeLog:
>>>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>>>
>>>>>>            * configure.ac: Check sizeof ino_t and dev_t.
>>>>>>            * config.in: Regenerate.
>>>>>>            * configure: Regenerate.
>>>>>>            * config/rs6000/aix.h (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>>>            * incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
>>>>>>            (remove_duplicates): Use it.
>>>>>>
>>>>>> libcpp/ChangeLog:
>>>>>> 2021-05-06  Clément Chigot  <clement.chigot@atos.net>
>>>>>>
>>>>>>            * configure.ac: Check sizeof ino_t and dev_t.
>>>>>>            * config.in: Regenerate.
>>>>>>            * configure: Regenerate.
>>>>>>            * include/cpplib.h (INO_T_CPP): Change for AIX.
>>>>>>            (DEV_T_CPP): New macro.
>>>>>>            (struct cpp_dir): Use it.
>> So my worry here is this is really a host property -- ie, this is
>> behavior of where GCC runs, not the target for which GCC is generating code.
>>
>> That implies that the change in aix.h is wrong.  aix.h is for the
>> target, not the host -- you don't want to define something like
>> HOST_STAT_FOR_64BIT_INODES there.
>>
>> You'd want to be triggering this behavior via a host fragment, x-aix, or
>> better yet via an autoconf test.
> Indeed, would this version be better ? I'm not sure about the configure test.
> But as we are retrieving the size of dev_t and ino_t just above, I'm assuming
> that the one being used in stat directly. At least, that's the case on AIX, and
> this test is only made for AIX.
It's a clear improvement.  It's still checking for the aix target though:

+# Select the right stat being able to handle 64bit inodes, if needed.
+if test "$enable_largefile" != no; then
+  case "$target" in
+    *-*-aix*)
+      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 
4; then
+
+$as_echo "#define HOST_STAT_FOR_64BIT_INODES stat64x" >>confdefs.h
+
+      fi;;
+  esac
+fi

Again, we're dealing with a host property.  You might be able to just 
change $target above to $host.  Hmm, that makes me wonder about canadian 
crosses where host != build.    We may need to do this for both the aix 
host and aix build.

Sorry about the delay,
jeff


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-08-19 18:23           ` Jeff Law
@ 2021-08-24  7:57             ` CHIGOT, CLEMENT
  2021-10-12  8:35               ` CHIGOT, CLEMENT
  2021-12-30 16:43               ` David Edelsohn
  0 siblings, 2 replies; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-08-24  7:57 UTC (permalink / raw)
  To: Jeff Law, David Malcolm; +Cc: gcc-patches, David Edelsohn

[-- Attachment #1: Type: text/plain, Size: 1685 bytes --]

>>> So my worry here is this is really a host property -- ie, this is
>>> behavior of where GCC runs, not the target for which GCC is generating code.
>>>
>>> That implies that the change in aix.h is wrong.  aix.h is for the
>>> target, not the host -- you don't want to define something like
>>> HOST_STAT_FOR_64BIT_INODES there.
>>>
>>> You'd want to be triggering this behavior via a host fragment, x-aix, or
>>> better yet via an autoconf test.
>> Indeed, would this version be better ? I'm not sure about the configure test.
>> But as we are retrieving the size of dev_t and ino_t just above, I'm assuming
>> that the one being used in stat directly. At least, that's the case on AIX, and
>> this test is only made for AIX.
> It's a clear improvement.  It's still checking for the aix target though:
>
> +# Select the right stat being able to handle 64bit inodes, if needed.
> +if test "$enable_largefile" != no; then
> +  case "$target" in
> +    *-*-aix*)
> +      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" ==
> 4; then
> +
> +$as_echo "#define HOST_STAT_FOR_64BIT_INODES stat64x" >>confdefs.h
> +
> +      fi;;
> +  esac
> +fi
>
> Again, we're dealing with a host property.  You might be able to just
> change $target above to $host.  Hmm, that makes me wonder about canadian
> crosses where host != build.    We may need to do this for both the aix
> host and aix build.

Yes, my bad, I've updated the case. I don't know if there is a usual way
to check both $build and $host. I've tried to avoid code duplication so
tell me if it's okay or if you'd rather have a case for $build and one
for $host.

Thanks,
Clément

[-- Attachment #2: 0001-aix-handle-64bit-inodes-for-include-directories.patch --]
[-- Type: application/octet-stream, Size: 11205 bytes --]

From c1c82b1570b556ae160dcd5aba131708af8578ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Thu, 6 May 2021 16:08:15 +0200
Subject: [PATCH] aix: handle 64bit inodes for include directories
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On AIX, stat will store inodes in 32bit even when using LARGE_FILES.
If the inode is larger, it will return -1 in st_ino.
Thus, in incpath.c when comparing include directories, if several
of them have 64bit inodes, they will be considered as duplicated.

gcc/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	(HOST_STAT_FOR_64BIT_INODES): New AC_DEFINE to provide stat
	syscall being able to handle 64bit inodes.
	* config.in: Regenerate.
	* configure: Regenerate.
	* incpath.c (HOST_STAT_FOR_64BIT_INODES): New define.
	(remove_duplicates): Use it.

libcpp/ChangeLog:
2021-05-06  Clément Chigot  <clement.chigot@atos.net>

	* configure.ac: Check sizeof ino_t and dev_t.
	* config.in: Regenerate.
	* configure: Regenerate.
	* include/cpplib.h (INO_T_CPP): Change for AIX.
	(DEV_T_CPP): New macro.
	(struct cpp_dir): Use it.
---
 gcc/config.in           | 12 ++++++
 gcc/configure           | 83 ++++++++++++++++++++++++++++++++++++++++-
 gcc/configure.ac        | 14 +++++++
 gcc/incpath.c           |  8 +++-
 libcpp/config.in        |  6 +++
 libcpp/configure        | 67 +++++++++++++++++++++++++++++++++
 libcpp/configure.ac     |  3 ++
 libcpp/include/cpplib.h | 10 ++++-
 8 files changed, 198 insertions(+), 5 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index d8a810bbc91..b5e1ffff9a8 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -2323,6 +2323,18 @@
 #endif
 
 
+/* The size of `dev_t', as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_DEV_T
+#endif
+
+
+/* The size of `ino_t', as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_INO_T
+#endif
+
+
 /* The size of `int', as computed by sizeof. */
 #ifndef USED_FOR_TARGET
 #undef SIZEOF_INT
diff --git a/gcc/configure b/gcc/configure
index 500e3f68215..98f83766e05 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -6201,6 +6201,85 @@ rm -rf conftest*
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_ino_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_ino_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_dev_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_dev_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
+
+# Select the right stat being able to handle 64bit inodes, if needed.
+if test "$enable_largefile" != no; then
+  case "$host, $build" in
+    *-*-aix*,*|*,*-*-aix*)
+      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
+
+$as_echo "#define HOST_STAT_FOR_64BIT_INODES stat64x" >>confdefs.h
+
+      fi;;
+  esac
+fi
+
 
 # sizeof(char) is 1 by definition.
 # The cast to long int works around a bug in the HP C Compiler
@@ -19480,7 +19559,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19483 "configure"
+#line 19562 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19586,7 +19665,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19589 "configure"
+#line 19668 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index c651db7457f..1ff79c82a97 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -463,6 +463,20 @@ AC_PROG_CPP
 AC_C_INLINE
 
 AC_SYS_LARGEFILE
+AC_CHECK_SIZEOF(ino_t)
+AC_CHECK_SIZEOF(dev_t)
+
+# Select the right stat being able to handle 64bit inodes, if needed.
+if test "$enable_largefile" != no; then
+  case "$host, $build" in
+    *-*-aix*,*|*,*-*-aix*)
+      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" == 4; then
+	AC_DEFINE(HOST_STAT_FOR_64BIT_INODES, stat64x,
+	  [Define which stat syscall is able to handle 64bit indodes.])
+      fi;;
+  esac
+fi
+
 
 # sizeof(char) is 1 by definition.
 AC_CHECK_SIZEOF(void *)
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 52dbb806b1b..fdcf5247351 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -44,6 +44,10 @@
 #define DIRS_EQ(A, B) (!filename_cmp ((A)->canonical_name, (B)->canonical_name))
 #endif
 
+#ifndef HOST_STAT_FOR_64BIT_INODES
+#define HOST_STAT_FOR_64BIT_INODES stat
+#endif
+
 static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
 
 static void add_env_var_paths (const char *, incpath_kind);
@@ -246,7 +250,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
 		   int verbose)
 {
   struct cpp_dir **pcur, *tmp, *cur;
-  struct stat st;
+  struct HOST_STAT_FOR_64BIT_INODES st;
 
   for (pcur = &head; *pcur; )
     {
@@ -254,7 +258,7 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
 
       cur = *pcur;
 
-      if (stat (cur->name, &st))
+      if (HOST_STAT_FOR_64BIT_INODES (cur->name, &st))
 	{
 	  /* Dirs that don't exist or have denied permissions are 
 	     silently ignored, unless verbose.  */
diff --git a/libcpp/config.in b/libcpp/config.in
index 89aa6a1f30e..9983aee5912 100644
--- a/libcpp/config.in
+++ b/libcpp/config.in
@@ -258,6 +258,12 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* The size of `dev_t', as computed by sizeof. */
+#undef SIZEOF_DEV_T
+
+/* The size of `ino_t', as computed by sizeof. */
+#undef SIZEOF_INO_T
+
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
diff --git a/libcpp/configure b/libcpp/configure
index 9674cd9c7a7..cd944a1f927 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -6638,6 +6638,73 @@ $as_echo "#define HAVE_UCHAR 1" >>confdefs.h
 
 fi
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ino_t" >&5
+$as_echo_n "checking size of ino_t... " >&6; }
+if ${ac_cv_sizeof_ino_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ino_t))" "ac_cv_sizeof_ino_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_ino_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (ino_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_ino_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ino_t" >&5
+$as_echo "$ac_cv_sizeof_ino_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INO_T $ac_cv_sizeof_ino_t
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5
+$as_echo_n "checking size of dev_t... " >&6; }
+if ${ac_cv_sizeof_dev_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_dev_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (dev_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_dev_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5
+$as_echo "$ac_cv_sizeof_dev_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t
+_ACEOF
+
+
+
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
 ac_ext=cpp
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index 1efa96f7ca3..330858ab528 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -98,6 +98,9 @@ if test $ac_cv_type_uchar = yes; then
   [Define if <sys/types.h> defines \`uchar'.])
 fi
 
+AC_CHECK_SIZEOF(ino_t)
+AC_CHECK_SIZEOF(dev_t)
+
 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
 # iconv() prototype.
 AC_LANG_PUSH([C++])
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 7e840635a38..eeb026028e5 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -735,10 +735,18 @@ struct cpp_callbacks
 
 #ifdef VMS
 #define INO_T_CPP ino_t ino[3]
+#elif defined (_AIX) && SIZEOF_INO_T == 4
+#define INO_T_CPP ino64_t ino
 #else
 #define INO_T_CPP ino_t ino
 #endif
 
+#if defined (_AIX) && SIZEOF_DEV_T == 4
+#define DEV_T_CPP dev64_t dev
+#else
+#define DEV_T_CPP dev_t dev
+#endif
+
 /* Chain of directories to look for include files in.  */
 struct cpp_dir
 {
@@ -773,7 +781,7 @@ struct cpp_dir
   /* The C front end uses these to recognize duplicated
      directories in the search path.  */
   INO_T_CPP;
-  dev_t dev;
+  DEV_T_CPP;
 };
 
 /* The kind of the cpp_macro.  */
-- 
2.31.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-08-24  7:57             ` CHIGOT, CLEMENT
@ 2021-10-12  8:35               ` CHIGOT, CLEMENT
  2021-10-26 14:51                 ` CHIGOT, CLEMENT
  2021-12-30 16:43               ` David Edelsohn
  1 sibling, 1 reply; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-10-12  8:35 UTC (permalink / raw)
  To: Jeff Law, David Malcolm; +Cc: gcc-patches, David Edelsohn

Hi Jeff,

Any update on this patch ?
As it's dealing with configure files, I would like to have it merged
asap before any conflicts appear.

Thanks,
Clément

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-10-12  8:35               ` CHIGOT, CLEMENT
@ 2021-10-26 14:51                 ` CHIGOT, CLEMENT
  2021-11-16  8:45                   ` CHIGOT, CLEMENT
  0 siblings, 1 reply; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-10-26 14:51 UTC (permalink / raw)
  To: Jeff Law, David Malcolm; +Cc: gcc-patches, David Edelsohn

Hi everyone,

Gentle ping on this patch.

Clément
________________________________
From: CHIGOT, CLEMENT <clement.chigot@atos.net>
Sent: Tuesday, October 12, 2021 10:35 AM
To: Jeff Law <jeffreyalaw@gmail.com>; David Malcolm <dmalcolm@redhat.com>
Cc: gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>; David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] aix: handle 64bit inodes for include directories

Hi Jeff,

Any update on this patch ?
As it's dealing with configure files, I would like to have it merged
asap before any conflicts appear.

Thanks,
Clément

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-10-26 14:51                 ` CHIGOT, CLEMENT
@ 2021-11-16  8:45                   ` CHIGOT, CLEMENT
  0 siblings, 0 replies; 14+ messages in thread
From: CHIGOT, CLEMENT @ 2021-11-16  8:45 UTC (permalink / raw)
  To: Jeff Law, David Malcolm; +Cc: gcc-patches, David Edelsohn

Hi everyone,

Gentle ping

Thanks,
Clément
________________________________
From: CHIGOT, CLEMENT <clement.chigot@atos.net>
Sent: Tuesday, October 26, 2021 4:51 PM
To: Jeff Law <jeffreyalaw@gmail.com>; David Malcolm <dmalcolm@redhat.com>
Cc: gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>; David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] aix: handle 64bit inodes for include directories

Hi everyone,

Gentle ping on this patch.

Clément
________________________________
From: CHIGOT, CLEMENT <clement.chigot@atos.net>
Sent: Tuesday, October 12, 2021 10:35 AM
To: Jeff Law <jeffreyalaw@gmail.com>; David Malcolm <dmalcolm@redhat.com>
Cc: gcc-patches@gcc.gnu.org <gcc-patches@gcc.gnu.org>; David Edelsohn <dje.gcc@gmail.com>
Subject: Re: [PATCH] aix: handle 64bit inodes for include directories

Hi Jeff,

Any update on this patch ?
As it's dealing with configure files, I would like to have it merged
asap before any conflicts appear.

Thanks,
Clément

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-08-24  7:57             ` CHIGOT, CLEMENT
  2021-10-12  8:35               ` CHIGOT, CLEMENT
@ 2021-12-30 16:43               ` David Edelsohn
  2021-12-30 18:27                 ` Jeff Law
  1 sibling, 1 reply; 14+ messages in thread
From: David Edelsohn @ 2021-12-30 16:43 UTC (permalink / raw)
  To: CHIGOT, CLEMENT, Jeff Law; +Cc: GCC Patches

Hi, Jeff

Is the revised patch from Clement okay?

Thanks, David

On Tue, Aug 24, 2021 at 3:59 AM CHIGOT, CLEMENT <clement.chigot@atos.net> wrote:
>
> >>> So my worry here is this is really a host property -- ie, this is
> >>> behavior of where GCC runs, not the target for which GCC is generating code.
> >>>
> >>> That implies that the change in aix.h is wrong.  aix.h is for the
> >>> target, not the host -- you don't want to define something like
> >>> HOST_STAT_FOR_64BIT_INODES there.
> >>>
> >>> You'd want to be triggering this behavior via a host fragment, x-aix, or
> >>> better yet via an autoconf test.
> >> Indeed, would this version be better ? I'm not sure about the configure test.
> >> But as we are retrieving the size of dev_t and ino_t just above, I'm assuming
> >> that the one being used in stat directly. At least, that's the case on AIX, and
> >> this test is only made for AIX.
> > It's a clear improvement.  It's still checking for the aix target though:
> >
> > +# Select the right stat being able to handle 64bit inodes, if needed.
> > +if test "$enable_largefile" != no; then
> > +  case "$target" in
> > +    *-*-aix*)
> > +      if test "$ac_cv_sizeof_ino_t" == "4" -a "$ac_cv_sizeof_dev_t" ==
> > 4; then
> > +
> > +$as_echo "#define HOST_STAT_FOR_64BIT_INODES stat64x" >>confdefs.h
> > +
> > +      fi;;
> > +  esac
> > +fi
> >
> > Again, we're dealing with a host property.  You might be able to just
> > change $target above to $host.  Hmm, that makes me wonder about canadian
> > crosses where host != build.    We may need to do this for both the aix
> > host and aix build.
>
> Yes, my bad, I've updated the case. I don't know if there is a usual way
> to check both $build and $host. I've tried to avoid code duplication so
> tell me if it's okay or if you'd rather have a case for $build and one
> for $host.
>
> Thanks,
> Clément

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] aix: handle 64bit inodes for include directories
  2021-12-30 16:43               ` David Edelsohn
@ 2021-12-30 18:27                 ` Jeff Law
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Law @ 2021-12-30 18:27 UTC (permalink / raw)
  To: David Edelsohn, CHIGOT, CLEMENT; +Cc: GCC Patches



On 12/30/2021 9:43 AM, David Edelsohn wrote:
> Hi, Jeff
>
> Is the revised patch from Clement okay?
I *think* so.    I don't think it's likely to affect any other system as 
a host, build or target.   I'm not entirely sure it's right for canadian 
crosses to/from involving aix, but that seems like a bit of a corner 
case these days that we could iterate on if it's not 100% correct.

I'll ACK for the trunk.

Jeff


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-12-30 18:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-17 11:44 [PATCH] aix: handle 64bit inodes for include directories CHIGOT, CLEMENT
2021-05-17 19:05 ` David Edelsohn
2021-05-22 23:42   ` David Edelsohn
2021-06-23  6:53     ` CHIGOT, CLEMENT
2021-06-24 19:17       ` Jeff Law
2021-06-28  7:16         ` CHIGOT, CLEMENT
2021-08-11 11:48           ` CHIGOT, CLEMENT
2021-08-19 18:23           ` Jeff Law
2021-08-24  7:57             ` CHIGOT, CLEMENT
2021-10-12  8:35               ` CHIGOT, CLEMENT
2021-10-26 14:51                 ` CHIGOT, CLEMENT
2021-11-16  8:45                   ` CHIGOT, CLEMENT
2021-12-30 16:43               ` David Edelsohn
2021-12-30 18:27                 ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).