public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How to disable toplevel fixincludes?
@ 2004-09-10  5:49 Aaron W. LaFramboise
  2004-09-10  8:43 ` [PATCH] " Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron W. LaFramboise @ 2004-09-10  5:49 UTC (permalink / raw)
  To: gcc

With the recent fixincludes reorganization, bootstrap now attempts to
build fixincludes on i686-pc-mingw32.  Like collect2, fixincludes
contains some fairly unrepetant Unixisms, and can not be trivially
changed to build on Windows.  How do I disable it, both at the command
line, and in the sources as the default for the target?

Aaron W. LaFramboise

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

* [PATCH] Re: How to disable toplevel fixincludes?
  2004-09-10  5:49 How to disable toplevel fixincludes? Aaron W. LaFramboise
@ 2004-09-10  8:43 ` Paolo Bonzini
  2004-09-14  3:23   ` Aaron W. LaFramboise
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2004-09-10  8:43 UTC (permalink / raw)
  To: Aaron W. LaFramboise, gcc-patches, gcc

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

> With the recent fixincludes reorganization, bootstrap now attempts to
> build fixincludes on i686-pc-mingw32.  Like collect2, fixincludes
> contains some fairly unrepetant Unixisms, and can not be trivially
> changed to build on Windows.

Is this true for two-process fixincludes too?  (Can you try "make 
twoprocess" from the fixincludes directory?)

> How do I disable it, both at the command
> line, and in the sources as the default for the target?

Here's a patch.  The list of platforms for which fixincludes is excluded 
is taken from mkfixinc.sh.

Ok for mainline and src (leaving for a vacation tomorrow morning 
European Time)?

Paolo

[-- Attachment #2: do-not-build-unused-fixincludes.patch --]
[-- Type: text/plain, Size: 4953 bytes --]

2004-09-10  Paolo Bonzini  <bonzini@gnu.org>

	* configure.in (case ${target}): Do not build fixincludes
	on platforms where it is not used.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.317
diff -u -r1.317 configure.in
--- configure.in	3 Sep 2004 18:09:18 -0000	1.317
+++ configure.in	10 Sep 2004 07:11:22 -0000
@@ -438,7 +438,7 @@
     noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss"
     ;;
   alpha*-*-*vms*)
-    noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss build-fixincludes ${libgcj}"
     ;;
   alpha*-*-linux*)
     # newlib is not 64 bit ready
@@ -472,6 +472,9 @@
   arc-*-*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
+  arm-semi-aof )
+    noconfigdirs="$noconfigdirs build-fixincludes"
+    ;;
   arm-*-coff | strongarm-*-coff | xscale-*-coff)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
@@ -535,6 +538,9 @@
   h8500-*-*)
     noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
+  hppa1.1-*-osf* | hppa1.1-*-bsd* )
+    noconfigdirs="$noconfigdirs build-fixincludes"
+    ;;
   hppa*64*-*-linux* | parisc*64*-*-linux*)
     # In this case, it's because the hppa64-linux target is for
     # the kernel only at this point and has no libc, and thus no
@@ -565,6 +571,9 @@
     # No gdb or ld support yet.
     noconfigdirs="$noconfigdirs ${libgcj} readline mmalloc libgui itcl gdb ld"
     ;;
+  i370-*-opened*)
+    noconfigdirs="$noconfigdirs build-fixincludes"
+    ;;
   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
@@ -589,7 +598,7 @@
     ;;
   i[[3456789]]86-*-mingw32*)
     target_configdirs="$target_configdirs target-mingw"
-    noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj} build-fixincludes"
 
     # Can't build gdb for mingw32 if not native.
     case "${host}" in
@@ -600,7 +609,7 @@
     ;;    
   *-*-cygwin*)
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
-    noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-gperf target-libgloss build-fixincludes ${libgcj}"
     # always build newlib if winsup directory is present.
     if test -d "$srcdir/winsup"
     then
@@ -616,8 +625,12 @@
          ;;
     esac
     ;;    
+  i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \
+  i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* )
+    noconfigdirs="$noconfigdirs build-fixincludes"
+    ;;
   i[[3456789]]86-*-pe)
-    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} build-fixincludes"
     ;;
   i[[3456789]]86-*-sco3.2v5*)
     # The linker does not yet know about weak symbols in COFF,
@@ -680,7 +693,10 @@
     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
     ;;
   powerpc-*-eabi)
-    noconfigdirs="$noconfigdirs ${libgcj}"
+    noconfigdirs="$noconfigdirs ${libgcj} build-fixincludes"
+    ;;
+  powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems* )
+    noconfigdirs="$noconfigdirs build-fixincludes"
     ;;
   rs6000-*-lynxos*)
     noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
@@ -1251,13 +1267,13 @@
   ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[[^ ]]*//' -e 's/$/ --enable-languages='"$enable_languages"/ `
 fi
 
-# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
-# $target_configdirs.
+# Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
+# $build_configdirs and $target_configdirs.
 # If we have the source for $noconfigdirs entries, add them to $notsupp.
 
 notsupp=""
 for dir in . $skipdirs $noconfigdirs ; do
-  dirname=`echo $dir | sed -e s/target-//g`
+  dirname=`echo $dir | sed -e s/target-//g -e s/build-//g`
   if test $dir != .  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
     configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
     if test -r $srcdir/$dirname/configure ; then
@@ -1268,6 +1284,16 @@
       fi
     fi
   fi
+  if test $dir != .  && echo " ${build_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
+    build_configdirs=`echo " ${build_configdirs} " | sed -e "s/ ${dir} / /"`
+    if test -r $srcdir/$dirname/configure ; then
+      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
+	true
+      else
+	notsupp="$notsupp $dir"
+      fi
+    fi
+  fi
   if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
     target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
     if test -r $srcdir/$dirname/configure ; then

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

* Re: [PATCH] Re: How to disable toplevel fixincludes?
  2004-09-10  8:43 ` [PATCH] " Paolo Bonzini
@ 2004-09-14  3:23   ` Aaron W. LaFramboise
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron W. LaFramboise @ 2004-09-14  3:23 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: gcc-patches, gcc

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

Paolo Bonzini wrote:

>>With the recent fixincludes reorganization, bootstrap now attempts to
>>build fixincludes on i686-pc-mingw32.  Like collect2, fixincludes
>>contains some fairly unrepetant Unixisms, and can not be trivially
>>changed to build on Windows.
> 
> Is this true for two-process fixincludes too?  (Can you try "make 
> twoprocess" from the fixincludes directory?)

I have attached a patch that fixes some obvious portability problems
with fixincludes.  However, both the normal build and the two-process
build of fixincludes seem to require fork(), something that Windows just
doesn't have.  Someone (?) is working on adding process chaining of some
sort to libiberty to be used by collect2, and I would guess that is also
the proper thing to use here.

Aaron W. LaFramboise


[-- Attachment #2: gcc-mainline-20040912-fixincludes.patch --]
[-- Type: text/plain, Size: 3669 bytes --]

2004-09-12  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* fixincludes/fixincl.c (initialize): Check for SIGQUIT
	and SIGALRM.
	(create_file): Fix mkdir() for Win32.
	* fixincludes/procopen.c (internal_fix): Fallback to dup2()
	if F_DUPFD not defined.
	* fixincludes/server.c (close_server): Check for SIGKILL.
	(server_setup): Check for SIGPIPE and SIGALRM.

Index: gcc/fixincludes/fixincl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/fixincludes/fixincl.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 fixincl.c
*** gcc/fixincludes/fixincl.c	31 Aug 2004 09:26:05 -0000	1.1
--- gcc/fixincludes/fixincl.c	11 Sep 2004 23:47:30 -0000
*************** ENV_TABLE
*** 313,326 ****
--- 313,330 ----
    pz_temp_file = tempnam( NULL, "fxinc" );
  # endif
  
+ #ifdef SIGQUIT
    signal (SIGQUIT, SIG_IGN);
+ #endif
  #ifdef SIGIOT
    signal (SIGIOT,  SIG_IGN);
  #endif
  #ifdef SIGPIPE
    signal (SIGPIPE, SIG_IGN);
  #endif
+ #ifdef SIGALRM
    signal (SIGALRM, SIG_IGN);
+ #endif
    signal (SIGTERM, SIG_IGN);
  }
  
*************** create_file (void)
*** 575,581 ****
--- 579,589 ----
            *pz_dir = NUL;
            if (stat (fname, &stbf) < 0)
              {
+ #ifdef _WIN32
+               mkdir (fname);
+ #else
                mkdir (fname, S_IFDIR | S_DIRALL);
+ #endif
              }
  
            *pz_dir = '/';
*************** internal_fix (int read_fd, tFixDesc* p_f
*** 858,865 ****
--- 866,878 ----
     *  Make the fd passed in the stdin, and the write end of
     *  the new pipe become the stdout.
     */
+ #ifdef F_DUPFD
    fcntl (fd[1], F_DUPFD, STDOUT_FILENO);
    fcntl (read_fd, F_DUPFD, STDIN_FILENO);
+ #else
+   dup2 (fd[1], STDOUT_FILENO);
+   dup2 (read_fd, STDIN_FILENO);
+ #endif
  
    apply_fix (p_fixd, pz_curr_file);
    exit (0);
Index: gcc/fixincludes/procopen.c
===================================================================
RCS file: /cvsroot/gcc/gcc/fixincludes/procopen.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 procopen.c
*** gcc/fixincludes/procopen.c	31 Aug 2004 09:26:05 -0000	1.1
--- gcc/fixincludes/procopen.c	11 Sep 2004 23:47:30 -0000
*************** chain_open (int stdin_fd, tCC** pp_args,
*** 155,162 ****
--- 155,167 ----
     *  Make the fd passed in the stdin, and the write end of
     *  the new pipe become the stdout.
     */
+ #ifdef F_DUPFD
    fcntl (stdout_pair.write_fd, F_DUPFD, STDOUT_FILENO);
    fcntl (stdin_fd, F_DUPFD, STDIN_FILENO);
+ #else
+   dup2 (stdout_pair.write_fd, STDOUT_FILENO);
+   dup2 (stdin_fd, STDIN_FILENO);
+ #endif
  
    if (*pp_args == (char *) NULL)
      *pp_args = pz_cmd;
Index: gcc/fixincludes/server.c
===================================================================
RCS file: /cvsroot/gcc/gcc/fixincludes/server.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 server.c
*** gcc/fixincludes/server.c	31 Aug 2004 09:26:05 -0000	1.1
--- gcc/fixincludes/server.c	11 Sep 2004 23:47:31 -0000
*************** close_server (void)
*** 140,146 ****
--- 140,150 ----
    if (  (server_id != NULLPROCESS)
       && (server_master_pid == getpid ()))
      {
+ #ifdef SIGKILL
        kill ((pid_t) server_id, SIGKILL);
+ #else
+       kill ((pid_t) server_id, SIGTERM);
+ #endif
        server_id = NULLPROCESS;
        server_master_pid = NOPROCESS;
        fclose (server_pair.pf_read);
*************** server_setup (void)
*** 187,194 ****
--- 191,202 ----
  
    server_master_pid = getpid ();
  
+ #ifdef SIGPIPE
    signal (SIGPIPE, sig_handler);
+ #endif
+ #ifdef SIGALRM
    signal (SIGALRM, sig_handler);
+ #endif
  
    fputs ("trap : 1\n", server_pair.pf_write);
    fflush (server_pair.pf_write);

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

end of thread, other threads:[~2004-09-14  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-10  5:49 How to disable toplevel fixincludes? Aaron W. LaFramboise
2004-09-10  8:43 ` [PATCH] " Paolo Bonzini
2004-09-14  3:23   ` Aaron W. LaFramboise

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