public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Export __enable_execute_stack
@ 2004-06-11 14:39 Eric Botcazou
  2004-06-11 22:17 ` Richard Henderson
  2004-06-14 13:13 ` Jakub Jelinek
  0 siblings, 2 replies; 15+ messages in thread
From: Eric Botcazou @ 2004-06-11 14:39 UTC (permalink / raw)
  To: gcc-patches

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

Hi,

This patch lets libgcc.so export __enable_execute_stack (the function is 
required for trampoline support on Solaris, NetBSD, FreeBSD/SPARC64 and OSF).  
I added a new target macro ENABLE_EXECUTE_STACK so as to uncouple it from 
TRANSFER_FROM_TRAMPOLINE.

Bootstrapped/regtested on sparc-sun-solaris2.8 and i586-redhat-linux-gnu 
(mainline).  I also built cross-compilers to

   alphaev56-dec-osf5.1
   alphaev56-unknown-netbsd
   i386-unknown-netbsd
   sparc-netbsd-elf
   sparc-sun-solaris2.8
   sparc64-unknown-freebsd5.1
   sparc64-sun-solaris2.9

and verified that the call to __enable_execute_stack is still present in the 
assembly file as needed.

OK for mainline?  Would it be feasible to add it to the 3.4 branch at some 
point?


2004-06-11  Eric Botcazou  <ebotcazou@act-europe.fr>

	* libgcc2.c (__enable_execute_stack): New symbol.
	* libgcc-std.ver (GCC_3.5): New version.  Inherit from GCC_3.4
	and declare __enable_execute_stack.
	* mklibgcc.in (lib2funcs): Add _enable_execute_stack.
	* doc/tm.texi (trampolines): Add ENABLE_EXECUTE_STACK macro.
	* config/netbsd.h (NETBSD_ENABLE_EXECUTE_STACK): Rename
	into ENABLE_EXECUTE_STACK.
	* config/sol2.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
	* config/alpha/alpha.c (alpha_initialize_trampoline): Conditionalize
	on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE.
	* config/alpha/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Delete.
	* config/alpha/osf.h (TRANSFER_FROM_TRAMPOLINE): Rename into
	ENABLE_EXECUTE_STACK.
	* config/i386/i386.c (x86_initialize_trampoline): Conditionalize
	on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE.
	* config/i386/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Delete.
	* config/i386/netbsd.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
	* config/i386/netbsd64.h (TRANSFER_FROM_TRAMPOLINE): Likewise.
	* config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Rename into
	ENABLE_EXECUTE_STACK.
	* config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Delete.
	* config/sparc/sparc.c (sparc_initialize_trampoline): Conditionalize
	on ENABLE_EXECUTE_STACK instead of TRANSFER_FROM_TRAMPOLINE.
	(sparc64_initialize_trampoline): Likewise.


-- 
Eric Botcazou

[-- Attachment #2: enable_execute_stack.diff --]
[-- Type: text/x-diff, Size: 12537 bytes --]

Index: libgcc2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/libgcc2.c,v
retrieving revision 1.171
diff -u -r1.171 libgcc2.c
--- libgcc2.c	19 May 2004 23:43:13 -0000	1.171
+++ libgcc2.c	10 Jun 2004 13:20:27 -0000
@@ -1487,6 +1487,19 @@
 
 #endif /* L_clear_cache */
 \f
+#ifdef L_enable_execute_stack
+/* Attempt to turn on execute permission for the stack.  */
+
+#ifdef ENABLE_EXECUTE_STACK
+  ENABLE_EXECUTE_STACK
+#else
+void
+__enable_execute_stack (void *addr __attribute__((__unused__)))
+{}
+#endif /* ENABLE_EXECUTE_STACK */
+
+#endif /* L_enable_execute_stack */
+\f
 #ifdef L_trampoline
 
 /* Jump to a trampoline, loading the static chain address.  */
Index: libgcc-std.ver
===================================================================
RCS file: /cvs/gcc/gcc/gcc/libgcc-std.ver,v
retrieving revision 1.23
diff -u -r1.23 libgcc-std.ver
--- libgcc-std.ver	4 Sep 2003 10:47:45 -0000	1.23
+++ libgcc-std.ver	10 Jun 2004 13:20:27 -0000
@@ -211,3 +211,9 @@
   __paritydi2
   __parityti2
 }
+
+%inherit GCC_3.5 GCC_3.4
+GCC_3.5 {
+  # Used to deal with trampoline initialization on some platforms
+  __enable_execute_stack
+}
Index: mklibgcc.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/mklibgcc.in,v
retrieving revision 1.68
diff -u -r1.68 mklibgcc.in
--- mklibgcc.in	19 Mar 2004 03:32:07 -0000	1.68
+++ mklibgcc.in	10 Jun 2004 13:20:28 -0000
@@ -48,8 +48,8 @@
 	_cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
 	_fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
 	_floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
-	_trampoline __main _absvsi2 _absvdi2 _addvsi3 _addvdi3
-	_subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
+	_enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
+	_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
 	_ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
 	_popcountsi2 _popcountdi2 _paritysi2 _paritydi2'
 
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.327
diff -u -r1.327 tm.texi
--- doc/tm.texi	3 Jun 2004 23:15:01 -0000	1.327
+++ doc/tm.texi	10 Jun 2004 13:21:05 -0000
@@ -4670,6 +4670,19 @@
 @var{end} are both pointer expressions.
 @end defmac
 
+The operating system may also require the stack to be made executable
+before calling the trampoline.  To implement this requirement, define
+the following macro.
+
+@defmac ENABLE_EXECUTE_STACK
+Define this macro if certain operations must be performed before executing
+code located on the stack.  The macro should expand to a series of C
+file-scope constructs (e.g. functions) and provide a unique entry point
+named @code{__enable_execute_stack}.  The target is responsible for
+emitting calls to the entry point in the code, for example in the
+@code{INITIALIZE_TRAMPOLINE} macro.
+@end defmac
+
 To use a standard subroutine, define the following macro.  In addition,
 you must make sure that the instructions in a trampoline fill an entire
 cache line with identical instructions, or else ensure that the
Index: config/netbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/netbsd.h,v
retrieving revision 1.26
diff -u -r1.26 netbsd.h
--- config/netbsd.h	27 Sep 2003 04:48:11 -0000	1.26
+++ config/netbsd.h	10 Jun 2004 13:21:05 -0000
@@ -181,7 +181,7 @@
 \f
 
 /* Attempt to turn on execute permission for the stack.  This may be
-   used by TRANSFER_FROM_TRAMPOLINE of the target needs it (that is,
+   used by INITIALIZE_TRAMPOLINE of the target needs it (that is,
    if the target machine can change execute permissions on a page).
 
    There is no way to query the execute permission of the stack, so
@@ -193,11 +193,9 @@
    Also note that no errors should be emitted by this code; it is considered
    dangerous for library calls to send messages to stdout/stderr.  */
 
-#define NETBSD_ENABLE_EXECUTE_STACK					\
-extern void __enable_execute_stack (void *);				\
+#define ENABLE_EXECUTE_STACK						\
 void									\
-__enable_execute_stack (addr)						\
-     void *addr;							\
+__enable_execute_stack (void *addr)					\
 {									\
   extern int mprotect (void *, size_t, int);				\
   extern int __sysctl (int *, unsigned int, void *, size_t *,		\
Index: config/sol2.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sol2.h,v
retrieving revision 1.10
diff -u -r1.10 sol2.h
--- config/sol2.h	31 May 2004 15:15:08 -0000	1.10
+++ config/sol2.h	10 Jun 2004 13:21:07 -0000
@@ -163,9 +163,6 @@
 /*
  * Attempt to turn on access permissions for the stack.
  *
- * This code must be defined when compiling gcc but not when compiling
- * libgcc2.a, unless we're generating code for 64-bit SPARC
- *
  * _SC_STACK_PROT is only defined for post 2.6, but we want this code
  * to run always.  2.6 can change the stack protection but has no way to
  * query it.
@@ -173,10 +170,10 @@
  */
 
 /* sys/mman.h is not present on some non-Solaris configurations
-   that use sol2.h, so TRANSFER_FROM_TRAMPOLINE must use a magic
+   that use sol2.h, so ENABLE_EXECUTE_STACK must use a magic
    number instead of the appropriate PROT_* flags.  */
 
-#define TRANSFER_FROM_TRAMPOLINE					\
+#define ENABLE_EXECUTE_STACK						\
 									\
 /* #define STACK_PROT_RWX (PROT_READ | PROT_WRITE | PROT_EXEC) */	\
 									\
@@ -192,7 +189,6 @@
     need_enable_exec_stack = 1;						\
 }									\
 									\
-extern void __enable_execute_stack (void *);				\
 void									\
 __enable_execute_stack (void *addr)					\
 {									\
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.363
diff -u -r1.363 alpha.c
--- config/alpha/alpha.c	13 May 2004 06:39:54 -0000	1.363
+++ config/alpha/alpha.c	10 Jun 2004 13:21:29 -0000
@@ -5848,7 +5848,7 @@
       emit_move_insn (gen_rtx_MEM (SImode, addr), temp1);
     }
 
-#ifdef TRANSFER_FROM_TRAMPOLINE
+#ifdef ENABLE_EXECUTE_STACK
   emit_library_call (init_one_libfunc ("__enable_execute_stack"),
 		     0, VOIDmode, 1, tramp, Pmode);
 #endif
Index: config/alpha/netbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/netbsd.h,v
retrieving revision 1.20
diff -u -r1.20 netbsd.h
--- config/alpha/netbsd.h	27 Sep 2003 04:48:12 -0000	1.20
+++ config/alpha/netbsd.h	10 Jun 2004 13:21:29 -0000
@@ -74,10 +74,5 @@
    %(netbsd_endfile_spec)"
 
 
-/* Attempt to enable execute permissions on the stack.  */
-
-#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
-
-
 #undef TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (NetBSD/alpha ELF)");
Index: config/alpha/osf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/osf.h,v
retrieving revision 1.36
diff -u -r1.36 osf.h
--- config/alpha/osf.h	30 Apr 2004 20:09:51 -0000	1.36
+++ config/alpha/osf.h	10 Jun 2004 13:21:32 -0000
@@ -145,7 +145,7 @@
 
 /* Attempt to turn on access permissions for the stack.  */
 
-#define TRANSFER_FROM_TRAMPOLINE					\
+#define ENABLE_EXECUTE_STACK						\
 void									\
 __enable_execute_stack (void *addr)					\
 {									\
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.671
diff -u -r1.671 i386.c
--- config/i386/i386.c	8 Jun 2004 13:26:04 -0000	1.671
+++ config/i386/i386.c	10 Jun 2004 13:22:06 -0000
@@ -12592,7 +12592,7 @@
 	abort ();
     }
 
-#ifdef TRANSFER_FROM_TRAMPOLINE
+#ifdef ENABLE_EXECUTE_STACK
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
 		     LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
 #endif
Index: config/i386/netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/netbsd-elf.h,v
retrieving revision 1.18
diff -u -r1.18 netbsd-elf.h
--- config/i386/netbsd-elf.h	26 Sep 2003 04:07:46 -0000	1.18
+++ config/i386/netbsd-elf.h	10 Jun 2004 13:22:06 -0000
@@ -119,7 +119,4 @@
    we don't care about compatibility with older gcc versions.  */
 #define DEFAULT_PCC_STRUCT_RETURN 1
 
-/* Attempt to enable execute permissions on the stack.  */
-#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
-
 #define TARGET_VERSION fprintf (stderr, " (NetBSD/i386 ELF)");
Index: config/i386/netbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/netbsd.h,v
retrieving revision 1.26
diff -u -r1.26 netbsd.h
--- config/i386/netbsd.h	18 Oct 2002 23:10:35 -0000	1.26
+++ config/i386/netbsd.h	10 Jun 2004 13:22:06 -0000
@@ -67,6 +67,3 @@
    prefix is added.  */
 #undef GOT_SYMBOL_NAME
 #define GOT_SYMBOL_NAME "GLOBAL_OFFSET_TABLE_"
-
-/* Attempt to enable execute permissions on the stack.  */
-#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
Index: config/i386/netbsd64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/netbsd64.h,v
retrieving revision 1.9
diff -u -r1.9 netbsd64.h
--- config/i386/netbsd64.h	26 Sep 2003 04:07:46 -0000	1.9
+++ config/i386/netbsd64.h	10 Jun 2004 13:22:06 -0000
@@ -67,7 +67,4 @@
     fprintf (FILE, "\tcall __mcount\n");				\
 }
 
-/* Attempt to enable execute permissions on the stack.  */
-#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
-
 #define TARGET_VERSION fprintf (stderr, " (NetBSD/x86_64 ELF)");
Index: config/sparc/freebsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/freebsd.h,v
retrieving revision 1.27
diff -u -r1.27 freebsd.h
--- config/sparc/freebsd.h	7 May 2004 03:45:03 -0000	1.27
+++ config/sparc/freebsd.h	10 Jun 2004 13:22:10 -0000
@@ -96,7 +96,7 @@
 #undef  SPARC_DEFAULT_CMODEL
 #define SPARC_DEFAULT_CMODEL	CM_MEDLOW
 
-#define TRANSFER_FROM_TRAMPOLINE					\
+#define ENABLE_EXECUTE_STACK						\
   static int need_enable_exec_stack;					\
   static void check_enabling(void) __attribute__ ((constructor));	\
   static void check_enabling(void)					\
@@ -109,7 +109,6 @@
     if (prot != 7)							\
       need_enable_exec_stack = 1;					\
   }									\
-  extern void __enable_execute_stack (void *);				\
   void __enable_execute_stack (void *addr)				\
   {									\
     if (!need_enable_exec_stack)					\
Index: config/sparc/netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/netbsd-elf.h,v
retrieving revision 1.23
diff -u -r1.23 netbsd-elf.h
--- config/sparc/netbsd-elf.h	7 Feb 2004 17:06:25 -0000	1.23
+++ config/sparc/netbsd-elf.h	10 Jun 2004 13:22:10 -0000
@@ -88,9 +88,6 @@
 
 #undef STDC_0_IN_SYSTEM_HEADERS
 
-/* Attempt to enable execute permissions on the stack.  */
-#define TRANSFER_FROM_TRAMPOLINE NETBSD_ENABLE_EXECUTE_STACK
-
 #undef TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME);
 
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.302
diff -u -r1.302 sparc.c
--- config/sparc/sparc.c	7 Jun 2004 20:58:27 -0000	1.302
+++ config/sparc/sparc.c	10 Jun 2004 13:22:27 -0000
@@ -7465,7 +7465,7 @@
 
   /* Call __enable_execute_stack after writing onto the stack to make sure
      the stack address is accessible.  */
-#ifdef TRANSFER_FROM_TRAMPOLINE
+#ifdef ENABLE_EXECUTE_STACK
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
                      LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
 #endif
@@ -7506,7 +7506,7 @@
 
   /* Call __enable_execute_stack after writing onto the stack to make sure
      the stack address is accessible.  */
-#ifdef TRANSFER_FROM_TRAMPOLINE
+#ifdef ENABLE_EXECUTE_STACK
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
                      LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
 #endif

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 14:39 [PATCH] Export __enable_execute_stack Eric Botcazou
@ 2004-06-11 22:17 ` Richard Henderson
  2004-06-11 22:45   ` Eric Botcazou
  2004-06-14 13:13 ` Jakub Jelinek
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2004-06-11 22:17 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Fri, Jun 11, 2004 at 03:40:13PM +0200, Eric Botcazou wrote:
> 	* libgcc-std.ver (GCC_3.5): New version.  Inherit from GCC_3.4
> 	and declare __enable_execute_stack.

See the discussion with Andreas re __unord[sd]f2.


r~

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 22:17 ` Richard Henderson
@ 2004-06-11 22:45   ` Eric Botcazou
  2004-06-11 22:55     ` Richard Henderson
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Botcazou @ 2004-06-11 22:45 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

> See the discussion with Andreas re __unord[sd]f2.

Is it really the same case?  Most targets don't have __enable_execute_stack 
as of today.

-- 
Eric Botcazou

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 22:45   ` Eric Botcazou
@ 2004-06-11 22:55     ` Richard Henderson
  2004-06-11 23:08       ` Eric Botcazou
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2004-06-11 22:55 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Fri, Jun 11, 2004 at 11:24:18PM +0200, Eric Botcazou wrote:
> Is it really the same case?

Yes, since __enable_execute_stack is a very old function.

> Most targets don't have __enable_execute_stack as of today.

Those that need it, have it.


r~

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 22:55     ` Richard Henderson
@ 2004-06-11 23:08       ` Eric Botcazou
  2004-06-11 23:42         ` Richard Henderson
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Botcazou @ 2004-06-11 23:08 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

> Yes, since __enable_execute_stack is a very old function.

For a minority of platforms, though.

Pardon me, but what is exactly the rationale for applying this kind of patch 
to the 3.3 branch?  __enable_execute_stack has always been hidden and I fail 
to see the need to uncover it now, IMHO that's not worth the risk.

-- 
Eric Botcazou

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 23:08       ` Eric Botcazou
@ 2004-06-11 23:42         ` Richard Henderson
  2004-06-12 11:39           ` Eric Botcazou
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Henderson @ 2004-06-11 23:42 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

On Fri, Jun 11, 2004 at 11:44:49PM +0200, Eric Botcazou wrote:
> Pardon me, but what is exactly the rationale for applying this kind of patch 
> to the 3.3 branch?  __enable_execute_stack has always been hidden and I fail 
> to see the need to uncover it now, IMHO that's not worth the risk.

I presume the reason you're trying to export it now is that
Stuff Is Broken.  It would seem to me that if this fixes it
now, that it'll fix the same problem in 3.3.


r~

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 23:42         ` Richard Henderson
@ 2004-06-12 11:39           ` Eric Botcazou
  2004-06-12 12:14             ` Jakub Jelinek
  0 siblings, 1 reply; 15+ messages in thread
From: Eric Botcazou @ 2004-06-12 11:39 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

> I presume the reason you're trying to export it now is that
> Stuff Is Broken.  It would seem to me that if this fixes it
> now, that it'll fix the same problem in 3.3.

Yes.  But the fix is essentially for Ada and the Ada compiler in 3.3.x is not 
very reliable so I don't think we should care.  So, unless you really have a 
strong opinion about this, I'll re-submit a patch for mainline and 3.4 
branch once 3.4.1 is out.

-- 
Eric Botcazou

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-12 11:39           ` Eric Botcazou
@ 2004-06-12 12:14             ` Jakub Jelinek
  2004-06-12 16:39               ` Eric Botcazou
  2004-06-13 17:09               ` Arnaud Charlet
  0 siblings, 2 replies; 15+ messages in thread
From: Jakub Jelinek @ 2004-06-12 12:14 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Richard Henderson, gcc-patches

On Sat, Jun 12, 2004 at 07:55:23AM +0200, Eric Botcazou wrote:
> > I presume the reason you're trying to export it now is that
> > Stuff Is Broken.  It would seem to me that if this fixes it
> > now, that it'll fix the same problem in 3.3.
> 
> Yes.  But the fix is essentially for Ada and the Ada compiler in 3.3.x is not 
> very reliable so I don't think we should care.  So, unless you really have a 
> strong opinion about this, I'll re-submit a patch for mainline and 3.4 
> branch once 3.4.1 is out.

My experience with Ada on ia64 is completely different, 3.4.x is unusable
while 3.3.x somehow works.

	Jakub

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-12 12:14             ` Jakub Jelinek
@ 2004-06-12 16:39               ` Eric Botcazou
  2004-06-13  8:26                 ` Richard Henderson
  2004-06-13 17:09               ` Arnaud Charlet
  1 sibling, 1 reply; 15+ messages in thread
From: Eric Botcazou @ 2004-06-12 16:39 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Henderson, gcc-patches

> My experience with Ada on ia64 is completely different, 3.4.x is unusable
> while 3.3.x somehow works.

Could you elaborate?  Front-end problems or back-end problems?

-- 
Eric Botcazou

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-12 16:39               ` Eric Botcazou
@ 2004-06-13  8:26                 ` Richard Henderson
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Henderson @ 2004-06-13  8:26 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: Jakub Jelinek, gcc-patches

On Sat, Jun 12, 2004 at 04:21:24PM +0200, Eric Botcazou wrote:
> Could you elaborate?  Front-end problems or back-end problems?

No idea.  Bootstrap failure on most 64-bit targets though.


r~

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-12 12:14             ` Jakub Jelinek
  2004-06-12 16:39               ` Eric Botcazou
@ 2004-06-13 17:09               ` Arnaud Charlet
  2004-06-13 17:54                 ` Jakub Jelinek
  1 sibling, 1 reply; 15+ messages in thread
From: Arnaud Charlet @ 2004-06-13 17:09 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Eric Botcazou, Richard Henderson, gcc-patches

> My experience with Ada on ia64 is completely different, 3.4.x is unusable
> while 3.3.x somehow works.

I disagree: 3.3.x is a poor Ada compiler, and since this bug is in a corner
case, I don't think we need this change in 3.3

Also, I have the same question as Eric. AFAIK, 3.4 on ia64 is in a reasonable
shape wrt Ada.

Arno

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-13 17:09               ` Arnaud Charlet
@ 2004-06-13 17:54                 ` Jakub Jelinek
  2004-06-13 18:19                   ` Arnaud Charlet
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Jelinek @ 2004-06-13 17:54 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: Eric Botcazou, Richard Henderson, gcc-patches

On Sun, Jun 13, 2004 at 06:20:33PM +0200, Arnaud Charlet wrote:
> > My experience with Ada on ia64 is completely different, 3.4.x is unusable
> > while 3.3.x somehow works.
> 
> I disagree: 3.3.x is a poor Ada compiler, and since this bug is in a corner
> case, I don't think we need this change in 3.3
> 
> Also, I have the same question as Eric. AFAIK, 3.4 on ia64 is in a reasonable
> shape wrt Ada.

1) the testsuite hangs (only ever seen on ia64, but basically in all builds
I have to kill manually acats/run_all.sh, as many tests get stuck forever).
I believe this has been talked about a lot on the mailing lists (mainly H.J.Lu)
2) during 3.4.x build with 3.4.x as bootstrap compiler (unlike 3.3.x
bootstrap compiler + 3.4.x build) I get:
./xnmake -b ../nmake.adb
Segmentation fault
Program received signal SIGSEGV, Segmentation fault.
0x20000000002ac1f1 in gnat__spitbol__patterns__xmatch () from /usr/lib/libgnat-3.4.so.1
(gdb) bt
#0  0x20000000002ac1f1 in gnat__spitbol__patterns__xmatch () from /usr/lib/libgnat-3.4.so.1
#1  0x200000000029a980 in gnat__spitbol__patterns__match__7 () from /usr/lib/libgnat-3.4.so.1
#2  0x400000000001e570 in _ada_xnmake ()
#3  0x4000000000004ad0 in main ()
(gdb) disas $pc-33 $pc+32
Dump of assembler code from 0x20000000002ac1d0 to 0x20000000002ac211:
0x20000000002ac1d0 <gnat__spitbol__patterns__xmatch+16976>:     [MMI]       ld4 r14=[r39];;
0x20000000002ac1d1 <gnat__spitbol__patterns__xmatch+16977>:                 adds r17=1,r14
0x20000000002ac1d2 <gnat__spitbol__patterns__xmatch+16978>:                 nop.i 0x0;;
0x20000000002ac1e0 <gnat__spitbol__patterns__xmatch+16992>:     [MII]       nop.m 0x0
0x20000000002ac1e1 <gnat__spitbol__patterns__xmatch+16993>:                 sxt4 r14=r17;;
0x20000000002ac1e2 <gnat__spitbol__patterns__xmatch+16994>:                 sub r14=r14,r15;;
0x20000000002ac1f0 <gnat__spitbol__patterns__xmatch+17008>:     [MMI]       add r14=r14,r32;;
0x20000000002ac1f1 <gnat__spitbol__patterns__xmatch+17009>:                 ld1 r14=[r14]
0x20000000002ac1f2 <gnat__spitbol__patterns__xmatch+17010>:                 nop.i 0x0;;
0x20000000002ac200 <gnat__spitbol__patterns__xmatch+17024>:     [MIB]       nop.m 0x0
0x20000000002ac201 <gnat__spitbol__patterns__xmatch+17025>:                 cmp4.eq p7,p6=r14,r50
0x20000000002ac202 <gnat__spitbol__patterns__xmatch+17026>:           (p07) br.cond.dpnt.few 0x20000000002a8360 <gnat__spitbol__patterns__xmatch+992>
0x20000000002ac210 <gnat__spitbol__patterns__xmatch+17040>:     [MMB]       nop.m 0x0
End of assembler dump.
(gdb) p/x $r14
$1 = 0x5fffffffffffff39
(gdb) p/x $r32
$2 = 0x600000000000e998

Haven't looked into details yet, as I have higher priority things to do than
Ada/ia64 (so for now I'll likely just disable it on ia64).

	Jakub

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-13 17:54                 ` Jakub Jelinek
@ 2004-06-13 18:19                   ` Arnaud Charlet
  0 siblings, 0 replies; 15+ messages in thread
From: Arnaud Charlet @ 2004-06-13 18:19 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Arnaud Charlet, Eric Botcazou, Richard Henderson, gcc-patches

> 1) the testsuite hangs (only ever seen on ia64, but basically in all builds
> I have to kill manually acats/run_all.sh, as many tests get stuck forever).
> I believe this has been talked about a lot on the mailing lists (mainly H.J.Lu)

That's not new, since 3.3 does not have any Ada test suite/
Also, although discussed a lot, it's still a mystery why it sometimes hang
and sometimes doesn't.

> 2) during 3.4.x build with 3.4.x as bootstrap compiler (unlike 3.3.x
> bootstrap compiler + 3.4.x build) I get:
> ./xnmake -b ../nmake.adb
> Segmentation fault

That's also not a new problem: it's due to the new/cleaner way to build Ada,
which requires recompile xnmake.

The bug is also there in 3.3

So to summarize, Ada is most likely in a better shape in 3.4 on ia64,
although it may be trickier to build it.

> Haven't looked into details yet, as I have higher priority things to do than
> Ada/ia64 (so for now I'll likely just disable it on ia64).

Sure.

Arno

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

* Re: [PATCH] Export __enable_execute_stack
  2004-06-11 14:39 [PATCH] Export __enable_execute_stack Eric Botcazou
  2004-06-11 22:17 ` Richard Henderson
@ 2004-06-14 13:13 ` Jakub Jelinek
  1 sibling, 0 replies; 15+ messages in thread
From: Jakub Jelinek @ 2004-06-14 13:13 UTC (permalink / raw)
  To: David Edelsohn, Alan Modra; +Cc: gcc-patches

On Fri, Jun 11, 2004 at 03:40:13PM +0200, Eric Botcazou wrote:
> Hi,
> 
> This patch lets libgcc.so export __enable_execute_stack (the function is 
> required for trampoline support on Solaris, NetBSD, FreeBSD/SPARC64 and OSF).  
> I added a new target macro ENABLE_EXECUTE_STACK so as to uncouple it from 
> TRANSFER_FROM_TRAMPOLINE.

BTW: on ppc-linux at least (but I think darwin too and maybe others)
__trampoline_setup is not exported from libgcc_s.  Shouldn't it be exported
as well (@GCC_3.3.4 or @GCC_3.4.1)?

It causes Ada bootstrap failure: libgnat-3.4.so.1 is linked with gcc -shared
-shared-libgcc and uses this function, so has it as undefined reference.
This means no program can link against that shared library, as ld will die
with:
(cd ada/bldtools; gnatmake -q xeinfo ; ./xeinfo ../einfo.h )
gcc -c   -g  -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes        -DHAVE_CONFIG_H    -I. -Iada -I../../gcc -I../../gcc/ada -I../../gcc/../include  ../../gcc/ada/link.c -o ada/link.o
/usr/bin/ld: xnmake: hidden symbol `__trampoline_setup' in /usr/lib/gcc/ppc64-redhat-linux/3.4.0/libgcc.a(tramp.oS) is referenced by DSO
collect2: ld returned 1 exit status

	Jakub

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

* Re: [PATCH] Export __enable_execute_stack
@ 2004-06-13 18:18 Richard Kenner
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Kenner @ 2004-06-13 18:18 UTC (permalink / raw)
  To: jakub; +Cc: gcc-patches

    2) during 3.4.x build with 3.4.x as bootstrap compiler (unlike 3.3.x
    bootstrap compiler + 3.4.x build) I get:
    ./xnmake -b ../nmake.adb
    Segmentation fault

Indeed, I've seen problems with the various "make" programs on 64-bit
machines for quite a while, but have never the the ambition to debug them.

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

end of thread, other threads:[~2004-06-14 11:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-11 14:39 [PATCH] Export __enable_execute_stack Eric Botcazou
2004-06-11 22:17 ` Richard Henderson
2004-06-11 22:45   ` Eric Botcazou
2004-06-11 22:55     ` Richard Henderson
2004-06-11 23:08       ` Eric Botcazou
2004-06-11 23:42         ` Richard Henderson
2004-06-12 11:39           ` Eric Botcazou
2004-06-12 12:14             ` Jakub Jelinek
2004-06-12 16:39               ` Eric Botcazou
2004-06-13  8:26                 ` Richard Henderson
2004-06-13 17:09               ` Arnaud Charlet
2004-06-13 17:54                 ` Jakub Jelinek
2004-06-13 18:19                   ` Arnaud Charlet
2004-06-14 13:13 ` Jakub Jelinek
2004-06-13 18:18 Richard Kenner

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