public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] configure: add --disable-fix-includes
@ 2022-05-09  9:03 Martin Liška
  2022-05-09  9:31 ` Andreas Schwab
  2022-05-09 21:14 ` Joseph Myers
  0 siblings, 2 replies; 27+ messages in thread
From: Martin Liška @ 2022-05-09  9:03 UTC (permalink / raw)
  To: gcc-patches

Right now, fixinclude takes about 11 seconds on my machine, where
it reads 130MB of header files.

The number of fixed headers is negligible without any significant
change.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

fixincludes/ChangeLog:

	* fixinc.in: Add early exit.

gcc/ChangeLog:

	* Makefile.in: Support disable_fix_includes.
	* configure.ac: Add --disable-fix-includes.
	* configure: Regenerate.
---
 fixincludes/fixinc.in |  6 ++++++
 gcc/Makefile.in       |  6 ++++--
 gcc/configure         | 21 +++++++++++++++++++--
 gcc/configure.ac      |  6 ++++++
 4 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index 0c3066452c6..3ebcd346d41 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -63,6 +63,12 @@ else
   esac
 fi
 
+if test "x$DISABLE_FIX_INCLUDES" = "xyes"
+then
+  echo "Skipping fixincludes"
+  exit 0
+fi
+
 # Define what target system we're fixing.
 #
 if test -r ./Makefile; then
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 31ff95500c9..c77f1cc644d 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -401,6 +401,8 @@ PLUGINLIBS = @pluginlibs@
 
 enable_plugin = @enable_plugin@
 
+disable_fix_includes = @disable_fix_includes@
+
 # On MinGW plugin installation involves installing import libraries.
 ifeq ($(enable_plugin),yes)
   plugin_implib := $(if $(strip $(filter mingw%,$(host_os))),yes,no)
@@ -3248,8 +3250,8 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
 	    chmod a+rx $${fix_dir} || true; \
 	    (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
 	      SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
-	      gcc_dir=`${PWD_COMMAND}` ; \
-	      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
+	      gcc_dir=`${PWD_COMMAND}` ; DISABLE_FIX_INCLUDES=${disable_fix_includes} \
+	      export TARGET_MACHINE srcdir SHELL MACRO_LIST DISABLE_FIX_INCLUDES && \
 	      cd $(build_objdir)/fixincludes && \
 	      $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
 	        $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
diff --git a/gcc/configure b/gcc/configure
index bd4d4721868..843ab02bfa3 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -839,6 +839,7 @@ with_float
 with_cpu
 enable_multiarch
 enable_multilib
+disable_fix_includes
 coverage_flags
 valgrind_command
 valgrind_path_defines
@@ -958,6 +959,7 @@ enable_werror_always
 enable_checking
 enable_coverage
 enable_gather_detailed_mem_stats
+enable_disable_fix_includes
 enable_valgrind_annotations
 enable_multilib
 enable_multiarch
@@ -1688,6 +1690,7 @@ Optional Features:
                           Values are opt, noopt, default is noopt
   --enable-gather-detailed-mem-stats
                           enable detailed memory allocation stats gathering
+  --disable-fix-includes  skip fixing of includes
   --enable-valgrind-annotations
                           enable valgrind runtime interaction
   --enable-multilib       enable library support for multiple ABIs
@@ -7780,6 +7783,20 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+# Check whether --enable-disable-fix-includes was given.
+if test "${enable_disable_fix_includes+set}" = set; then :
+  enableval=$enable_disable_fix_includes;
+else
+  disable_fix_includes=yes
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define FIX_INCLUDES $disable_fix_includes
+_ACEOF
+
+
+
 # Check whether --enable-valgrind-annotations was given.
 if test "${enable_valgrind_annotations+set}" = set; then :
   enableval=$enable_valgrind_annotations;
@@ -19659,7 +19676,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19662 "configure"
+#line 19679 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19765,7 +19782,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19768 "configure"
+#line 19785 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 1171c946e6e..6015e403aa9 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
 AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
 [Define to enable detailed memory allocation stats gathering.])
 
+AC_ARG_ENABLE(disable-fix-includes,
+[AS_HELP_STRING([--disable-fix-includes],
+		[skip fixing of includes])], [],
+[disable_fix_includes=yes])
+AC_SUBST(disable_fix_includes)
+
 AC_ARG_ENABLE(valgrind-annotations,
 [AS_HELP_STRING([--enable-valgrind-annotations],
 		[enable valgrind runtime interaction])], [],
-- 
2.36.0


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-09  9:03 [PATCH] configure: add --disable-fix-includes Martin Liška
@ 2022-05-09  9:31 ` Andreas Schwab
  2022-05-09 21:14 ` Joseph Myers
  1 sibling, 0 replies; 27+ messages in thread
From: Andreas Schwab @ 2022-05-09  9:31 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

On Mai 09 2022, Martin Liška wrote:

> +cat >>confdefs.h <<_ACEOF
> +#define FIX_INCLUDES $disable_fix_includes
> +_ACEOF

Where does this come from?  Also, nothing uses it.

> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 1171c946e6e..6015e403aa9 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
>  AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
>  [Define to enable detailed memory allocation stats gathering.])
>  
> +AC_ARG_ENABLE(disable-fix-includes,
> +[AS_HELP_STRING([--disable-fix-includes],
> +		[skip fixing of includes])], [],
> +[disable_fix_includes=yes])

That creates the (non-working) options --enable-disable-fix-includes and
--disable-disable-fix-includes, but not --disable-fix-includes.  It also
disables fixincludes by default, which doesn't look intended.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-09  9:03 [PATCH] configure: add --disable-fix-includes Martin Liška
  2022-05-09  9:31 ` Andreas Schwab
@ 2022-05-09 21:14 ` Joseph Myers
  2022-05-11 10:55   ` Martin Liška
  1 sibling, 1 reply; 27+ messages in thread
From: Joseph Myers @ 2022-05-09 21:14 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

If you add a new configure option, it should be documented in 
install.texi.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-09 21:14 ` Joseph Myers
@ 2022-05-11 10:55   ` Martin Liška
  2022-05-11 11:00     ` Rainer Orth
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-05-11 10:55 UTC (permalink / raw)
  To: Joseph Myers; +Cc: gcc-patches

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

On 5/9/22 23:14, Joseph Myers wrote:
> If you add a new configure option, it should be documented in 
> install.texi.
> 

Both comments fixed in the v2.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

[-- Attachment #2: 0001-configure-add-disable-fix-includes.patch --]
[-- Type: text/x-patch, Size: 5562 bytes --]

From 58d431568d6b6163dd9cdc920239f173689a769c Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 4 Feb 2022 13:42:14 +0100
Subject: [PATCH] configure: add --disable-fix-includes

Right now, fixinclude takes about 11 seconds on my machine, where
it reads 130MB of header files.

The number of fixed headers is negligible without any significant
change.

fixincludes/ChangeLog:

	* fixinc.in: Add early exit.

gcc/ChangeLog:

	* Makefile.in: Support disable_fix_includes.
	* configure.ac: Add --disable-fix-includes.
	* configure: Regenerate.
	* doc/install.texi: Document the newly added configure options.
---
 fixincludes/fixinc.in |  6 ++++++
 gcc/Makefile.in       |  6 ++++--
 gcc/configure         | 16 ++++++++++++++--
 gcc/configure.ac      |  6 ++++++
 gcc/doc/install.texi  |  7 +++++++
 5 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index 0bd8027a554..9baec3f871d 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -63,6 +63,12 @@ else
   esac
 fi
 
+if test "x$ENABLE_FIX_INCLUDES" = "xno"
+then
+  echo "Skipping fixincludes"
+  exit 0
+fi
+
 # Define what target system we're fixing.
 #
 if test -r ./Makefile; then
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 31ff95500c9..80de547231a 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -401,6 +401,8 @@ PLUGINLIBS = @pluginlibs@
 
 enable_plugin = @enable_plugin@
 
+enable_fix_includes = @enable_fix_includes@
+
 # On MinGW plugin installation involves installing import libraries.
 ifeq ($(enable_plugin),yes)
   plugin_implib := $(if $(strip $(filter mingw%,$(host_os))),yes,no)
@@ -3248,8 +3250,8 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
 	    chmod a+rx $${fix_dir} || true; \
 	    (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
 	      SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
-	      gcc_dir=`${PWD_COMMAND}` ; \
-	      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
+	      gcc_dir=`${PWD_COMMAND}` ; ENABLE_FIX_INCLUDES=${enable_fix_includes} \
+	      export TARGET_MACHINE srcdir SHELL MACRO_LIST ENABLE_FIX_INCLUDES && \
 	      cd $(build_objdir)/fixincludes && \
 	      $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
 	        $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
diff --git a/gcc/configure b/gcc/configure
index 5ce0557719a..e29f2cf7d2e 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -839,6 +839,7 @@ with_float
 with_cpu
 enable_multiarch
 enable_multilib
+enable_fix_includes
 coverage_flags
 valgrind_command
 valgrind_path_defines
@@ -958,6 +959,7 @@ enable_werror_always
 enable_checking
 enable_coverage
 enable_gather_detailed_mem_stats
+enable_fix_includes
 enable_valgrind_annotations
 enable_multilib
 enable_multiarch
@@ -1688,6 +1690,7 @@ Optional Features:
                           Values are opt, noopt, default is noopt
   --enable-gather-detailed-mem-stats
                           enable detailed memory allocation stats gathering
+  --disable-fix-includes  skip fixing of includes
   --enable-valgrind-annotations
                           enable valgrind runtime interaction
   --enable-multilib       enable library support for multiple ABIs
@@ -7783,6 +7786,15 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+# Check whether --enable-fix-includes was given.
+if test "${enable_fix_includes+set}" = set; then :
+  enableval=$enable_fix_includes;
+else
+  enable_fix_includes=yes
+fi
+
+
+
 # Check whether --enable-valgrind-annotations was given.
 if test "${enable_valgrind_annotations+set}" = set; then :
   enableval=$enable_valgrind_annotations;
@@ -19673,7 +19685,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19676 "configure"
+#line 19688 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19779,7 +19791,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19782 "configure"
+#line 19794 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..0e20435d38b 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
 AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
 [Define to enable detailed memory allocation stats gathering.])
 
+AC_ARG_ENABLE(fix-includes,
+[AS_HELP_STRING([--disable-fix-includes],
+		[skip fixing of includes])], [],
+[enable_fix_includes=yes])
+AC_SUBST(enable_fix_includes)
+
 AC_ARG_ENABLE(valgrind-annotations,
 [AS_HELP_STRING([--enable-valgrind-annotations],
 		[enable valgrind runtime interaction])], [],
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 10bfceffceb..c1404b4947e 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2371,6 +2371,13 @@ For a native build and cross compiles that have target headers, the option's
 default is derived from glibc's behavior. When glibc clamps float_t to double,
 GCC follows and enables the option. For other cross compiles, the default is
 disabled.
+
+@item --enable-fix-include
+@itemx --disable-fix-include
+
+Enable fixing of system header files. GCC needs to install corrected versions
+of some system header files. This is because most target systems have
+some header files that won’t work with GCC unless they are changed.
 @end table
 
 @subheading Cross-Compiler-Specific Options
-- 
2.36.1


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 10:55   ` Martin Liška
@ 2022-05-11 11:00     ` Rainer Orth
  2022-05-11 11:15       ` Martin Liška
  0 siblings, 1 reply; 27+ messages in thread
From: Rainer Orth @ 2022-05-11 11:00 UTC (permalink / raw)
  To: Martin Liška; +Cc: Joseph Myers, gcc-patches

Hi Martin,

> On 5/9/22 23:14, Joseph Myers wrote:
>> If you add a new configure option, it should be documented in 
>> install.texi.
>> 
>
> Both comments fixed in the v2.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> From 58d431568d6b6163dd9cdc920239f173689a769c Mon Sep 17 00:00:00 2001
> From: Martin Liska <mliska@suse.cz>
> Date: Fri, 4 Feb 2022 13:42:14 +0100
> Subject: [PATCH] configure: add --disable-fix-includes

As I've mentioned before, I believe, the command is called fixincludes
in current gcc docs, and the option should reflect that, not introduce a
name used nowhere else.

> Right now, fixinclude takes about 11 seconds on my machine, where
> it reads 130MB of header files.
>
> The number of fixed headers is negligible without any significant
> change.

Please speak for Linux, but not for other targets ;-)

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 11:00     ` Rainer Orth
@ 2022-05-11 11:15       ` Martin Liška
  2022-05-11 11:31         ` Rainer Orth
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-05-11 11:15 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Joseph Myers, gcc-patches

On 5/11/22 13:00, Rainer Orth wrote:
> Hi Martin,
> 
>> On 5/9/22 23:14, Joseph Myers wrote:
>>> If you add a new configure option, it should be documented in 
>>> install.texi.
>>>
>>
>> Both comments fixed in the v2.
>>
>> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>> From 58d431568d6b6163dd9cdc920239f173689a769c Mon Sep 17 00:00:00 2001
>> From: Martin Liska <mliska@suse.cz>
>> Date: Fri, 4 Feb 2022 13:42:14 +0100
>> Subject: [PATCH] configure: add --disable-fix-includes
> 
> As I've mentioned before, I believe, the command is called fixincludes
> in current gcc docs, and the option should reflect that, not introduce a
> name used nowhere else.

No, I can't use it, because even with current master using --disable-fixincludes
means the tool is not built at all. It results with:

g++   -g       -DIN_GCC -fPIC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H  -DGENERATOR_FILE -static-libstdc++ -static-libgcc   -o build/genchecksum \
    build/genchecksum.o ../build-x86_64-pc-linux-gnu/libiberty/pic/libiberty.a
make: *** No rule to make target '../build-x86_64-pc-linux-gnu/fixincludes/fixinc.sh', needed by 'stmp-fixinc'.  Stop.
make: *** Waiting for unfinished jobs....

Martin

> 
>> Right now, fixinclude takes about 11 seconds on my machine, where
>> it reads 130MB of header files.
>>
>> The number of fixed headers is negligible without any significant
>> change.
> 
> Please speak for Linux, but not for other targets ;-)
> 
> 	Rainer
> 


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 11:15       ` Martin Liška
@ 2022-05-11 11:31         ` Rainer Orth
  2022-05-11 11:58           ` Martin Liška
  0 siblings, 1 reply; 27+ messages in thread
From: Rainer Orth @ 2022-05-11 11:31 UTC (permalink / raw)
  To: Martin Liška; +Cc: Joseph Myers, gcc-patches

Hi Martin,

>>> Subject: [PATCH] configure: add --disable-fix-includes
>> 
>> As I've mentioned before, I believe, the command is called fixincludes
>> in current gcc docs, and the option should reflect that, not introduce a
>> name used nowhere else.
>
> No, I can't use it, because even with current master using --disable-fixincludes
> means the tool is not built at all. It results with:
>
> g++ -g -DIN_GCC -fPIC -fno-exceptions -fno-rtti
> -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
> -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
> -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common
> -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o
> build/genchecksum \
>     build/genchecksum.o ../build-x86_64-pc-linux-gnu/libiberty/pic/libiberty.a
> make: *** No rule to make target
> '../build-x86_64-pc-linux-gnu/fixincludes/fixinc.sh', needed by
> 'stmp-fixinc'.  Stop.
> make: *** Waiting for unfinished jobs....

and why not just fix that, rather than introducing yet another option?
This error suggests current --disable-fixincludes is useless on it's
own.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 11:31         ` Rainer Orth
@ 2022-05-11 11:58           ` Martin Liška
  2022-05-11 12:48             ` Andreas Schwab
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-05-11 11:58 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Joseph Myers, gcc-patches

On 5/11/22 13:31, Rainer Orth wrote:
> Hi Martin,
> 
>>>> Subject: [PATCH] configure: add --disable-fix-includes
>>>
>>> As I've mentioned before, I believe, the command is called fixincludes
>>> in current gcc docs, and the option should reflect that, not introduce a
>>> name used nowhere else.
>>
>> No, I can't use it, because even with current master using --disable-fixincludes
>> means the tool is not built at all. It results with:
>>
>> g++ -g -DIN_GCC -fPIC -fno-exceptions -fno-rtti
>> -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
>> -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
>> -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common
>> -DHAVE_CONFIG_H -DGENERATOR_FILE -static-libstdc++ -static-libgcc -o
>> build/genchecksum \
>>     build/genchecksum.o ../build-x86_64-pc-linux-gnu/libiberty/pic/libiberty.a
>> make: *** No rule to make target
>> '../build-x86_64-pc-linux-gnu/fixincludes/fixinc.sh', needed by
>> 'stmp-fixinc'.  Stop.
>> make: *** Waiting for unfinished jobs....
> 
> and why not just fix that, rather than introducing yet another option?

I would like to, but I don't understant autoconf much :/

@Joseph: Can you please help me why --disable-$foo disables building $foo
folder during the build?

Thanks,
Martin

> This error suggests current --disable-fixincludes is useless on it's
> own.
> 
> 	Rainer
> 


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 11:58           ` Martin Liška
@ 2022-05-11 12:48             ` Andreas Schwab
  2022-05-11 14:50               ` Martin Liška
  0 siblings, 1 reply; 27+ messages in thread
From: Andreas Schwab @ 2022-05-11 12:48 UTC (permalink / raw)
  To: Martin Liška; +Cc: Rainer Orth, gcc-patches, Joseph Myers

On Mai 11 2022, Martin Liška wrote:

> @Joseph: Can you please help me why --disable-$foo disables building $foo
> folder during the build?

# Handle --disable-<component> generically.
for dir in $configdirs $build_configdirs $target_configdirs ; do
  dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
  varname=`echo $dirname | sed -e s/+/_/g`
  if eval test x\${enable_${varname}} "=" xno ; then
    noconfigdirs="$noconfigdirs $dir"
  fi
done

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 12:48             ` Andreas Schwab
@ 2022-05-11 14:50               ` Martin Liška
  2022-05-20 12:42                 ` Alexandre Oliva
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-05-11 14:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Rainer Orth, gcc-patches, Joseph Myers

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

On 5/11/22 14:48, Andreas Schwab wrote:
> On Mai 11 2022, Martin Liška wrote:
> 
>> @Joseph: Can you please help me why --disable-$foo disables building $foo
>> folder during the build?
> 
> # Handle --disable-<component> generically.
> for dir in $configdirs $build_configdirs $target_configdirs ; do
>   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
>   varname=`echo $dirname | sed -e s/+/_/g`
>   if eval test x\${enable_${varname}} "=" xno ; then
>     noconfigdirs="$noconfigdirs $dir"
>   fi
> done
> 

Great, thanks!

Using that I provide v3 where I renamed the option to --{enable,disable}-fixincludes.

Ready to be installed?
Thanks,
Martin

[-- Attachment #2: 0001-configure-add-disable-fixincludes.patch --]
[-- Type: text/x-patch, Size: 6800 bytes --]

From 2d3079a14ee26192ebbc81e7c9663ae49ad7a178 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 4 Feb 2022 13:42:14 +0100
Subject: [PATCH] configure: add --disable-fixincludes

Right now, fixinclude takes about 11 seconds on my machine, where
it reads 130MB of header files.

The number of fixed headers is negligible without any significant
change.

fixincludes/ChangeLog:

	* fixinc.in: Add early exit.

gcc/ChangeLog:

	* Makefile.in: Support enable_fixincludes.
	* configure.ac: Add --disable-fixincludes.
	* configure: Regenerate.
	* doc/install.texi: Document the newly added configure options.

ChangeLog:

	* configure.ac: Ignore --disable-fixincludes.
	* configure: Regenerate.
---
 configure             |  4 ++++
 configure.ac          |  4 ++++
 fixincludes/fixinc.in |  6 ++++++
 gcc/Makefile.in       |  6 ++++--
 gcc/configure         | 16 ++++++++++++++--
 gcc/configure.ac      |  6 ++++++
 gcc/doc/install.texi  |  7 +++++++
 7 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 5dcaab14ae9..fb3897585b8 100755
--- a/configure
+++ b/configure
@@ -9041,6 +9041,10 @@ fi
 for dir in $configdirs $build_configdirs $target_configdirs ; do
   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
   varname=`echo $dirname | sed -e s/+/_/g`
+  # Skip --disable-fixincludes, it is handled in gcc/configure
+  if eval test x${varname} "=" xfixincludes ; then
+    continue
+  fi
   if eval test x\${enable_${varname}} "=" xno ; then
     noconfigdirs="$noconfigdirs $dir"
   fi
diff --git a/configure.ac b/configure.ac
index 85977482aee..a0466533a46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2305,6 +2305,10 @@ fi
 for dir in $configdirs $build_configdirs $target_configdirs ; do
   dirname=`echo $dir | sed -e s/target-//g -e s/build-//g -e s/-/_/g`
   varname=`echo $dirname | sed -e s/+/_/g`
+  # Skip --disable-fixincludes, it is handled in gcc/configure
+  if eval test x${varname} "=" xfixincludes ; then
+    continue
+  fi
   if eval test x\${enable_${varname}} "=" xno ; then
     noconfigdirs="$noconfigdirs $dir"
   fi
diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index 0bd8027a554..bc2494c9f3a 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -63,6 +63,12 @@ else
   esac
 fi
 
+if test "x$ENABLE_FIXINCLUDES" = "xno"
+then
+  echo "Skipping fixincludes"
+  exit 0
+fi
+
 # Define what target system we're fixing.
 #
 if test -r ./Makefile; then
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 31ff95500c9..f73c6a731b3 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -401,6 +401,8 @@ PLUGINLIBS = @pluginlibs@
 
 enable_plugin = @enable_plugin@
 
+enable_fixincludes = @enable_fixincludes@
+
 # On MinGW plugin installation involves installing import libraries.
 ifeq ($(enable_plugin),yes)
   plugin_implib := $(if $(strip $(filter mingw%,$(host_os))),yes,no)
@@ -3248,8 +3250,8 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
 	    chmod a+rx $${fix_dir} || true; \
 	    (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
 	      SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
-	      gcc_dir=`${PWD_COMMAND}` ; \
-	      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
+	      gcc_dir=`${PWD_COMMAND}` ; ENABLE_FIXINCLUDES=${enable_fixincludes} \
+	      export TARGET_MACHINE srcdir SHELL MACRO_LIST ENABLE_FIXINCLUDES && \
 	      cd $(build_objdir)/fixincludes && \
 	      $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
 	        $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
diff --git a/gcc/configure b/gcc/configure
index 5ce0557719a..04affa93864 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -839,6 +839,7 @@ with_float
 with_cpu
 enable_multiarch
 enable_multilib
+enable_fixincludes
 coverage_flags
 valgrind_command
 valgrind_path_defines
@@ -958,6 +959,7 @@ enable_werror_always
 enable_checking
 enable_coverage
 enable_gather_detailed_mem_stats
+enable_fixincludes
 enable_valgrind_annotations
 enable_multilib
 enable_multiarch
@@ -1688,6 +1690,7 @@ Optional Features:
                           Values are opt, noopt, default is noopt
   --enable-gather-detailed-mem-stats
                           enable detailed memory allocation stats gathering
+  --disable-fixincludes   skip fixing of includes
   --enable-valgrind-annotations
                           enable valgrind runtime interaction
   --enable-multilib       enable library support for multiple ABIs
@@ -7783,6 +7786,15 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+# Check whether --enable-fixincludes was given.
+if test "${enable_fixincludes+set}" = set; then :
+  enableval=$enable_fixincludes;
+else
+  enable_fixincludes=yes
+fi
+
+
+
 # Check whether --enable-valgrind-annotations was given.
 if test "${enable_valgrind_annotations+set}" = set; then :
   enableval=$enable_valgrind_annotations;
@@ -19673,7 +19685,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19676 "configure"
+#line 19688 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19779,7 +19791,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19782 "configure"
+#line 19794 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..80300f3caaf 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
 AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
 [Define to enable detailed memory allocation stats gathering.])
 
+AC_ARG_ENABLE(fixincludes,
+[AS_HELP_STRING([--disable-fixincludes],
+		[skip fixing of includes])], [],
+[enable_fixincludes=yes])
+AC_SUBST(enable_fixincludes)
+
 AC_ARG_ENABLE(valgrind-annotations,
 [AS_HELP_STRING([--enable-valgrind-annotations],
 		[enable valgrind runtime interaction])], [],
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 10bfceffceb..1d055bb190d 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2371,6 +2371,13 @@ For a native build and cross compiles that have target headers, the option's
 default is derived from glibc's behavior. When glibc clamps float_t to double,
 GCC follows and enables the option. For other cross compiles, the default is
 disabled.
+
+@item --enable-fixincludes
+@itemx --disable-fixincludes
+
+Enable fixing of system header files. GCC needs to install corrected versions
+of some system header files. This is because most target systems have
+some header files that won’t work with GCC unless they are changed.
 @end table
 
 @subheading Cross-Compiler-Specific Options
-- 
2.36.1


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-05-11 14:50               ` Martin Liška
@ 2022-05-20 12:42                 ` Alexandre Oliva
  2022-05-24 12:05                   ` [PATCH v2] Support --disable-fixincludes Martin Liška
  0 siblings, 1 reply; 27+ messages in thread
From: Alexandre Oliva @ 2022-05-20 12:42 UTC (permalink / raw)
  To: Martin Liška; +Cc: Andreas Schwab, gcc-patches, Joseph Myers

On May 11, 2022, Martin Liška <mliska@suse.cz> wrote:

> Ready to be installed?

Hmm...  I don't like that --disable-fixincludes would still configure,
build and even install fixincludes.  This would be surprising, given
that the semantics of disabling a component is to not even configure it.

How about leaving the top-level alone, and changing gcc/configure.ac to
clear STMP_FIXINC when --disable-fixincludes is given?

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

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

* [PATCH v2] Support --disable-fixincludes.
  2022-05-20 12:42                 ` Alexandre Oliva
@ 2022-05-24 12:05                   ` Martin Liška
  2022-05-25  5:37                     ` Alexandre Oliva
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-05-24 12:05 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Andreas Schwab, gcc-patches, Joseph Myers

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

On 5/20/22 14:42, Alexandre Oliva wrote:
> On May 11, 2022, Martin Liška <mliska@suse.cz> wrote:
> 
>> Ready to be installed?
> 
> Hmm...  I don't like that --disable-fixincludes would still configure,
> build and even install fixincludes.  This would be surprising, given
> that the semantics of disabling a component is to not even configure it.
> 
> How about leaving the top-level alone, and changing gcc/configure.ac to
> clear STMP_FIXINC when --disable-fixincludes is given?
> 

Sure, that's a good idea.

Allways install limits.h and syslimits.h header files
to include folder.

When --disable-fixincludes is used, then no systen header files
are fixed by the tools in fixincludes. Moreover, the fixincludes
tools are not built any longer.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

[-- Attachment #2: 0001-Support-disable-fixincludes.patch --]
[-- Type: text/x-patch, Size: 4455 bytes --]

From ba9bed4512d73d34d4c9bf5830e758097d517bc3 Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Tue, 24 May 2022 13:06:07 +0200
Subject: [PATCH] Support --disable-fixincludes.

Allways install limits.h and syslimits.h header files
to include folder.

When --disable-fixincludes is used, then no systen header files
are fixed by the tools in fixincludes. Moreover, the fixincludes
tools are not built any longer.

gcc/ChangeLog:

	* Makefile.in: Always install limits.h and syslimits.h to
	include folder.
	* configure.ac: Assign STMP_FIXINC blank if
	--disable-fixincludes is used.
	* configure: Regenerate.
---
 gcc/Makefile.in  | 22 ++++++++--------------
 gcc/configure    | 10 ++++++++--
 gcc/configure.ac |  6 ++++++
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 97e5450ecb5..3ab8e36e1ed 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3153,19 +3153,20 @@ stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(T_STDINT_GCC_H) $(USER_H) fixinc_
 	set -e; for ml in `cat fixinc_list`; do \
 	  sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
 	  multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
-	  fix_dir=include-fixed$${multi_dir}; \
+	  include_dir=include$${multi_dir}; \
 	  if $(LIMITS_H_TEST) ; then \
 	    cat $(srcdir)/limitx.h $(T_GLIMITS_H) $(srcdir)/limity.h > tmp-xlimits.h; \
 	  else \
 	    cat $(T_GLIMITS_H) > tmp-xlimits.h; \
 	  fi; \
-	  $(mkinstalldirs) $${fix_dir}; \
-	  chmod a+rx $${fix_dir} || true; \
+	  $(mkinstalldirs) $${include_dir}; \
+	  chmod a+rx $${include_dir} || true; \
 	  $(SHELL) $(srcdir)/../move-if-change \
 	    tmp-xlimits.h  tmp-limits.h; \
-	  rm -f $${fix_dir}/limits.h; \
-	  cp -p tmp-limits.h $${fix_dir}/limits.h; \
-	  chmod a+r $${fix_dir}/limits.h; \
+	  rm -f $${include_dir}/limits.h; \
+	  cp -p tmp-limits.h $${include_dir}/limits.h; \
+	  chmod a+r $${include_dir}/limits.h; \
+	  cp $(srcdir)/gsyslimits.h $${include_dir}/syslimits.h; \
 	done
 # Install the README
 	rm -f include-fixed/README
@@ -3255,13 +3256,6 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
 	      cd $(build_objdir)/fixincludes && \
 	      $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
 	        $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
-	    rm -f $${fix_dir}/syslimits.h; \
-	    if [ -f $${fix_dir}/limits.h ]; then \
-	      mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \
-	    else \
-	      cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \
-	    fi; \
-	    chmod a+r $${fix_dir}/syslimits.h; \
 	  done; \
 	fi
 	$(STAMP) stmp-fixinc
@@ -3979,7 +3973,7 @@ install-mkheaders: stmp-int-hdrs install-itoolsdirs \
 	set -e; for ml in `cat fixinc_list`; do \
 	  multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
 	  $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
-	  $(INSTALL_DATA) include-fixed$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
+	  $(INSTALL_DATA) include$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
 	done
 	$(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
 		$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
diff --git a/gcc/configure b/gcc/configure
index 37e0dd5e414..711e8e9b559 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -13548,6 +13548,12 @@ then
     BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
 fi
 
+
+if test x$enable_fixincludes = xno;
+then
+    STMP_FIXINC=''
+fi
+
 # Expand extra_headers to include complete path.
 # This substitutes for lots of t-* files.
 extra_headers_list=
@@ -19674,7 +19680,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19676 "configure"
+#line 19683 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19780,7 +19786,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19782 "configure"
+#line 19789 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 23bee7010a3..8a2dd5a193a 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2501,6 +2501,12 @@ then
     BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
 fi
 
+
+if test x$enable_fixincludes = xno;
+then
+    STMP_FIXINC=''
+fi
+
 # Expand extra_headers to include complete path.
 # This substitutes for lots of t-* files.
 extra_headers_list=
-- 
2.36.1


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

* Re: [PATCH v2] Support --disable-fixincludes.
  2022-05-24 12:05                   ` [PATCH v2] Support --disable-fixincludes Martin Liška
@ 2022-05-25  5:37                     ` Alexandre Oliva
  2022-07-08 11:14                       ` Martin Liška
  0 siblings, 1 reply; 27+ messages in thread
From: Alexandre Oliva @ 2022-05-25  5:37 UTC (permalink / raw)
  To: Martin Liška; +Cc: Andreas Schwab, gcc-patches, Joseph Myers

On May 24, 2022, Martin Liška <mliska@suse.cz> wrote:

> Allways install limits.h and syslimits.h header files
> to include folder.

typo: s/Allways/Always/

I'm a little worried about this bit, too.  limitx.h includes
"syslimits.h", mentioning it should be in the same directory.  Perhaps
it could be left in include-fixed?

The patch also changes syslimits.h from either the fixincluded file or
gsyslimits.h to use gsyslimits.h unconditionally, which seemed wrong at
first.

Now I see how these two hunks work together: syslimits.h will now always
#include_next <limits.h>, which will find it in include-fixed if it's
there, and system header files otherwise.  Nice!, but IMHO the commit
message could be a little more verbose on the extent of the change and
why that (is supposed to) work.


It also looks like install-mkheaders installs limits-related headers for
when fixincludes runs; we could probably skip the whole thing if
fixincludes is disabled, but I'm also worried about how the changes
above might impact post-install fixincludes: if that installs
gsyslimits.h et al in include-fixed while your changes moves it to
include, headers might end up in a confusing state.  I haven't worked
out whether that's safe, but there appears to be room for cleanups
there.

gcc/config/mips/t-sdemtk also places syslimits.h explicitly in include/
rather than include-fixed/, as part of disabling fixincludes, which is
good, but it could be cleaned up as well.

I don't see other config fragments that might require adjustments, so I
think the patch looks good; hopefully my worries are unjustified, and
the cleanups it enables could be


We still create the README file in there and install it, even with
fixincludes disabled and thus unavailable, don't we?  That README then
becomes misleading; we might be better off not installing it.


> When --disable-fixincludes is used, then no systen header files
> are fixed by the tools in fixincludes. Moreover, the fixincludes
> tools are not built any longer.

typo: s/systen/system/


Could you please check that a post-install mkheaders still has a
functional limits.h with these changes?  The patch is ok (with the typo
fixes) if so.  The cleanups it enables would be welcome as separate
patches ;-)

Thanks!

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

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

* Re: [PATCH v2] Support --disable-fixincludes.
  2022-05-25  5:37                     ` Alexandre Oliva
@ 2022-07-08 11:14                       ` Martin Liška
  2022-07-09 16:11                         ` Jeff Law
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-07-08 11:14 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Andreas Schwab, gcc-patches, Joseph Myers

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

On 5/25/22 07:37, Alexandre Oliva wrote:
> On May 24, 2022, Martin Liška <mliska@suse.cz> wrote:
> 
>> Allways install limits.h and syslimits.h header files
>> to include folder.
> 
> typo: s/Allways/Always/

Hello.

Fixed.

> 
> I'm a little worried about this bit, too.  limitx.h includes
> "syslimits.h", mentioning it should be in the same directory.  Perhaps
> it could be left in include-fixed?

Well, I would like to go w/o include-fixed if the option --disable-fixincludes is used.

> 
> The patch also changes syslimits.h from either the fixincluded file or
> gsyslimits.h to use gsyslimits.h unconditionally, which seemed wrong at
> first.
> 
> Now I see how these two hunks work together: syslimits.h will now always
> #include_next <limits.h>, which will find it in include-fixed if it's
> there, and system header files otherwise.  Nice!, but IMHO the commit
> message could be a little more verbose on the extent of the change and
> why that (is supposed to) work.

Oh, to be honest I'm not fully familiar with how these 2 files work together.
Can you explain it to me so that I can adjust the changelog entry correspondingly?

> 
> 
> It also looks like install-mkheaders installs limits-related headers for
> when fixincludes runs; we could probably skip the whole thing if
> fixincludes is disabled, but I'm also worried about how the changes
> above might impact post-install fixincludes: if that installs
> gsyslimits.h et al in include-fixed while your changes moves it to
> include, headers might end up in a confusing state.  I haven't worked
> out whether that's safe, but there appears to be room for cleanups
> there.

I've check that 'make install-mkheaders' work fine w/ and w/o --disable-fixincludes
after the patch.

> 
> gcc/config/mips/t-sdemtk also places syslimits.h explicitly in include/
> rather than include-fixed/, as part of disabling fixincludes, which is
> good, but it could be cleaned up as well.

Can we do that as a follow-up patch?

> 
> I don't see other config fragments that might require adjustments, so I
> think the patch looks good; hopefully my worries are unjustified, and
> the cleanups it enables could be

Good.

> 
> 
> We still create the README file in there and install it, even with
> fixincludes disabled and thus unavailable, don't we?  That README then
> becomes misleading; we might be better off not installing it.

Sure, fixed in v2 of the patch.

> 
> 
>> When --disable-fixincludes is used, then no systen header files
>> are fixed by the tools in fixincludes. Moreover, the fixincludes
>> tools are not built any longer.
> 
> typo: s/systen/system/

Fixed.

> 
> 
> Could you please check that a post-install mkheaders still has a
> functional limits.h with these changes?

How do I check that, please?

> The patch is ok (with the typo
> fixes) if so.  The cleanups it enables would be welcome as separate
> patches ;-)

Can I install the v2?

Martin

> 
> Thanks!
> 

[-- Attachment #2: 0001-Support-disable-fixincludes.patch --]
[-- Type: text/x-patch, Size: 4791 bytes --]

From d06f931329c456821acac45aa3d89922183161bc Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Tue, 24 May 2022 13:06:07 +0200
Subject: [PATCH] Support --disable-fixincludes.

Always install limits.h and syslimits.h header files
to include folder.

When --disable-fixincludes is used, then no system header files
are fixed by the tools in fixincludes. Moreover, the fixincludes
tools are not built any longer.

gcc/ChangeLog:

	* Makefile.in: Always install limits.h and syslimits.h to
	include folder.
	* configure.ac: Assign STMP_FIXINC blank if
	--disable-fixincludes is used.
	* configure: Regenerate.
---
 gcc/Makefile.in  | 30 +++++++++++++-----------------
 gcc/configure    | 10 ++++++++--
 gcc/configure.ac |  6 ++++++
 3 files changed, 27 insertions(+), 19 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 3ae23702426..b7883254324 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3164,24 +3164,27 @@ stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(T_STDINT_GCC_H) $(USER_H) fixinc_
 	set -e; for ml in `cat fixinc_list`; do \
 	  sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
 	  multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
-	  fix_dir=include-fixed$${multi_dir}; \
+	  include_dir=include$${multi_dir}; \
 	  if $(LIMITS_H_TEST) ; then \
 	    cat $(srcdir)/limitx.h $(T_GLIMITS_H) $(srcdir)/limity.h > tmp-xlimits.h; \
 	  else \
 	    cat $(T_GLIMITS_H) > tmp-xlimits.h; \
 	  fi; \
-	  $(mkinstalldirs) $${fix_dir}; \
-	  chmod a+rx $${fix_dir} || true; \
+	  $(mkinstalldirs) $${include_dir}; \
+	  chmod a+rx $${include_dir} || true; \
 	  $(SHELL) $(srcdir)/../move-if-change \
 	    tmp-xlimits.h  tmp-limits.h; \
-	  rm -f $${fix_dir}/limits.h; \
-	  cp -p tmp-limits.h $${fix_dir}/limits.h; \
-	  chmod a+r $${fix_dir}/limits.h; \
+	  rm -f $${include_dir}/limits.h; \
+	  cp -p tmp-limits.h $${include_dir}/limits.h; \
+	  chmod a+r $${include_dir}/limits.h; \
+	  cp $(srcdir)/gsyslimits.h $${include_dir}/syslimits.h; \
 	done
 # Install the README
-	rm -f include-fixed/README
-	cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
-	chmod a+r include-fixed/README
+	if [ x$(STMP_FIXINC) != x ]; then \
+	  rm -f include-fixed/README; \
+	  cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README; \
+	  chmod a+r include-fixed/README; \
+	fi;
 	$(STAMP) $@
 
 .PHONY: install-gcc-tooldir
@@ -3266,13 +3269,6 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
 	      cd $(build_objdir)/fixincludes && \
 	      $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
 	        $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
-	    rm -f $${fix_dir}/syslimits.h; \
-	    if [ -f $${fix_dir}/limits.h ]; then \
-	      mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \
-	    else \
-	      cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \
-	    fi; \
-	    chmod a+r $${fix_dir}/syslimits.h; \
 	  done; \
 	fi
 	$(STAMP) stmp-fixinc
@@ -3990,7 +3986,7 @@ install-mkheaders: stmp-int-hdrs install-itoolsdirs \
 	set -e; for ml in `cat fixinc_list`; do \
 	  multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
 	  $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
-	  $(INSTALL_DATA) include-fixed$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
+	  $(INSTALL_DATA) include$${multi_dir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
 	done
 	$(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
 		$(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
diff --git a/gcc/configure b/gcc/configure
index 62872d132ea..bd9408e0613 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -13548,6 +13548,12 @@ then
     BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
 fi
 
+
+if test x$enable_fixincludes = xno;
+then
+    STMP_FIXINC=''
+fi
+
 # Expand extra_headers to include complete path.
 # This substitutes for lots of t-* files.
 extra_headers_list=
@@ -19674,7 +19680,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19679 "configure"
+#line 19683 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19780,7 +19786,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19785 "configure"
+#line 19789 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 446747311a6..9bec9cf9c85 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2501,6 +2501,12 @@ then
     BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
 fi
 
+
+if test x$enable_fixincludes = xno;
+then
+    STMP_FIXINC=''
+fi
+
 # Expand extra_headers to include complete path.
 # This substitutes for lots of t-* files.
 extra_headers_list=
-- 
2.36.1


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

* Re: [PATCH v2] Support --disable-fixincludes.
  2022-07-08 11:14                       ` Martin Liška
@ 2022-07-09 16:11                         ` Jeff Law
  2022-08-31  4:30                           ` Xi Ruoyao
  0 siblings, 1 reply; 27+ messages in thread
From: Jeff Law @ 2022-07-09 16:11 UTC (permalink / raw)
  To: gcc-patches



On 7/8/2022 5:14 AM, Martin Liška wrote:
> On 5/25/22 07:37, Alexandre Oliva wrote:
>> On May 24, 2022, Martin Liška <mliska@suse.cz> wrote:
>>
>>> Allways install limits.h and syslimits.h header files
>>> to include folder.
>> typo: s/Allways/Always/
> Hello.
>
> Fixed.
>
>> I'm a little worried about this bit, too.  limitx.h includes
>> "syslimits.h", mentioning it should be in the same directory.  Perhaps
>> it could be left in include-fixed?
> Well, I would like to go w/o include-fixed if the option --disable-fixincludes is used.
>
>> The patch also changes syslimits.h from either the fixincluded file or
>> gsyslimits.h to use gsyslimits.h unconditionally, which seemed wrong at
>> first.
>>
>> Now I see how these two hunks work together: syslimits.h will now always
>> #include_next <limits.h>, which will find it in include-fixed if it's
>> there, and system header files otherwise.  Nice!, but IMHO the commit
>> message could be a little more verbose on the extent of the change and
>> why that (is supposed to) work.
> Oh, to be honest I'm not fully familiar with how these 2 files work together.
> Can you explain it to me so that I can adjust the changelog entry correspondingly?
>
>>
>> It also looks like install-mkheaders installs limits-related headers for
>> when fixincludes runs; we could probably skip the whole thing if
>> fixincludes is disabled, but I'm also worried about how the changes
>> above might impact post-install fixincludes: if that installs
>> gsyslimits.h et al in include-fixed while your changes moves it to
>> include, headers might end up in a confusing state.  I haven't worked
>> out whether that's safe, but there appears to be room for cleanups
>> there.
> I've check that 'make install-mkheaders' work fine w/ and w/o --disable-fixincludes
> after the patch.
>
>> gcc/config/mips/t-sdemtk also places syslimits.h explicitly in include/
>> rather than include-fixed/, as part of disabling fixincludes, which is
>> good, but it could be cleaned up as well.
> Can we do that as a follow-up patch?
>
>> I don't see other config fragments that might require adjustments, so I
>> think the patch looks good; hopefully my worries are unjustified, and
>> the cleanups it enables could be
> Good.
>
>>
>> We still create the README file in there and install it, even with
>> fixincludes disabled and thus unavailable, don't we?  That README then
>> becomes misleading; we might be better off not installing it.
> Sure, fixed in v2 of the patch.
>
>>
>>> When --disable-fixincludes is used, then no systen header files
>>> are fixed by the tools in fixincludes. Moreover, the fixincludes
>>> tools are not built any longer.
>> typo: s/systen/system/
> Fixed.
>
>>
>> Could you please check that a post-install mkheaders still has a
>> functional limits.h with these changes?
> How do I check that, please?
>
>> The patch is ok (with the typo
>> fixes) if so.  The cleanups it enables would be welcome as separate
>> patches ;-)
> Can I install the v2?
Once Alex is OK with this patch, then it'll be good to go.

jeff

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

* Re: [PATCH v2] Support --disable-fixincludes.
  2022-07-09 16:11                         ` Jeff Law
@ 2022-08-31  4:30                           ` Xi Ruoyao
  2022-08-31  4:30                             ` Xi Ruoyao
  2022-08-31 15:25                             ` Alexandre Oliva
  0 siblings, 2 replies; 27+ messages in thread
From: Xi Ruoyao @ 2022-08-31  4:30 UTC (permalink / raw)
  To: Jeff Law, gcc-patches; +Cc: Alexandre Oliva

On Sat, 2022-07-09 at 10:11 -0600, Jeff Law via Gcc-patches wrote:

> Once Alex is OK with this patch, then it'll be good to go.
> 
> jeff

Gentle ping as a distro maintainer :).

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

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

* Re: [PATCH v2] Support --disable-fixincludes.
  2022-08-31  4:30                           ` Xi Ruoyao
@ 2022-08-31  4:30                             ` Xi Ruoyao
  2022-08-31 15:25                             ` Alexandre Oliva
  1 sibling, 0 replies; 27+ messages in thread
From: Xi Ruoyao @ 2022-08-31  4:30 UTC (permalink / raw)
  To: Jeff Law, gcc-patches

On Sat, 2022-07-09 at 10:11 -0600, Jeff Law via Gcc-patches wrote:

> Once Alex is OK with this patch, then it'll be good to go.
> 
> jeff

Gentle ping as a distro maintainer :).

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

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

* Re: [PATCH v2] Support --disable-fixincludes.
  2022-08-31  4:30                           ` Xi Ruoyao
  2022-08-31  4:30                             ` Xi Ruoyao
@ 2022-08-31 15:25                             ` Alexandre Oliva
  1 sibling, 0 replies; 27+ messages in thread
From: Alexandre Oliva @ 2022-08-31 15:25 UTC (permalink / raw)
  To: Xi Ruoyao, Martin Liška; +Cc: Jeff Law, gcc-patches

On Aug 31, 2022, Xi Ruoyao <xry111@xry111.site> wrote:

> On Sat, 2022-07-09 at 10:11 -0600, Jeff Law via Gcc-patches wrote:
>> Once Alex is OK with this patch, then it'll be good to go.
>> 
>> jeff

> Gentle ping as a distro maintainer :).

Oops, thanks, sorry, I seem to have missed it the first time around.

The patch looks good to me, thanks Martin,

-- 
Alexandre Oliva, happy hacker                https://FSFLA.org/blogs/lxo/
   Free Software Activist                       GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-05  2:26         ` Allan McRae
@ 2022-02-28  8:36           ` Martin Liška
  0 siblings, 0 replies; 27+ messages in thread
From: Martin Liška @ 2022-02-28  8:36 UTC (permalink / raw)
  To: Allan McRae, Jakub Jelinek, Richard Biener; +Cc: GCC Patches

On 2/5/22 03:26, Allan McRae wrote:
> On 5/2/22 01:22, Martin Liška wrote:
>> On 2/4/22 14:30, Jakub Jelinek via Gcc-patches wrote:
>>> We don't ship any include-fixed headers in Fedora/RHEL.
>>
>> Removing include-fixed from an installed folder, I see:
>>
>> make[2]: Entering directory '/home/marxin/Programming/postgres/src/common'
>> gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O3 -march=native -flto=auto -DFRONTEND -I. -I../../src/common -I../../src/include  -D_GNU_SOURCE -DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE\"" -DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O3 -march=native -flto=auto\"" -DVAL_CFLAGS_SL="\"-fPIC\"" -DVAL_LDFLAGS="\"-O3 -march=native -flto=auto -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib64',--enable-new-dtags\"" -DVAL_LDFLAGS_EX="\"\"" 
>> -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon -lpgport -lz -lreadline -lm \""  -c -o pg_lzcompress.o pg_lzcompress.c
>> In file included from pg_lzcompress.c:186:
>> /usr/include/limits.h:124:26: error: no include path in which to search for limits.h
>>    124 | # include_next <limits.h>
>>        |                          ^
>> pg_lzcompress.c:226:9: error: ‘INT_MAX’ undeclared here (not in a function)
>>    226 |         INT_MAX,                                        /* No upper limit on what we'll try to
>>        |         ^~~~~~~
>> pg_lzcompress.c:189:1: note: ‘INT_MAX’ is defined in header ‘<limits.h>’; did you forget to ‘#include <limits.h>’?
>>    188 | #include "common/pg_lzcompress.h"
>>    +++ |+#include <limits.h>
>>
>> How do you solve this in Fedora/RHEL?
> 
> The Fedora gcc.spec file has this:
> 
> mv $FULLPATH/include-fixed/syslimits.h $FULLPATH/include/syslimits.h
> mv $FULLPATH/include-fixed/limits.h $FULLPATH/include/limits.h

Yes, I noticed that as well.

> 
> My understanding are these are not real fixinclude processed headers.

You are correct. I've just prepared a patch that would exclude these 2 header files
from include-fixed. I'm planning the patch for next stage1.

Martin

> 
> Allan


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 15:22       ` Martin Liška
@ 2022-02-05  2:26         ` Allan McRae
  2022-02-28  8:36           ` Martin Liška
  0 siblings, 1 reply; 27+ messages in thread
From: Allan McRae @ 2022-02-05  2:26 UTC (permalink / raw)
  To: Martin Liška, Jakub Jelinek, Richard Biener; +Cc: GCC Patches

On 5/2/22 01:22, Martin Liška wrote:
> On 2/4/22 14:30, Jakub Jelinek via Gcc-patches wrote:
>> We don't ship any include-fixed headers in Fedora/RHEL.
> 
> Removing include-fixed from an installed folder, I see:
> 
> make[2]: Entering directory '/home/marxin/Programming/postgres/src/common'
> gcc -Wall -Wmissing-prototypes -Wpointer-arith 
> -Wdeclaration-after-statement -Werror=vla -Wendif-labels 
> -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type 
> -Wformat-security -fno-strict-aliasing -fwrapv 
> -fexcess-precision=standard -Wno-format-truncation 
> -Wno-stringop-truncation -O3 -march=native -flto=auto -DFRONTEND -I. 
> -I../../src/common -I../../src/include  -D_GNU_SOURCE  
> -DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE\"" 
> -DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpointer-arith 
> -Wdeclaration-after-statement -Werror=vla -Wendif-labels 
> -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type 
> -Wformat-security -fno-strict-aliasing -fwrapv 
> -fexcess-precision=standard -Wno-format-truncation 
> -Wno-stringop-truncation -O3 -march=native -flto=auto\"" 
> -DVAL_CFLAGS_SL="\"-fPIC\"" -DVAL_LDFLAGS="\"-O3 -march=native 
> -flto=auto -Wl,--as-needed 
> -Wl,-rpath,'/usr/local/pgsql/lib64',--enable-new-dtags\"" 
> -DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon 
> -lpgport -lz -lreadline -lm \""  -c -o pg_lzcompress.o pg_lzcompress.c
> In file included from pg_lzcompress.c:186:
> /usr/include/limits.h:124:26: error: no include path in which to search 
> for limits.h
>    124 | # include_next <limits.h>
>        |                          ^
> pg_lzcompress.c:226:9: error: ‘INT_MAX’ undeclared here (not in a function)
>    226 |         INT_MAX,                                        /* No 
> upper limit on what we'll try to
>        |         ^~~~~~~
> pg_lzcompress.c:189:1: note: ‘INT_MAX’ is defined in header 
> ‘<limits.h>’; did you forget to ‘#include <limits.h>’?
>    188 | #include "common/pg_lzcompress.h"
>    +++ |+#include <limits.h>
> 
> How do you solve this in Fedora/RHEL?

The Fedora gcc.spec file has this:

mv $FULLPATH/include-fixed/syslimits.h $FULLPATH/include/syslimits.h
mv $FULLPATH/include-fixed/limits.h $FULLPATH/include/limits.h

My understanding are these are not real fixinclude processed headers.

Allan

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 13:30     ` Jakub Jelinek
  2022-02-04 15:01       ` Martin Liška
@ 2022-02-04 15:22       ` Martin Liška
  2022-02-05  2:26         ` Allan McRae
  1 sibling, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-02-04 15:22 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Biener; +Cc: GCC Patches

On 2/4/22 14:30, Jakub Jelinek via Gcc-patches wrote:
> We don't ship any include-fixed headers in Fedora/RHEL.

Removing include-fixed from an installed folder, I see:

make[2]: Entering directory '/home/marxin/Programming/postgres/src/common'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O3 -march=native -flto=auto -DFRONTEND -I. -I../../src/common -I../../src/include  -D_GNU_SOURCE  -DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE\"" -DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O3 -march=native -flto=auto\"" -DVAL_CFLAGS_SL="\"-fPIC\"" -DVAL_LDFLAGS="\"-O3 -march=native -flto=auto -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib64',--enable-new-dtags\"" -DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon -lpgport -lz -lreadline -lm \""  -c -o pg_lzcompress.o pg_lzcompress.c
In file included from pg_lzcompress.c:186:
/usr/include/limits.h:124:26: error: no include path in which to search for limits.h
   124 | # include_next <limits.h>
       |                          ^
pg_lzcompress.c:226:9: error: ‘INT_MAX’ undeclared here (not in a function)
   226 |         INT_MAX,                                        /* No upper limit on what we'll try to
       |         ^~~~~~~
pg_lzcompress.c:189:1: note: ‘INT_MAX’ is defined in header ‘<limits.h>’; did you forget to ‘#include <limits.h>’?
   188 | #include "common/pg_lzcompress.h"
   +++ |+#include <limits.h>

How do you solve this in Fedora/RHEL?

Thanks,
Martin

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 13:07 ` Rainer Orth
  2022-02-04 13:25   ` Richard Biener
@ 2022-02-04 15:02   ` Martin Liška
  1 sibling, 0 replies; 27+ messages in thread
From: Martin Liška @ 2022-02-04 15:02 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

On 2/4/22 14:07, Rainer Orth wrote:
> Hi Martin,
> 
>> It seems to me that fixincludes is hardy unused feature for nowadays header
>> files and so I'm suggesting a developer option that can skip the fixing.
> 
> please remember that there's a world beyond current-day Linux.

Sure! That's why I'm suggesting an option and not removing the machinery.

> 
>> How is the feature used on other targets?
> 
> There are still quite a number of fixes on e.g. Solaris or macOS.  And
> people are still building gcc on older OS versions for one reason or
> another...
> 
>> diff --git a/gcc/configure.ac b/gcc/configure.ac
>> index 1171c946e6e..6015e403aa9 100644
>> --- a/gcc/configure.ac
>> +++ b/gcc/configure.ac
>> @@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
>>    AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
>>    [Define to enable detailed memory allocation stats gathering.])
>>    
>> +AC_ARG_ENABLE(disable-fix-includes,
>> +[AS_HELP_STRING([--disable-fix-includes],
> 
> The beast is called fixincludes, no '-' or '_'.
> 
>> +		[skip fixing of includes])], [],
> 
> Better say 'running fixincludes' for example rather than being
> vague/obtuse.

Note using --disable-fixinclude effectively disables building of everything in the folder.
That's not what I want, it breaks GCC build.

> 
> The new options requires documenting in install.texi.
> 
> That said, I'm not sure this is really worth yet adding another option.
> And how are developers supposed to know if they can safely use it or
> not.

Sure.

> 
> Besides, have you actually run a regtest with that option?  I'm asking
> because even on Ubuntu 20.04 fixincludes drops in it's own <limits.h>.
> You need to check that dropping that is actually safe.

Let me try that.

Martin

> 
> 	Rainer
> 


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 13:30     ` Jakub Jelinek
@ 2022-02-04 15:01       ` Martin Liška
  2022-02-04 15:22       ` Martin Liška
  1 sibling, 0 replies; 27+ messages in thread
From: Martin Liška @ 2022-02-04 15:01 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Biener; +Cc: GCC Patches

On 2/4/22 14:30, Jakub Jelinek via Gcc-patches wrote:
> On Fri, Feb 04, 2022 at 02:25:17PM +0100, Richard Biener via Gcc-patches wrote:
>>> Besides, have you actually run a regtest with that option?  I'm asking
>>> because even on Ubuntu 20.04 fixincludes drops in it's own <limits.h>.
>>> You need to check that dropping that is actually safe.
>>
>> limits.h and syslimits.h are the only include-fixed we "ship" in our
>> packages.  Not sure if they are really required though.
> 
> We don't ship any include-fixed headers in Fedora/RHEL.
> If there is an important need for fixing, it should be in Linux
> distributions fixed by actually fixing the headers in their corresponding
> packages, making modified copies of headers at gcc build time and overriding
> through that headers from other packages that can change doesn't really work
> properly when those headers ever change.  I know we could install the
> fixincludes tool and trigger running it whenever any of such headers change
> in other packages, but that is very expensive for very little gain.

I fully agree with the suggested approach! I've also noticed the script makes
modifications in comments (that are unnecessary), plus it effectively breaks
header files for things like:

$ diff /usr/lib64/gcc/aarch64-suse-linux/11/include-fixed/bits/unistd_ext.h /usr/aarch64-suse-linux/sys-root/usr/include/bits/unistd_ext.h

46c37
< # if __has_include ("__linux__/close_range.h")
---
> # if __has_include ("linux/close_range.h")

I would suggest removing the fixed includes in openSUSE as well?

Martin

> 
> On other targets I understand fixincludes is much more important.
> 
> 	Jakub
> 


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 13:25   ` Richard Biener
@ 2022-02-04 13:30     ` Jakub Jelinek
  2022-02-04 15:01       ` Martin Liška
  2022-02-04 15:22       ` Martin Liška
  0 siblings, 2 replies; 27+ messages in thread
From: Jakub Jelinek @ 2022-02-04 13:30 UTC (permalink / raw)
  To: Richard Biener; +Cc: Rainer Orth, GCC Patches

On Fri, Feb 04, 2022 at 02:25:17PM +0100, Richard Biener via Gcc-patches wrote:
> > Besides, have you actually run a regtest with that option?  I'm asking
> > because even on Ubuntu 20.04 fixincludes drops in it's own <limits.h>.
> > You need to check that dropping that is actually safe.
> 
> limits.h and syslimits.h are the only include-fixed we "ship" in our
> packages.  Not sure if they are really required though.

We don't ship any include-fixed headers in Fedora/RHEL.
If there is an important need for fixing, it should be in Linux
distributions fixed by actually fixing the headers in their corresponding
packages, making modified copies of headers at gcc build time and overriding
through that headers from other packages that can change doesn't really work
properly when those headers ever change.  I know we could install the
fixincludes tool and trigger running it whenever any of such headers change
in other packages, but that is very expensive for very little gain.

On other targets I understand fixincludes is much more important.

	Jakub


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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 13:07 ` Rainer Orth
@ 2022-02-04 13:25   ` Richard Biener
  2022-02-04 13:30     ` Jakub Jelinek
  2022-02-04 15:02   ` Martin Liška
  1 sibling, 1 reply; 27+ messages in thread
From: Richard Biener @ 2022-02-04 13:25 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Martin Liška, GCC Patches

On Fri, Feb 4, 2022 at 2:08 PM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> Hi Martin,
>
> > It seems to me that fixincludes is hardy unused feature for nowadays header
> > files and so I'm suggesting a developer option that can skip the fixing.
>
> please remember that there's a world beyond current-day Linux.
>
> > How is the feature used on other targets?
>
> There are still quite a number of fixes on e.g. Solaris or macOS.  And
> people are still building gcc on older OS versions for one reason or
> another...
>
> > diff --git a/gcc/configure.ac b/gcc/configure.ac
> > index 1171c946e6e..6015e403aa9 100644
> > --- a/gcc/configure.ac
> > +++ b/gcc/configure.ac
> > @@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
> >   AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
> >   [Define to enable detailed memory allocation stats gathering.])
> >
> > +AC_ARG_ENABLE(disable-fix-includes,
> > +[AS_HELP_STRING([--disable-fix-includes],
>
> The beast is called fixincludes, no '-' or '_'.
>
> > +             [skip fixing of includes])], [],
>
> Better say 'running fixincludes' for example rather than being
> vague/obtuse.
>
> The new options requires documenting in install.texi.
>
> That said, I'm not sure this is really worth yet adding another option.
> And how are developers supposed to know if they can safely use it or
> not.
>
> Besides, have you actually run a regtest with that option?  I'm asking
> because even on Ubuntu 20.04 fixincludes drops in it's own <limits.h>.
> You need to check that dropping that is actually safe.

limits.h and syslimits.h are the only include-fixed we "ship" in our
packages.  Not sure if they are really required though.

Richard.

>
>         Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH] configure: add --disable-fix-includes
  2022-02-04 12:52 [PATCH] configure: add --disable-fix-includes Martin Liška
@ 2022-02-04 13:07 ` Rainer Orth
  2022-02-04 13:25   ` Richard Biener
  2022-02-04 15:02   ` Martin Liška
  0 siblings, 2 replies; 27+ messages in thread
From: Rainer Orth @ 2022-02-04 13:07 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

Hi Martin,

> It seems to me that fixincludes is hardy unused feature for nowadays header
> files and so I'm suggesting a developer option that can skip the fixing.

please remember that there's a world beyond current-day Linux.

> How is the feature used on other targets?

There are still quite a number of fixes on e.g. Solaris or macOS.  And
people are still building gcc on older OS versions for one reason or
another...

> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 1171c946e6e..6015e403aa9 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
>   AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
>   [Define to enable detailed memory allocation stats gathering.])
>   
> +AC_ARG_ENABLE(disable-fix-includes,
> +[AS_HELP_STRING([--disable-fix-includes],

The beast is called fixincludes, no '-' or '_'.

> +		[skip fixing of includes])], [],

Better say 'running fixincludes' for example rather than being
vague/obtuse.

The new options requires documenting in install.texi.

That said, I'm not sure this is really worth yet adding another option.
And how are developers supposed to know if they can safely use it or
not.

Besides, have you actually run a regtest with that option?  I'm asking
because even on Ubuntu 20.04 fixincludes drops in it's own <limits.h>.
You need to check that dropping that is actually safe.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* [PATCH] configure: add --disable-fix-includes
@ 2022-02-04 12:52 Martin Liška
  2022-02-04 13:07 ` Rainer Orth
  0 siblings, 1 reply; 27+ messages in thread
From: Martin Liška @ 2022-02-04 12:52 UTC (permalink / raw)
  To: gcc-patches

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

Hello.

It seems to me that fixincludes is hardy unused feature for nowadays header
files and so I'm suggesting a developer option that can skip the fixing.

How is the feature used on other targets?

Right now, fixinclude takes about 11 seconds on my machine, where
it reads (and applies regexes) 130MB of header files.

The number of fixed headers is negligible without any significant
change. I'm attaching diff that I can see on my developer machine.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

fixincludes/ChangeLog:

	* fixinc.in: Add early exit.

gcc/ChangeLog:

	* Makefile.in: Support disable_fix_includes.
	* configure.ac: Add --disable-fix-includes.
	* configure: Regenerate.
---
  fixincludes/fixinc.in |  6 ++++++
  gcc/Makefile.in       |  6 ++++--
  gcc/configure         | 21 +++++++++++++++++++--
  gcc/configure.ac      |  6 ++++++
  4 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index 0c3066452c6..3ebcd346d41 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -63,6 +63,12 @@ else
    esac
  fi
  
+if test "x$DISABLE_FIX_INCLUDES" = "xyes"
+then
+  echo "Skipping fixincludes"
+  exit 0
+fi
+
  # Define what target system we're fixing.
  #
  if test -r ./Makefile; then
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 31ff95500c9..c77f1cc644d 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -401,6 +401,8 @@ PLUGINLIBS = @pluginlibs@
  
  enable_plugin = @enable_plugin@
  
+disable_fix_includes = @disable_fix_includes@
+
  # On MinGW plugin installation involves installing import libraries.
  ifeq ($(enable_plugin),yes)
    plugin_implib := $(if $(strip $(filter mingw%,$(host_os))),yes,no)
@@ -3248,8 +3250,8 @@ stmp-fixinc: gsyslimits.h macro_list fixinc_list \
  	    chmod a+rx $${fix_dir} || true; \
  	    (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
  	      SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
-	      gcc_dir=`${PWD_COMMAND}` ; \
-	      export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
+	      gcc_dir=`${PWD_COMMAND}` ; DISABLE_FIX_INCLUDES=${disable_fix_includes} \
+	      export TARGET_MACHINE srcdir SHELL MACRO_LIST DISABLE_FIX_INCLUDES && \
  	      cd $(build_objdir)/fixincludes && \
  	      $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
  	        $(BUILD_SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
diff --git a/gcc/configure b/gcc/configure
index bd4d4721868..843ab02bfa3 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -839,6 +839,7 @@ with_float
  with_cpu
  enable_multiarch
  enable_multilib
+disable_fix_includes
  coverage_flags
  valgrind_command
  valgrind_path_defines
@@ -958,6 +959,7 @@ enable_werror_always
  enable_checking
  enable_coverage
  enable_gather_detailed_mem_stats
+enable_disable_fix_includes
  enable_valgrind_annotations
  enable_multilib
  enable_multiarch
@@ -1688,6 +1690,7 @@ Optional Features:
                            Values are opt, noopt, default is noopt
    --enable-gather-detailed-mem-stats
                            enable detailed memory allocation stats gathering
+  --disable-fix-includes  skip fixing of includes
    --enable-valgrind-annotations
                            enable valgrind runtime interaction
    --enable-multilib       enable library support for multiple ABIs
@@ -7780,6 +7783,20 @@ cat >>confdefs.h <<_ACEOF
  _ACEOF
  
  
+# Check whether --enable-disable-fix-includes was given.
+if test "${enable_disable_fix_includes+set}" = set; then :
+  enableval=$enable_disable_fix_includes;
+else
+  disable_fix_includes=yes
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define FIX_INCLUDES $disable_fix_includes
+_ACEOF
+
+
+
  # Check whether --enable-valgrind-annotations was given.
  if test "${enable_valgrind_annotations+set}" = set; then :
    enableval=$enable_valgrind_annotations;
@@ -19659,7 +19676,7 @@ else
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
-#line 19662 "configure"
+#line 19679 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
@@ -19765,7 +19782,7 @@ else
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
-#line 19768 "configure"
+#line 19785 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 1171c946e6e..6015e403aa9 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -842,6 +842,12 @@ gather_stats=`if test $enable_gather_detailed_mem_stats != no; then echo 1; else
  AC_DEFINE_UNQUOTED(GATHER_STATISTICS, $gather_stats,
  [Define to enable detailed memory allocation stats gathering.])
  
+AC_ARG_ENABLE(disable-fix-includes,
+[AS_HELP_STRING([--disable-fix-includes],
+		[skip fixing of includes])], [],
+[disable_fix_includes=yes])
+AC_SUBST(disable_fix_includes)
+
  AC_ARG_ENABLE(valgrind-annotations,
  [AS_HELP_STRING([--enable-valgrind-annotations],
  		[enable valgrind runtime interaction])], [],
-- 
2.35.1

[-- Attachment #2: fixincludes.diff --]
[-- Type: text/x-patch, Size: 9082 bytes --]

--- /usr/include/X11/Xw32defs.h	2022-01-07 13:52:15.000000000 +0100
+++ include-fixed/X11/Xw32defs.h	2022-02-04 07:55:06.956493417 +0100
@@ -1,7 +1,16 @@
 #ifndef _XW32DEFS_H
 # define  _XW32DEFS_H
 
-# ifdef __GNUC__ /* mingw is more close to unix than msvc */
+# ifdef __GNUC__ /* mingw is more close to __unix__ than msvc */
 #  if !defined(__daddr_t_defined)
 typedef char *caddr_t;
 #  endif
--- /usr/include/boost/predef/os/unix.h	2022-01-07 16:20:53.000000000 +0100
+++ include-fixed/boost/predef/os/unix.h	2022-02-04 07:55:06.564496142 +0100
@@ -1,3 +1,12 @@
 /*
 Copyright Rene Rivera 2008-2015
 Distributed under the Boost Software License, Version 1.0.
@@ -29,7 +38,7 @@
 
 #define BOOST_OS_UNIX BOOST_VERSION_NUMBER_NOT_AVAILABLE
 
-#if defined(unix) || defined(__unix) || \
+#if defined(__unix__) || defined(__unix) || \
     defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
 #   undef BOOST_OS_UNIX
 #   define BOOST_OS_UNIX BOOST_VERSION_NUMBER_AVAILABLE
--- /usr/include/schily/prototyp.h	2022-01-07 15:51:33.000000000 +0100
+++ include-fixed/schily/prototyp.h	2022-02-04 07:55:04.260512155 +0100
@@ -1,3 +1,12 @@
 /*
  *	Definitions for dealing with ANSI / KR C-Compilers
@@ -54,7 +63,7 @@
 #		if	__STDC__				/* ANSI C */
 #			define	PROTOTYPES
 #		endif
-#		if	defined(sun) && __STDC__ - 0 == 0	/* Sun C */
+#		if	defined(sun) &&  !defined(__STRICT_ANSI__)	/* Sun C */
 #			define	PROTOTYPES
 #		endif
 #	endif
--- /usr/include/schily/mconfig.h	2022-01-07 15:51:33.000000000 +0100
+++ include-fixed/schily/mconfig.h	2022-02-04 07:55:04.244512265 +0100
@@ -1,3 +1,12 @@
 /*
  *	definitions for machine configuration
@@ -106,7 +115,7 @@
 #	define	IS_GCC_WIN32
 #	define	IS_CYGWIN
 
-#if	defined(unix) || defined(_X86)
+#if	defined(__unix__) || defined(_X86)
 #	define	IS_CYGWIN_1
 #endif
 #endif
--- /usr/include/nss3/secport.h	2022-01-26 21:37:21.000000000 +0100
+++ include-fixed/nss3/secport.h	2022-02-04 07:55:04.232512351 +0100
@@ -1,3 +1,12 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -33,7 +42,7 @@
 #endif
 #endif
 
-#ifdef unix
+#ifdef __unix__
 #ifndef XP_UNIX
 #define XP_UNIX
 #endif
--- /usr/include/msgpack/predef/os/unix.h	2019-07-04 06:36:12.000000000 +0200
+++ include-fixed/msgpack/predef/os/unix.h	2022-02-04 07:55:03.136519966 +0100
@@ -1,3 +1,12 @@
 Copyright Rene Rivera 2008-2015
 Distributed under the Boost Software License, Version 1.0.
@@ -28,7 +37,7 @@
 
 #define MSGPACK_OS_UNIX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
 
-#if defined(unix) || defined(__unix) || \
+#if defined(__unix__) || defined(__unix) || \
     defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
 #   undef MSGPACK_OS_UNIX
 #   define MSGPACK_OS_UNIX MSGPACK_VERSION_NUMBER_AVAILABLE
--- /usr/include/msgpack/predef/os/linux.h	2019-07-04 06:36:12.000000000 +0200
+++ include-fixed/msgpack/predef/os/linux.h	2022-02-04 07:55:03.136519966 +0100
@@ -1,3 +1,12 @@
 Copyright Rene Rivera 2008-2015
 Distributed under the Boost Software License, Version 1.0.
@@ -27,7 +36,7 @@
 #define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
 
 #if !defined(MSGPACK_PREDEF_DETAIL_OS_DETECTED) && ( \
-    defined(linux) || defined(__linux) \
+    defined(__linux__) || defined(__linux) \
     )
 #   undef MSGPACK_OS_LINUX
 #   define MSGPACK_OS_LINUX MSGPACK_VERSION_NUMBER_AVAILABLE
--- /usr/include/msgpack/sysdep.h	2020-02-19 10:21:46.000000000 +0100
+++ include-fixed/msgpack/sysdep.h	2022-02-04 07:55:03.124520052 +0100
@@ -1,3 +1,12 @@
  * MessagePack system dependencies
  *
@@ -87,7 +96,7 @@
 #elif defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
 
 #include <arpa/inet.h>  /* __BYTE_ORDER */
-#   if defined(linux)
+#   if defined(__linux__)
 #       include <byteswap.h>
 #   endif
 
@@ -99,7 +108,7 @@
 
 #if MSGPACK_ENDIAN_LITTLE_BYTE
 
-#   if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
+#   if defined(__unix__) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
 #       define _msgpack_be16(x) ntohs((uint16_t)x)
 #   else
 #       if defined(ntohs)
@@ -113,7 +122,7 @@
 #        endif
 #   endif
 
-#   if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
+#   if defined(__unix__) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__)
 #       define _msgpack_be32(x) ntohl((uint32_t)x)
 #   else
 #       if defined(ntohl)
--- /usr/include/msgpack/vrefbuffer.h	2020-02-19 10:21:46.000000000 +0100
+++ include-fixed/msgpack/vrefbuffer.h	2022-02-04 07:55:03.124520052 +0100
@@ -1,3 +1,12 @@
  * MessagePack for C zero-copy buffer implementation
  *
@@ -13,7 +22,7 @@
 #include "zone.h"
 #include <stdlib.h>
 
-#if defined(unix) || defined(__unix) || defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) || defined(__QNXTO__) || defined(__HAIKU__)
+#if defined(__unix__) || defined(__unix) || defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) || defined(__QNXTO__) || defined(__HAIKU__)
 #include <sys/uio.h>
 #else
 struct iovec {
--- /usr/include/xorg/compiler.h	2022-01-07 20:21:20.000000000 +0100
+++ include-fixed/xorg/compiler.h	2022-02-04 07:55:02.816522192 +0100
@@ -1,3 +1,12 @@
  * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
  *
@@ -936,7 +945,7 @@
 #endif                          /* arch madness */
 
 #else                           /* !GNUC */
-#if defined(__STDC__) && (__STDC__ == 1)
+#if defined(__STDC__) && ( defined(__STRICT_ANSI__))
 #ifndef asm
 #define asm __asm
 #endif
--- /usr/include/xorg/edid.h	2022-01-07 20:21:20.000000000 +0100
+++ include-fixed/xorg/edid.h	2022-02-04 07:55:02.812522221 +0100
@@ -1,3 +1,12 @@
  * edid.h: defines to parse an EDID block
  *
@@ -336,7 +345,7 @@
 #define ADD_DUMMY 0x10
 
 #define _NEXT_DT_MD_SECTION(x) (x = (x + DET_TIMING_INFO_LEN))
-#define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION(c)
+#define NEXT_DT_MD_SECTION _NEXT_DT_MD_SECTION('c')
 
 #endif                          /* _PARSE_EDID_ */
 
--- /usr/include/smbios_c/config/suffix.h	2022-01-07 18:58:09.000000000 +0100
+++ include-fixed/smbios_c/config/suffix.h	2022-02-04 07:55:01.748529615 +0100
@@ -1,3 +1,12 @@
 
 //  (C) Copyright John Maddock 2001 - 2003.
@@ -178,7 +187,7 @@
 #     define LIBSMBIOS_C_STDLIB "Unknown ISO standard library"
 #  endif
 #  ifndef LIBSMBIOS_C_PLATFORM
-#     if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
+#     if defined(__unix__) || defined(__unix) || defined(_XOPEN_SOURCE) \
          || defined(_POSIX_SOURCE)
 #        define LIBSMBIOS_C_PLATFORM "Generic Unix"
 #     else
--- /usr/include/zutil.h	2022-01-07 13:52:59.000000000 +0100
+++ include-fixed/zutil.h	2022-02-04 07:55:06.592495947 +0100
@@ -1,3 +1,12 @@
  * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
@@ -86,7 +95,7 @@
 #  define OS_CODE  0x00
 #  ifndef Z_SOLO
 #    if defined(__TURBOC__) || defined(__BORLANDC__)
-#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+#      if ( defined(__STRICT_ANSI__)) && (defined(__LARGE__) || defined(__COMPACT__))
          /* Allow compilation with ANSI keywords only enabled */
          void _Cdecl farfree( void *block );
          void *_Cdecl farmalloc( unsigned long nbytes );
--- /usr/include/slang.h	2022-01-02 16:15:25.000000000 +0100
+++ include-fixed/slang.h	2022-02-04 07:55:04.780508542 +0100
@@ -1,3 +1,12 @@
 #define DAVIS_SLANG_H_
 /* -*- mode: C; mode: fold; -*- */
@@ -43,7 +52,7 @@
 # endif
 #endif /* __watcomc__ */
 
-#if defined(unix) || defined(__unix)
+#if defined(__unix__) || defined(__unix)
 # ifndef __unix__
 #  define __unix__ 1
 # endif
--- /usr/include/libv4lconvert.h	2022-01-07 17:40:48.000000000 +0100
+++ include-fixed/libv4lconvert.h	2022-02-04 07:55:03.332518604 +0100
@@ -1,3 +1,12 @@
 #             (C) 2008 Hans de Goede <hdegoede@redhat.com>
 
@@ -22,7 +31,7 @@
 /* These headers are not needed by us, but by linux/videodev2.h,
    which is broken on some systems and doesn't include them itself :( */
 
-#ifdef linux
+#ifdef __linux__
 #include <sys/time.h>
 #include <linux/types.h>
 #include <linux/ioctl.h>
--- /usr/include/libv4l1-videodev.h	2022-01-07 17:40:50.000000000 +0100
+++ include-fixed/libv4l1-videodev.h	2022-02-04 07:55:02.224526305 +0100
@@ -1,8 +1,17 @@
 #ifndef __LINUX_VIDEODEV_H
 #define __LINUX_VIDEODEV_H
 
-#ifdef linux
+#ifdef __linux__
 #include <linux/ioctl.h>
 #endif
 
--- /usr/include/pthread.h	2022-01-07 13:57:55.000000000 +0100
+++ include-fixed/pthread.h	2022-02-04 07:55:01.684530061 +0100
@@ -1,3 +1,12 @@
    This file is part of the GNU C Library.
 
@@ -770,7 +779,7 @@
 #else
 # define __sigsetjmp_cancel(env, savemask) \
   __sigsetjmp ((struct __jmp_buf_tag *) (void *) (env), (savemask))
-extern int __sigsetjmp (struct __jmp_buf_tag __env[1],
+extern int __sigsetjmp (struct __jmp_buf_tag *__env,
 			int __savemask) __THROWNL;
 #endif
 

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

end of thread, other threads:[~2022-08-31 15:25 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  9:03 [PATCH] configure: add --disable-fix-includes Martin Liška
2022-05-09  9:31 ` Andreas Schwab
2022-05-09 21:14 ` Joseph Myers
2022-05-11 10:55   ` Martin Liška
2022-05-11 11:00     ` Rainer Orth
2022-05-11 11:15       ` Martin Liška
2022-05-11 11:31         ` Rainer Orth
2022-05-11 11:58           ` Martin Liška
2022-05-11 12:48             ` Andreas Schwab
2022-05-11 14:50               ` Martin Liška
2022-05-20 12:42                 ` Alexandre Oliva
2022-05-24 12:05                   ` [PATCH v2] Support --disable-fixincludes Martin Liška
2022-05-25  5:37                     ` Alexandre Oliva
2022-07-08 11:14                       ` Martin Liška
2022-07-09 16:11                         ` Jeff Law
2022-08-31  4:30                           ` Xi Ruoyao
2022-08-31  4:30                             ` Xi Ruoyao
2022-08-31 15:25                             ` Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2022-02-04 12:52 [PATCH] configure: add --disable-fix-includes Martin Liška
2022-02-04 13:07 ` Rainer Orth
2022-02-04 13:25   ` Richard Biener
2022-02-04 13:30     ` Jakub Jelinek
2022-02-04 15:01       ` Martin Liška
2022-02-04 15:22       ` Martin Liška
2022-02-05  2:26         ` Allan McRae
2022-02-28  8:36           ` Martin Liška
2022-02-04 15:02   ` Martin Liška

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).