This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

update synthetic target for gcc 4.1.1


It looks like gcc 4.1.1, at least under FC5, has added another
run-time dependency. This patch adds the necessary function to the
synthetic target to allow things to link again.

Bart

2006-07-10  Bart Veer  <bartv@ecoscentric.com>

	* src/synth_entry.c (__stack_chk_fail_local): new function needed
	when building with gcc 4.1.1

Index: src/synth_entry.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/synth/arch/current/src/synth_entry.c,v
retrieving revision 1.7
diff -u -r1.7 synth_entry.c
--- src/synth_entry.c	20 Nov 2005 16:21:18 -0000	1.7
+++ src/synth_entry.c	10 Jul 2006 22:26:52 -0000
@@ -54,6 +54,7 @@
 #include <pkgconf/hal.h>
 #include <cyg/infra/cyg_type.h>
 #include <cyg/infra/cyg_ass.h>
+#include <cyg/infra/diag.h>
 #include <cyg/hal/hal_arch.h>
 #include <cyg/hal/hal_intr.h>
 #include <cyg/hal/hal_io.h>
@@ -198,5 +199,18 @@
 }
 #endif
 
+#if (__GNUC__ >= 4)
+// First noticed with gcc 4.1.1. There is now code to detect stack
+// smashing.
+void __attribute__ ((noreturn))
+__stack_chk_fail_local(void)
+{
+    CYG_FAIL("Stack smashing detected, aborting");
+    diag_printf("Application error: stack smashing detected.\n");
+    cyg_hal_sys_exit(1);
+    for (;;);
+}
+#endif
+
 //-----------------------------------------------------------------------------
 // End of entry.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]