This is the mail archive of the ecos-devel@sources.redhat.com 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]

SPARC patch to gcc-3.2.3



I finally managed to track down why gcc-3.x would not create proper eCos images for sparc targets. It is because the gcc sparc-elf target has the C++ pragma init_priority disabled by default! eCos uses this to run the constructors in a particular order. I have attached a patch if anyone is interested. With this patch, a tool chain with binutils-2.13, gcc-3.2.3 and newlib-1.12 is built without problems for --target=sparc-elf

A pre-built tool-chain for linux hosts (bcc-linux-1.0.9)
is availble from:

http://www.gaisler.se/bin/bcc-linux-1.0.9.tar.bz2

Should be installed in /opt .

The same problem still remains in gcc-3.4.3, but this
gcc version does not build newlib correctly, so sparc
users should stay with gcc-3.2.3 for the time being ...

Jiri.
diff -Naur gcc-3.2.3/gcc/config/sparc/elf.h gcc-3.2.3.new/gcc/config/sparc/elf.h
--- gcc-3.2.3/gcc/config/sparc/elf.h	2002-04-05 09:42:43.000000000 +0200
+++ gcc-3.2.3.new/gcc/config/sparc/elf.h	2005-01-30 17:43:32.000000000 +0100
@@ -56,3 +56,11 @@
 #undef UDIVDI3_LIBCALL
 #undef MODDI3_LIBCALL
 #undef UMODDI3_LIBCALL
+
+/* Undefine this so that attribute((init_priority)) works.  */
+#undef CTORS_SECTION_ASM_OP
+#undef DTORS_SECTION_ASM_OP
+
+#define SUPPORTS_INIT_PRIORITY 1
+
+

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