From: Bryan R. <br...@ix...> - 2001-06-19 04:53:34
|
Hello, Is anyone successfully using gcc-3.0 with the sh4? I have tried building several toolchains based on it, and they all compile the 2.4.5 kernel succesfully (after a minor xtime patch which I've included below). However, I can't get gcc-3.0 to produce ANY working user code (not even hello1-20000824!) If you are using gcc-3.0 stable, or a recent gcc-3.0pre snapshot with the sh4, I would GREATLY appreciate build instructions, as well as what version of binutils, the kernel, and glibc you are using. Lots of patches are used in the instructions here: http://linuxsh.sourceforge.net/docs/abe/20010320-gcc2.97/README_E.php3 and most of them won't apply to 3.0. Based on the 2.97 patches, I've created a very minimal gcc-3.0 patch: --- gcc.orig/gcc/config/sh/linux.h Mon Jun 11 20:13:39 2001 +++ gcc/gcc/config/sh/linux.h Mon Jun 11 20:17:00 2001 @@ -43,9 +43,9 @@ #define CPP_SPEC \ "%{mb:-D__BIG_ENDIAN__} \ %{!mb:-D__LITTLE_ENDIAN__} \ - %{m3e:-D__SH3E__} \ %{m4:-D__SH4__} \ - %{!m3e:%{!m4:-D__SH3__ -D__sh3__}} \ + %{!m4:%{m4-nofpu:-D__SH4__ -D__SH4_NOFPU__}} \ + %{!m4:%{!m4-nofpu:-D__SH3__ -D__sh3__}} \ %{fPIC:-D__PIC__ -D__pic__} \ %{fpic:-D__PIC__ -D__pic__} \ %{posix:-D_POSIX_SOURCE} \ @@ -59,11 +59,11 @@ #undef CC1_SPEC #define CC1_SPEC \ - "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" + "-musermode %{!mb:-ml} %{!m4:%{!m4-nofpu:-m3}}" #undef CC1PLUS_SPEC #define CC1PLUS_SPEC \ - "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" + "-musermode %{!mb:-ml} %{!m4:%{!m4-nofpu:-m3}}" #undef LINK_SPEC #define LINK_SPEC \ @@ -71,7 +71,7 @@ %{shared:-shared} \ %{!static: \ %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ %{!rpath:-rpath /lib}} \ %{static:-static}" --- gcc.orig/gcc/config/sh/t-linux Mon Jun 11 21:27:46 2001 +++ gcc/gcc/config/sh/t-linux Mon Jun 11 21:29:05 2001 @@ -4,7 +4,7 @@ _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ _ic_invalidate -MULTILIB_OPTIONS= mb m3e/m4 +MULTILIB_OPTIONS= m4 MULTILIB_DIRNAMES= MULTILIB_MATCHES = But it doesn't work for user-mode stuff. :( And here's the minor gcc-3.0 build patch for Linux 2.4.5: --- include/linux/sched-orig.h Mon Jun 18 18:45:18 2001 +++ include/linux/sched.h Mon Jun 18 18:45:27 2001 @@ -537,7 +537,7 @@ extern unsigned long volatile jiffies; extern unsigned long itimer_ticks; extern unsigned long itimer_next; -extern struct timeval xtime; +extern volatile struct timeval xtime; extern void do_timer(struct pt_regs *); extern unsigned int * prof_buffer; Suggestions? (Thanks in advance) Regards, Bryan -- Bryan Rittmeyer mailto:br...@ix... |