public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [build] Define HAVE_GAS_HIDDEN on Darwin
@ 2011-05-04 12:17 Rainer Orth
  2011-05-10  7:45 ` Mike Stump
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Orth @ 2011-05-04 12:17 UTC (permalink / raw)
  To: gcc-patches; +Cc: Mike Stump, David Edelsohn, Iain Sandoe

The following patch is a prerequisite for making

	[lto, testsuite] Don't use visibility on targets that don't support it (PR lto/47334)
        http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00295.html

work on Darwin by defining HAVE_GAS_HIDDEN on that target, too.  Instead
of special-casing visibility support on Darwin all over the place, I'd
rather treat it like the other targets that have at least some
visibility support, even if not the full ELF range of visibility types.

Doing this turned out to be astonishingly easy:

* Enable gcc_cv_as_hidden and gcc_cv_ld_hidden in configure.ac.

* Disable rs6000_assemble_visibility if TARGET_MACHO since Darwin has
  (and needs) its own version.

* The code in config/i386/i386.c for USE_HIDDEN_LINKONCE now does the
  right thing even without TARGET_MACHO.

* On the other hand, USE_LINKONCE_INDIRECT in dwarf2asm.c must be
  disabled for Mach-O since the code uses an explicit .hidden, which
  could be considered a bug in itself ;-(

This patch survived bootstrap on i386-apple-darwin9.8.0 (both multilibs)
and powerpc-apple-darwin9.8.0 (32-bit only).  I've compared testresults
with a slightly earlier build (the machines are relatively slow), but a
real regtest is in progress.

I'd appreciate if Darwin maintainers and other Darwin users could try
this themselves since my experience with the platform is rather limited.

While one could argue that HAVE_GAS_HIDDEN is complete misnomer now and
should rather be HAVE_AS_VISIBILITY instead, I'd prefer to do this as a
followup if at all.

Ok for mainline if testing passes and no other problems show up?

Thanks.
	Rainer


2011-04-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac (gcc_cv_as_hidden): Enable on *-*-darwin*.
	(gcc_cv_ld_hidden): Likewise.
	* configure: Regenerate.
	* config/i386/i386.c (USE_HIDDEN_LINKONCE): Remove TARGET_MACHO.
	* config/rs6000/rs6000.c (rs6000_assemble_visibility)
	[TARGET_MACHO]: Don't define.
	(TARGET_ASM_ASSEMBLE_VISIBILITY): Likewise.
	* dwarf2asm.c (USE_LINKONCE_INDIRECT) [HAVE_GAS_HIDDEN]: Only if
	!TARGET_MACHO.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -8787,7 +8787,7 @@ ix86_setup_frame_addresses (void)
 }
 \f
 #ifndef USE_HIDDEN_LINKONCE
-# if (defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)) || TARGET_MACHO
+# if defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)
 #  define USE_HIDDEN_LINKONCE 1
 # else
 #  define USE_HIDDEN_LINKONCE 0
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -916,7 +916,7 @@ static bool legitimate_lo_sum_address_p 
 static struct machine_function * rs6000_init_machine_status (void);
 static bool rs6000_assemble_integer (rtx, unsigned int, int);
 static bool no_global_regs_above (int, bool);
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
 static void rs6000_assemble_visibility (tree, int);
 #endif
 static int rs6000_ra_ever_killed (void);
@@ -1381,7 +1381,7 @@ static const struct default_options rs60
 #undef TARGET_ASM_INTEGER
 #define TARGET_ASM_INTEGER rs6000_assemble_integer
 
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
 #undef TARGET_ASM_ASSEMBLE_VISIBILITY
 #define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
 #endif
@@ -16710,7 +16710,7 @@ rs6000_assemble_integer (rtx x, unsigned
   return default_assemble_integer (x, size, aligned_p);
 }
 
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
 /* Emit an assembler directive to set symbol visibility for DECL to
    VISIBILITY_TYPE.  */
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2174,6 +2174,12 @@ EOF
     gcc_cv_as_hidden=yes
     ;;
 esac])
+case "${target}" in
+  *-*-darwin*)
+    # Darwin as has some visibility support, though with a different syntax.
+    gcc_cv_as_hidden=yes
+    ;;
+esac
 
 # gnu_indirect_function type is an extension proposed at
 # http://groups.google/com/group/generic-abi/files. It allows dynamic runtime
@@ -2273,6 +2279,10 @@ else
     fi
   else
     case "${target}" in
+      *-*-darwin*)
+	# Darwin ld has some visibility support.
+	gcc_cv_ld_hidden=yes
+        ;;
       hppa64*-*-hpux* | ia64*-*-hpux*)
 	gcc_cv_ld_hidden=yes
 	;;
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -1,5 +1,5 @@
 /* Dwarf2 assembler output helper routines.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -799,7 +799,7 @@ static GTY((param1_is (char *), param2_i
 static GTY(()) int dw2_const_labelno;
 
 #if defined(HAVE_GAS_HIDDEN)
-# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY)
+# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY) && !TARGET_MACHO
 #else
 # define USE_LINKONCE_INDIRECT 0
 #endif

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

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-05-04 12:17 [build] Define HAVE_GAS_HIDDEN on Darwin Rainer Orth
@ 2011-05-10  7:45 ` Mike Stump
  2011-05-19 18:50   ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Stump @ 2011-05-10  7:45 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches, David Edelsohn, Iain Sandoe

On May 4, 2011, at 5:08 AM, Rainer Orth wrote:
> The following patch is a prerequisite for making
> 
> 	[lto, testsuite] Don't use visibility on targets that don't support it (PR lto/47334)
>        http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00295.html

> -# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY)
> +# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY) && !TARGET_MACHO

Generally speaking, we don't litter the backend with things like this.  We consider this trashy, and we limit the trash to config/...

Now, if you invent a feature (bug) for which this is really testing, and used it instead here, and then put that into the darwin.h file or into an as autoconf test, I think it would be fine.  Ok with that version.  If a build/configure/visibility person wants to object or insist on a better way to do what you want to do, I'd defer to them.

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-05-10  7:45 ` Mike Stump
@ 2011-05-19 18:50   ` Rainer Orth
  2011-05-19 22:13     ` Jason Merrill
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Orth @ 2011-05-19 18:50 UTC (permalink / raw)
  To: Mike Stump
  Cc: gcc-patches, David Edelsohn, Iain Sandoe, Jason Merrill,
	Richard Henderson

Mike Stump <mikestump@comcast.net> writes:

> On May 4, 2011, at 5:08 AM, Rainer Orth wrote:
>> The following patch is a prerequisite for making
>> 
>> 	[lto, testsuite] Don't use visibility on targets that don't support it (PR lto/47334)
>>        http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00295.html
>
>> -# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY)
>> +# define USE_LINKONCE_INDIRECT (SUPPORTS_ONE_ONLY) && !TARGET_MACHO
>
> Generally speaking, we don't litter the backend with things like this.
> We consider this trashy, and we limit the trash to config/...
>
> Now, if you invent a feature (bug) for which this is really testing,
> and used it instead here, and then put that into the darwin.h file or
> into an as autoconf test, I think it would be fine.  Ok with that
> version.  If a build/configure/visibility person wants to object or
> insist on a better way to do what you want to do, I'd defer to them.

The problem is the assumption that HAVE_GAS_HIDDEN implies that the
assembler supports the .hidden mnemonic, not visibility in general,
which is no longer true now.

Unfortunately, one cannot use targetm.asm_out.assemble_visibility in
dwarf2asm.c (dw2_output_indirect_constant_1) since the former expects a
tree arg, not an arbitrary string.

The cleanest way to account for this seems to allow overriding
USE_LINKONCE_INDIRECT in target headers (darwin.h in this case).

If Jason or Richard consider this appropriate, I'll modify the patch
accordingly and apply after retesting.

	Rainer

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

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-05-19 18:50   ` Rainer Orth
@ 2011-05-19 22:13     ` Jason Merrill
  2011-06-08  9:45       ` Rainer Orth
  0 siblings, 1 reply; 9+ messages in thread
From: Jason Merrill @ 2011-05-19 22:13 UTC (permalink / raw)
  To: Rainer Orth
  Cc: Mike Stump, gcc-patches, David Edelsohn, Iain Sandoe, Richard Henderson

On 05/19/2011 01:33 PM, Rainer Orth wrote:
> The cleanest way to account for this seems to allow overriding
> USE_LINKONCE_INDIRECT in target headers (darwin.h in this case).
>
> If Jason or Richard consider this appropriate, I'll modify the patch
> accordingly and apply after retesting.

Not really.  The use in dwarf2asm seems no different from the use in 
i386.c, except that the latter has a special TARGET_MACHO case instead. 
  As you say, dwarf2asm shouldn't be using .hidden directly, and that's 
the bug to fix.

Jason

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-05-19 22:13     ` Jason Merrill
@ 2011-06-08  9:45       ` Rainer Orth
  2011-06-08 10:08         ` IainS
                           ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Rainer Orth @ 2011-06-08  9:45 UTC (permalink / raw)
  To: Jason Merrill
  Cc: Mike Stump, gcc-patches, David Edelsohn, Iain Sandoe, Richard Henderson

Jason Merrill <jason@redhat.com> writes:

> On 05/19/2011 01:33 PM, Rainer Orth wrote:
>> The cleanest way to account for this seems to allow overriding
>> USE_LINKONCE_INDIRECT in target headers (darwin.h in this case).
>>
>> If Jason or Richard consider this appropriate, I'll modify the patch
>> accordingly and apply after retesting.
>
> Not really.  The use in dwarf2asm seems no different from the use in
> i386.c, except that the latter has a special TARGET_MACHO case instead. As
> you say, dwarf2asm shouldn't be using .hidden directly, and that's the bug
> to fix.

Once I got around to it, this proved to be remarkably easy, as can be
seen below.

One additional complication was detected during Darwin testing: with
HAVE_GAS_HIDDEN defined, the 32-bit {ix86, rs6000}_stack_protect_fail
would call default_hidden_stack_protect_fail.  This emits calls to
__stack_chk_fail_local which is missing from Darwin libc, so I had to
revert to the default on Darwin.

Bootstrapped without regressions on i386-apple-darwin9.8.0.
powerpc-apple-darwin9.8.0 bootstrap is still running.  Unfortunately,
Darwin seems to be exceedingly unreliable under load: tests randomly
time out and work again the next time.  This doesn't happen for me on
any other platform.  This makes actually checking for regressions quite
tedious.  I've checked that any newly failing test was a timeout, not an
actual failure.

The patch has also been bootstrapped without regressions on
i386-pc-solaris2.8 and i386-pc-solaris2.11 and the DW.ref.* symbols are
still hidden as before.

The Darwin parts of the previous versions have already been approved,
but I'd appreciate if Mike could have a look at the changes.  Ok for
mainline?

Thanks.
        Rainer


2011-04-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* configure.ac (gcc_cv_as_hidden): Enable on *-*-darwin*.
	(gcc_cv_ld_hidden): Likewise.
	* configure: Regenerate.
	* config/i386/i386.c (USE_HIDDEN_LINKONCE): Remove TARGET_MACHO.
	(ix86_stack_protect_fail): Mark unused.
	(TARGET_STACK_PROTECT_FAIL) [TARGET_MACHO]: Don't redefine.
	* config/rs6000/rs6000.c (rs6000_assemble_visibility)
	[TARGET_MACHO]: Don't define.
	(TARGET_ASM_ASSEMBLE_VISIBILITY): Likewise.
	(TARGET_STACK_PROTECT_FAIL): Likewise.
	(rs6000_stack_protect_fail): Mark unused.
	* dwarf2asm.c (dw2_output_indirect_constant_1): Mark decl hidden if
	USE_LINKONCE_INDIRECT.
	Don't emit .hidden expicitly.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -8725,7 +8725,7 @@ ix86_setup_frame_addresses (void)
 }
 \f
 #ifndef USE_HIDDEN_LINKONCE
-# if (defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)) || TARGET_MACHO
+# if defined(HAVE_GAS_HIDDEN) && (SUPPORTS_ONE_ONLY - 0)
 #  define USE_HIDDEN_LINKONCE 1
 # else
 #  define USE_HIDDEN_LINKONCE 0
@@ -32207,7 +32207,7 @@ ix86_mangle_type (const_tree type)
    __stack_chk_fail directly.  64-bit code doesn't need to setup any PIC
    register, so it is better to call __stack_chk_fail directly.  */
 
-static tree
+static tree ATTRIBUTE_UNUSED
 ix86_stack_protect_fail (void)
 {
   return TARGET_64BIT
@@ -35407,8 +35407,10 @@ ix86_autovectorize_vector_sizes (void)
 #undef TARGET_MANGLE_TYPE
 #define TARGET_MANGLE_TYPE ix86_mangle_type
 
+#ifndef TARGET_MACHO
 #undef TARGET_STACK_PROTECT_FAIL
 #define TARGET_STACK_PROTECT_FAIL ix86_stack_protect_fail
+#endif
 
 #undef TARGET_SUPPORTS_SPLIT_STACK
 #define TARGET_SUPPORTS_SPLIT_STACK ix86_supports_split_stack
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -884,7 +884,7 @@ static bool legitimate_lo_sum_address_p 
 static struct machine_function * rs6000_init_machine_status (void);
 static bool rs6000_assemble_integer (rtx, unsigned int, int);
 static bool no_global_regs_above (int, bool);
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
 static void rs6000_assemble_visibility (tree, int);
 #endif
 static int rs6000_ra_ever_killed (void);
@@ -1349,7 +1349,7 @@ static const struct default_options rs60
 #undef TARGET_ASM_INTEGER
 #define TARGET_ASM_INTEGER rs6000_assemble_integer
 
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
 #undef TARGET_ASM_ASSEMBLE_VISIBILITY
 #define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
 #endif
@@ -1558,8 +1558,10 @@ static const struct default_options rs60
 #define TARGET_DEFAULT_TARGET_FLAGS \
   (TARGET_DEFAULT)
 
+#ifndef TARGET_MACHO
 #undef TARGET_STACK_PROTECT_FAIL
 #define TARGET_STACK_PROTECT_FAIL rs6000_stack_protect_fail
+#endif
 
 /* MPC604EUM 3.5.2 Weak Consistency between Multiple Processors
    The PowerPC architecture requires only weak consistency among
@@ -16390,7 +16392,7 @@ rs6000_assemble_integer (rtx x, unsigned
   return default_assemble_integer (x, size, aligned_p);
 }
 
-#ifdef HAVE_GAS_HIDDEN
+#if defined (HAVE_GAS_HIDDEN) && !defined (TARGET_MACHO)
 /* Emit an assembler directive to set symbol visibility for DECL to
    VISIBILITY_TYPE.  */
 
@@ -27323,7 +27325,7 @@ invalid_arg_for_unprototyped_fn (const_t
    calling __stack_chk_fail directly.  Otherwise it is better to call
    __stack_chk_fail directly.  */
 
-static tree
+static tree ATTRIBUTE_UNUSED
 rs6000_stack_protect_fail (void)
 {
   return (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2192,6 +2192,12 @@ EOF
     gcc_cv_as_hidden=yes
     ;;
 esac])
+case "${target}" in
+  *-*-darwin*)
+    # Darwin as has some visibility support, though with a different syntax.
+    gcc_cv_as_hidden=yes
+    ;;
+esac
 
 # gnu_indirect_function type is an extension proposed at
 # http://groups.google/com/group/generic-abi/files. It allows dynamic runtime
@@ -2291,6 +2297,10 @@ else
     fi
   else
     case "${target}" in
+      *-*-darwin*)
+	# Darwin ld has some visibility support.
+	gcc_cv_ld_hidden=yes
+        ;;
       hppa64*-*-hpux* | ia64*-*-hpux*)
 	gcc_cv_ld_hidden=yes
 	;;
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -1,5 +1,5 @@
 /* Dwarf2 assembler output helper routines.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -915,14 +915,13 @@ dw2_output_indirect_constant_1 (splay_tr
     {
       TREE_PUBLIC (decl) = 1;
       make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl));
+      if (USE_LINKONCE_INDIRECT)
+	DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
     }
   else
     TREE_STATIC (decl) = 1;
 
   sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
-  sym = targetm.strip_name_encoding (sym);
-  if (TREE_PUBLIC (decl) && USE_LINKONCE_INDIRECT)
-    fprintf (asm_out_file, "\t.hidden %sDW.ref.%s\n", user_label_prefix, sym);
   assemble_variable (decl, 1, 1, 1);
   assemble_integer (sym_ref, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1);
 

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

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-06-08  9:45       ` Rainer Orth
@ 2011-06-08 10:08         ` IainS
  2011-06-08 19:54         ` Mike Stump
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: IainS @ 2011-06-08 10:08 UTC (permalink / raw)
  To: Rainer Orth
  Cc: Jason Merrill, Mike Stump, GCC Patches, David Edelsohn,
	Richard Henderson

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


On 8 Jun 2011, at 10:29, Rainer Orth wrote:

> Darwin seems to be exceedingly unreliable under load: tests randomly
> time out and work again the next time.

If you mean random timeouts in dejagnu - I suspect (but have not yet  
proved) that the culprit is insufficient stack allocation in some  
component of tcl or expect itself.

One used to find that non-parallel "make check" would be quite  
reliable - but parallel very unreliable.

I use the following local (not submitted, unofficial) patch to dejagnu  
on Darwin9 - which retries tests that timeout (once) - this has been  
enough to eliminate the frustration for me...

YMMV, of course.

cheers
Iain



[-- Attachment #2: dejadeja-gnu-diff.txt --]
[-- Type: text/plain, Size: 2840 bytes --]

--- dejagnu-1.4.4/lib/remote.exp	2003-10-11 07:42:46.000000000 +0100
+++ dejagnu-1.4.4-installed/lib/remote.exp	2010-03-12 09:32:49.000000000 +0000
@@ -74,7 +74,7 @@
 # or output is redirected. If the program needs to be killed, /bin/sh and
 # the kill command will be invoked.
 #
-proc local_exec { commandline inp outp timeout } {
+proc one_local_exec { commandline inp outp timeout } {
     # Tcl's exec is a pile of crap. It does two very inappropriate things
     # firstly, it has no business returning an error if the program being
     # executed happens to write to stderr. Secondly, it appends its own
@@ -155,7 +155,7 @@
 
     set got_eof 0
     set output ""
-
+    set status 0
     # Wait for either $timeout seconds to elapse, or for the program to
     # exit.
     expect {
@@ -163,16 +163,19 @@
 	    append output $expect_out(buffer)
 	    if { [string length $output] < 512000 } {
 		exp_continue -continue_timer
+	    } else {
+	      warning "one_local_exec: (output string overflow)"
 	    }
 	}
 	timeout {
-	    warning "program timed out."
+#	    warning "one_local_exec: program timed out."
+	    set status -2
 	}
 	eof {
 	    set got_eof 1
 	}
     }
-
+    
     # Uuuuuuugh. Now I'm getting really sick.
     # If we didn't get an EOF, we have to kill the poor defenseless program.
     # However, Tcl has no kill primitive, so we have to execute an external
@@ -207,12 +210,16 @@
 	    set res "wait failed"
 	}
     }
+    
     if { $r2 != 0 || $res != "" || ! $got_eof } {
 	verbose "close result is $res"
-	set status 1
+	if { $status != -2 } {
+	    set status 1
+	}
     } else {
 	set status 0
     }
+    
     verbose "output is $output"
     if { $outp == "" } {
         return [list $status $output]
@@ -221,6 +228,29 @@
     }
 }
 
+proc local_exec { commandline inp outp timeout } {
+    set res [one_local_exec $commandline $inp $outp $timeout]
+    set stat [lindex $res 0]
+# OK?
+    if { $stat != -2 } {
+	return $res 
+    }
+# nope...
+#    warning "local_exec $commandline timed out : retrying"
+    verbose -log "RE-TRIED: (timeout = $timeout) : $commandline "
+    if { $timeout < 150 } {
+	set timeout [expr {$timeout} * 2]
+    }
+    set res [one_local_exec $commandline $inp $outp $timeout]
+    set stat [lindex $res 0]
+    if { $stat == -2 } {
+	set msg "" 
+	warning "TIMED OUT: $commandline timed out after retry"
+	verbose -log "TIMED OUT: $commandline (timeout = $timeout)"
+    }
+    return $res
+}
+
 #
 # Execute the supplied program on HOSTNAME. There are four optional arguments
 # the first is a set of arguments to pass to PROGRAM, the second is an
@@ -1090,7 +1120,8 @@
 	    }
 	}
 	timeout {
-	    warning "program timed out."
+	    warning "standard_wait: program timed out"
+	    set status -2 
 	}
 	eof {
 	    if [board_info $dest exists fileid_origid] {

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



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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-06-08  9:45       ` Rainer Orth
  2011-06-08 10:08         ` IainS
@ 2011-06-08 19:54         ` Mike Stump
  2011-06-08 20:09         ` Mike Stump
  2011-06-08 21:32         ` Jason Merrill
  3 siblings, 0 replies; 9+ messages in thread
From: Mike Stump @ 2011-06-08 19:54 UTC (permalink / raw)
  To: Rainer Orth
  Cc: Jason Merrill, gcc-patches, David Edelsohn, Iain Sandoe,
	Richard Henderson

On Jun 8, 2011, at 2:29 AM, Rainer Orth wrote:
> The Darwin parts of the previous versions have already been approved,
> but I'd appreciate if Mike could have a look at the changes.  Ok for
> mainline?

Ok.

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-06-08  9:45       ` Rainer Orth
  2011-06-08 10:08         ` IainS
  2011-06-08 19:54         ` Mike Stump
@ 2011-06-08 20:09         ` Mike Stump
  2011-06-08 21:32         ` Jason Merrill
  3 siblings, 0 replies; 9+ messages in thread
From: Mike Stump @ 2011-06-08 20:09 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches@gcc.gnu.org Patches, Iain Sandoe

On Jun 8, 2011, at 2:29 AM, Rainer Orth wrote:
> Bootstrapped without regressions on i386-apple-darwin9.8.0.
> powerpc-apple-darwin9.8.0 bootstrap is still running.  Unfortunately,
> Darwin seems to be exceedingly unreliable under load: tests randomly
> time out and work again the next time.  This doesn't happen for me on
> any other platform.

:-(  There are one or two testcases that are slightly less than deterministic (in java), though, for me, they seem always to be deterministic.  I wonder if the actual time required for a testcase is just too close to the margin and failing because you gave it a loaded machine.  In my experience, if you do a normal -j check run, and another -j make run (unrelated), we will then time out things, simply because people say, I have 300 seconds to run a testcase, so I am going to use 100% of the machine for 298 seconds and if I don't get it, I'm going to fail.  :-(  Nasty.  I think any testcase that takes more than 30 seconds should be shot on sight, then you can have 3 running at the same time, and never fail on time outs.

Feel free to name the testcases that gave you problems...  Maybe someone has ideas.  Another thought, change the 300 to 600, and see if it is then perfectly reliable.  If so, well...  Maybe the compiler is just slower than it used to be.  :-(

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

* Re: [build] Define HAVE_GAS_HIDDEN on Darwin
  2011-06-08  9:45       ` Rainer Orth
                           ` (2 preceding siblings ...)
  2011-06-08 20:09         ` Mike Stump
@ 2011-06-08 21:32         ` Jason Merrill
  3 siblings, 0 replies; 9+ messages in thread
From: Jason Merrill @ 2011-06-08 21:32 UTC (permalink / raw)
  To: Rainer Orth
  Cc: Mike Stump, gcc-patches, David Edelsohn, Iain Sandoe, Richard Henderson

On 06/08/2011 05:29 AM, Rainer Orth wrote:
> Once I got around to it, this proved to be remarkably easy, as can be
> seen below.

Yes, much better.  The dwarf2asm change is OK.

Jason

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

end of thread, other threads:[~2011-06-08 21:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-04 12:17 [build] Define HAVE_GAS_HIDDEN on Darwin Rainer Orth
2011-05-10  7:45 ` Mike Stump
2011-05-19 18:50   ` Rainer Orth
2011-05-19 22:13     ` Jason Merrill
2011-06-08  9:45       ` Rainer Orth
2011-06-08 10:08         ` IainS
2011-06-08 19:54         ` Mike Stump
2011-06-08 20:09         ` Mike Stump
2011-06-08 21:32         ` Jason Merrill

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