public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [patch win32]: fix for PR target/41943
@ 2010-07-22 13:27 Ozkan Sezer
  2010-07-22 16:00 ` Richard Henderson
  0 siblings, 1 reply; 34+ messages in thread
From: Ozkan Sezer @ 2010-07-22 13:27 UTC (permalink / raw)
  To: Richard Guenther
  Cc: Kai Tietz, Danny Smith, Richard Henderson, Dave Korn, gcc-patches

>> That's right and therefore I dislike this patch and would prefer to
>> have that one Ozkan mentioned already. The issue is that sysroot &
>> cross- includes come after gcc's internal header, which is causing the
>> pain that it isn't absolutely predicatable, if system-headers are
>> reached or not.
>> By changing the order of gcc's internal to the end of the include
>> chain, it would be solved for all cases.
>
> Well, I think moving gcc headers to the end of the include chain is
> just wrong. ?They are supposed to override host ones (which is
> why they are called "fixincludes"). ?Why not fixinclude mingw?
>
> Richard.
>

The message that is referred to is this :
http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01450.html
... and its subject line is wrong/misleading: The patch contained there
(http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01450/do_fixinclude_later.diff)
moves the gcc-private headers and not the fixed headers.

--
Ozkan

^ permalink raw reply	[flat|nested] 34+ messages in thread
* Re: [patch win32]: fix for PR target/41943
@ 2010-07-22  8:13 Ozkan Sezer
  0 siblings, 0 replies; 34+ messages in thread
From: Ozkan Sezer @ 2010-07-22  8:13 UTC (permalink / raw)
  To: Kai Tietz; +Cc: Danny Smith, Richard Henderson, Dave Korn, gcc-patches

>>> 	(i[34567]86-*-mingw* | x86_64-*-mingw*): Use
>>> 	for float.h post, and for w64 targets stddef.h/stdarg.h pre
>>> 	fixing by include_next.
>> The mingw323 float.h is alrewady prefixed with
>>
>> #include_next<float.h>
>>
>> #ifndef _MINGW_FLOAT_H_
>> #define _MINGW_FLOAT_H_
>>
>> ....
>>
>> Postfixing  #include_next <float.h> onto gcc's float.h causes:
>>
>> gcc -H -Wall f.c
>> . c:\mingw\bin\../lib/gcc/mingw32/4.6.0/../../../../include/float.h
>> .. c:\mingw\bin\../lib/gcc/mingw32/4.6.0/include/float.h
>> In file included from c:\mingw\bin\../lib/gcc/mingw32/4.6.0/../../../../include/
>> float.h:19:0,
>>                  from f.c:1:
>> c:\mingw\bin\../lib/gcc/mingw32/4.6.0/include/float.h:278:24: fatal error: float
>> .h: No such file or directory
>> compilation terminated.
>>
>> Danny
>>
>
> I know. But as the float.h from gcc's internal header always comes
> first in include order, this next_include in system-headers is wrong.
> I tried to move the order of includes, but this patch was rejected. So
> the way to solve this is by pre/post-fixing those headers to make sure
> that by default the system-header is included, too.
> If you prefer to have this change just for w64, I am fine.
>
> Regards,
> Kai

What is in the way for the formerly suggested solution for this,
ie. this one:
http://gcc.gnu.org/ml/gcc-patches/2010-07/msg01450.html
Which seems like a much cleaner solution to me (my opinion, of
course.)

--
Ozkan

^ permalink raw reply	[flat|nested] 34+ messages in thread
* [patch win32]: fix for PR target/41943
@ 2010-07-21 19:38 Kai Tietz
  2010-07-21 20:41 ` Richard Henderson
  0 siblings, 1 reply; 34+ messages in thread
From: Kai Tietz @ 2010-07-21 19:38 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Danny Smith, Dave Korn, GCC Patches

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

Hello Richard,

caused by a recent discussion we had on IRC I implemented this
header-fix by configure/make. By the two new options
user_headers_inc_next_pre and user_headers_inc_next_post it is
possible to specify that internal gcc headers should be decorated by a
prefix/postfix of include_next<header-name>.

As mingw.org don't provide own versions of stddef.h and stdarg.h, I
added those two fixups just for the w64 case.

2010-07-21  Kai Tietz

	PR target/41943
	* Makefile.in (USER_H_INC_NEXT_PRE,
	USER_H_INC_NEXT_POST): New.
	(stmp-int-hdrs): Prefix/postfix headers by include_next.
	* config.gcc (user_headers_inc_next_pre): New.
	(user_headers_inc_next_post): Likewise.
	(i[34567]86-*-mingw* | x86_64-*-mingw*): Use
	for float.h post, and for w64 targets stddef.h/stdarg.h pre
	fixing by include_next.
	* configure.ac (user_headers_inc_next_post): New.
	(user_headers_inc_next_pre): New.
	(user_headers_inc_next_pre_list): New.
	(user_headers_inc_next_post_list): New.
	* configure: Regenerated.

Tested for i686-pc-mingw32, i686-w64-mingw32, and x86_64-w64-mingw32.
Ok for apply?

Regards,
Kai
-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

[-- Attachment #2: mdsim.diff --]
[-- Type: application/octet-stream, Size: 6056 bytes --]

Index: gcc/gcc/Makefile.in
===================================================================
--- gcc.orig/gcc/Makefile.in	2010-07-21 20:09:20.471160100 +0200
+++ gcc/gcc/Makefile.in	2010-07-21 21:19:04.099455400 +0200
@@ -366,6 +366,9 @@ USER_H = $(srcdir)/ginclude/float.h \
 	 $(srcdir)/ginclude/stdfix.h \
 	 $(EXTRA_HEADERS)
 
+USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre_list@
+USER_H_INC_NEXT_POST = @user_headers_inc_next_post_list@
+
 UNWIND_H = $(srcdir)/unwind-generic.h
 
 # The GCC to use for compiling crt*.o.
@@ -4014,6 +4017,21 @@ stmp-int-hdrs: $(STMP_FIXINC) $(USER_H)
 	    chmod a+r include/$$realfile; \
 	  fi; \
 	done
+	for file in .. $(USER_H_INC_NEXT_PRE); do \
+	  if [ X$$file != X.. ]; then \
+            mv include/$$file include/x_$$file; \
+            echo "#include_next <$$file>" >include/$$file; \
+            cat include/x_$$file >>include/$$file; \
+            rm -f include/x_$$file; \
+	    chmod a+r include/$$file; \
+	  fi; \
+	done
+	for file in .. $(USER_H_INC_NEXT_POST); do \
+	  if [ X$$file != X.. ]; then \
+	    echo "#include_next <$$file>" >>include/$$file; \
+	    chmod a+r include/$$file; \
+	  fi; \
+	done
 	rm -f include/unwind.h
 	cp $(UNWIND_H) include/unwind.h
 	chmod a+r include/unwind.h
Index: gcc/gcc/config.gcc
===================================================================
--- gcc.orig/gcc/config.gcc	2010-07-21 20:09:20.376160100 +0200
+++ gcc/gcc/config.gcc	2010-07-21 20:33:43.484845200 +0200
@@ -101,6 +101,12 @@
 #  extra_headers	List of used header files from the directory
 #			config/${cpu_type}.
 #
+#  user_headers_inc_next_pre
+#			List of header file names of internal gcc header
+#			files, which should be prefixed by an include_next.
+#  user_headers_inc_next_post
+#			List of header file names of internal gcc header
+#			files, which should be postfixed by an include_next.
 #  use_gcc_tgmath	If set, add tgmath.h to the list of used header
 #			files.
 #
@@ -171,6 +177,8 @@
 out_file=
 tmake_file=
 extra_headers=
+user_headers_inc_next_pre=
+user_headers_inc_next_post=
 use_gcc_tgmath=yes
 use_gcc_stdint=none
 extra_passes=
@@ -1376,9 +1384,11 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
 		*)
 			;;
 	esac
+	user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
 	# This makes the logic if mingw's or the w64 feature set has to be used
 	case ${target} in
 		*-w64-*)
+			user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h"
 			tm_file="${tm_file} i386/mingw-w64.h"
 			if test x$enable_targets = xall; then
 				tm_defines="${tm_defines} TARGET_BI_ARCH=1"
Index: gcc/gcc/configure
===================================================================
--- gcc.orig/gcc/configure	2010-07-21 20:09:20.412160100 +0200
+++ gcc/gcc/configure	2010-07-21 20:36:04.899933600 +0200
@@ -646,6 +646,8 @@ extra_passes
 extra_parts
 extra_objs
 extra_headers_list
+user_headers_inc_next_post_list
+user_headers_inc_next_pre_list
 extra_gcc_objs
 TM_MULTILIB_EXCEPTIONS_CONFIG
 TM_MULTILIB_CONFIG
@@ -10263,6 +10265,12 @@ then tm_file=$cpu_type/$cpu_type.h; fi
 if test x"$extra_headers" = x
 then extra_headers=; fi
 
+if test x"$user_headers_inc_next_pre" = x
+then user_headers_inc_next_pre=; fi
+
+if test x"$user_headers_inc_next_post" = x
+then user_headers_inc_next_post=; fi
+
 if test x$md_file = x
 then md_file=$cpu_type/$cpu_type.md; fi
 
@@ -11003,6 +11011,16 @@ if test x"$use_gcc_tgmath" = xyes
 then extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/tgmath.h"
 fi
 
+# Expand user_headers_inc_next_pre to user_headers_inc_next_pre_list
+for file in ${user_headers_inc_next_pre} ; do
+  user_headers_inc_next_pre_list="${user_headers_inc_next_pre_list} ${file}"
+done
+
+# Expand user_headers_inc_next_post to user_headers_inc_next_post_list
+for file in ${user_headers_inc_next_post} ; do
+  user_headers_inc_next_post_list="${user_headers_inc_next_post_list} ${file}"
+done
+
 # Define collect2 in Makefile.
 case $host_can_use_collect2 in
   no) collect2= ;;
@@ -17107,7 +17125,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17110 "configure"
+#line 17128 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17213,7 +17231,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 17216 "configure"
+#line 17234 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -25394,6 +25412,8 @@ fi
 
 
 
+
+
 
 
 
Index: gcc/gcc/configure.ac
===================================================================
--- gcc.orig/gcc/configure.ac	2010-07-21 20:09:20.413160100 +0200
+++ gcc/gcc/configure.ac	2010-07-21 20:29:56.109840100 +0200
@@ -1235,6 +1235,12 @@ then tm_file=$cpu_type/$cpu_type.h; fi
 if test x"$extra_headers" = x
 then extra_headers=; fi
 
+if test x"$user_headers_inc_next_pre" = x
+then user_headers_inc_next_pre=; fi
+
+if test x"$user_headers_inc_next_post" = x
+then user_headers_inc_next_post=; fi
+
 if test x$md_file = x
 then md_file=$cpu_type/$cpu_type.md; fi
 
@@ -1823,6 +1829,16 @@ if test x"$use_gcc_tgmath" = xyes
 then extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/tgmath.h"
 fi
 
+# Expand user_headers_inc_next_pre to user_headers_inc_next_pre_list
+for file in ${user_headers_inc_next_pre} ; do
+  user_headers_inc_next_pre_list="${user_headers_inc_next_pre_list} ${file}"
+done
+
+# Expand user_headers_inc_next_post to user_headers_inc_next_post_list
+for file in ${user_headers_inc_next_post} ; do
+  user_headers_inc_next_post_list="${user_headers_inc_next_post_list} ${file}"
+done
+
 # Define collect2 in Makefile.
 case $host_can_use_collect2 in
   no) collect2= ;;
@@ -4499,6 +4515,8 @@ AC_SUBST(TM_ENDIAN_CONFIG)
 AC_SUBST(TM_MULTILIB_CONFIG)
 AC_SUBST(TM_MULTILIB_EXCEPTIONS_CONFIG)
 AC_SUBST(extra_gcc_objs)
+AC_SUBST(user_headers_inc_next_pre_list)
+AC_SUBST(user_headers_inc_next_post_list)
 AC_SUBST(extra_headers_list)
 AC_SUBST(extra_objs)
 AC_SUBST(extra_parts)

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

end of thread, other threads:[~2010-07-28  8:55 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-22 13:27 [patch win32]: fix for PR target/41943 Ozkan Sezer
2010-07-22 16:00 ` Richard Henderson
2010-07-22 16:02   ` Ozkan Sezer
2010-07-22 16:05     ` Richard Henderson
2010-07-22 16:08       ` Ozkan Sezer
2010-07-22 16:50       ` Kai Tietz
2010-07-22 19:36       ` NightStrike
2010-07-22 20:06         ` Richard Henderson
2010-07-22 20:25           ` NightStrike
2010-07-22 20:33             ` Richard Henderson
2010-07-22 20:36             ` Kai Tietz
2010-07-22 21:11               ` Richard Henderson
2010-07-22 21:20                 ` Kai Tietz
2010-07-22 21:33                   ` Richard Henderson
2010-07-22 21:39                     ` Kai Tietz
2010-07-22 21:42                       ` Richard Henderson
2010-07-22 21:51                         ` Kai Tietz
2010-07-22 21:57                           ` Richard Henderson
2010-07-23 17:55                             ` Kai Tietz
2010-07-23 18:13                               ` Richard Henderson
2010-07-23 18:33                                 ` Kai Tietz
2010-07-23  9:14                 ` Richard Guenther
2010-07-27 15:19                   ` Joseph S. Myers
2010-07-28  9:49                     ` Kai Tietz
  -- strict thread matches above, loose matches on Subject: below --
2010-07-22  8:13 Ozkan Sezer
2010-07-21 19:38 Kai Tietz
2010-07-21 20:41 ` Richard Henderson
2010-07-21 21:34   ` Kai Tietz
2010-07-21 22:05     ` Danny Smith
2010-07-22  7:46       ` Kai Tietz
2010-07-22 11:38         ` Danny Smith
2010-07-22 11:42           ` Kai Tietz
2010-07-22 11:49             ` Richard Guenther
2010-07-22 11:56               ` Kai Tietz

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