This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

sh-unknown-linux-gnu (Support of specific targets (sh3, sh4, sh3eb, and sh4eb))


Hi there, 

This change is for supporting sh*-unknown-linux-gnu for mainline. 

ChangeLog
2001-10-02  NIIBE Yutaka  <gniibe@m17n.org>

	* libtool.m4 (lt_cv_deplibs_check_method): pass_all for sh*.
	(Already included newer libtool)

gcc/ChangeLog
2001-10-02  kaz Kojima <kkojima@rr.iij4u.or.jp>, NIIBE Yutaka  <gniibe@server1.m17n.org>

	* config.gcc (cpu_type): Added sh*-*-*.
	(tm_file, tmake_file): For sh*-*-linux*, handle sh3, sh4, sh3eb,
	and sh4eb.

	* config/sh/t-linux (TARGET_LIBGCC2_CFLAGS): Remove -fpic.
	(LIBGCC1, CROSS_LIBGCC1, LIBGCC1_TEST): Defined.
	(MULTILIB_OPTIONS): Remove m3e case.
	(MULTILIB_DIRNAMES): Added mb and m4.
	(LIB1ASMFUNCS): Add _fpscr_values.

	* config/sh/linux.h (MD_EXEC_PREFIX, MD_STARTFILE_PREFIX):
	Undefined.
	(DEFAULT_VTABLE_THUNKS, HANDLE_PRAGMA_PACK_PUSH_POP): Defined.
	(CPP_SPEC): Defined.
	(ASM_SPEC): Added -big for sh*-unknown-linux-gnu binutils.
	(CC1_SPEC, CC1PLUS_SPEC): Remove support of m3e.
	(LINK_SPEC): Added -EL/-EB options, -rpathlink option.
	(LIB_SPEC): Handle -mieee.
	(NO_SHARED_LIBGCC_MULTILIB): Added.

	* config/sh/sh3-linux.h, config/sh/sh3eb-linux.h,
	config/sh/sh4-linux.h, config/sh/sh4eb-linux.h,
	config/sh/t-linux-nomulti, config/sh/libgcc-sh.ver: New files.

diff -rc3pN gcc-mainline/libtool.m4 gcc-mainline+patch/libtool.m4
*** gcc-mainline/libtool.m4	Tue Oct  2 11:05:00 2001
--- gcc-mainline+patch/libtool.m4	Tue Oct  2 11:17:38 2001
*************** irix5* | irix6*)
*** 597,603 ****
  # This must be Linux ELF.
  linux-gnu*)
    case $host_cpu in
!   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
      lt_cv_deplibs_check_method=pass_all ;;
    *)
      # glibc up to 2.1.1 does not perform some relocations on ARM
--- 597,603 ----
  # This must be Linux ELF.
  linux-gnu*)
    case $host_cpu in
!   alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
      lt_cv_deplibs_check_method=pass_all ;;
    *)
      # glibc up to 2.1.1 does not perform some relocations on ARM
diff -rc3pN gcc-mainline/gcc/config.gcc gcc-mainline+patch/gcc/config.gcc
*** gcc-mainline/gcc/config.gcc	Tue Oct  2 11:05:07 2001
--- gcc-mainline+patch/gcc/config.gcc	Tue Oct  2 11:17:38 2001
*************** powerpc*-*-*)
*** 240,245 ****
--- 240,248 ----
  sparc*-*-*)
  	cpu_type=sparc
  	;;
+ sh*-*-*)
+ 	cpu_type=sh
+ 	;;
  esac
  
  tm_file=${cpu_type}/${cpu_type}.h
*************** sh-*-rtems*)
*** 2839,2847 ****
  	  thread_file='rtems'
  	fi
  	;;
! sh-*-linux*)
  	tm_file="sh/sh.h sh/elf.h sh/linux.h"
! 	tmake_file="sh/t-sh sh/t-elf sh/t-linux"
  	xmake_file=x-linux
  	gas=yes gnu_ld=yes
  	if test x$enable_threads = xyes; then
--- 2842,2870 ----
  	  thread_file='rtems'
  	fi
  	;;
! sh*-*-linux*)
  	tm_file="sh/sh.h sh/elf.h sh/linux.h"
! 	tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
! 	case $machine in
! 		sh3eb-*)
! 			tm_file="$tm_file sh/sh3eb-linux.h"
! 			tmake_file="$tmake_file sh/t-linux-nomulti"
! 			;;
! 		sh4eb-*)
! 			tm_file="$tm_file sh/sh4eb-linux.h"
! 			tmake_file="$tmake_file sh/t-linux-nomulti"
! 			;;
! 		sh3-*)
! 			tm_file="$tm_file sh/sh3-linux.h"
! 			tmake_file="$tmake_file sh/t-linux-nomulti"
! 			;;
! 		sh4-*)
! 			tm_file="$tm_file sh/sh4-linux.h"
! 			tmake_file="$tmake_file sh/t-linux-nomulti"
! 			;;
! 		*)
! 			;;
! 	esac
  	xmake_file=x-linux
  	gas=yes gnu_ld=yes
  	if test x$enable_threads = xyes; then
diff -rc3pN gcc-mainline/gcc/config/sh/linux.h gcc-mainline+patch/gcc/config/sh/linux.h
*** gcc-mainline/gcc/config/sh/linux.h	Tue Oct  2 11:05:16 2001
--- gcc-mainline+patch/gcc/config/sh/linux.h	Tue Oct  2 11:17:38 2001
*************** along with this program; see the file CO
*** 19,24 ****
--- 19,36 ----
  the Free Software Foundation, 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
  
+ /* We're not SYSVR4 for these. */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
+ 
+ /* This was defined in linux.h.  Define it here also. */
+ #undef  DEFAULT_VTABLE_THUNKS
+ #define DEFAULT_VTABLE_THUNKS   1
+ 
+ /* Likewise.  */
+ #define HANDLE_PRAGMA_PACK_PUSH_POP
+ 
+ 
  /* Run-time Target Specification.  */
  #undef TARGET_VERSION
  #define TARGET_VERSION  fputs (" (SH GNU/Linux with ELF)", stderr);
*************** Boston, MA 02111-1307, USA.  */
*** 47,52 ****
--- 59,73 ----
     %{pthread:-D_REENTRANT -D_PTHREADS} \
  "
  
+ #undef CPP_SPEC
+ #define CPP_SPEC "\
+    %{m4:-D__SH4__} \
+    %{!m4:%(cpp_default_cpu_spec)} \
+    %(subtarget_cpp_spec) \
+    %(subtarget_cpp_ptr_spec) \
+    %(subtarget_cpp_endian_spec) "
+ 
+ 
  #undef SUBTARGET_CPP_ENDIAN_SPEC
  #define SUBTARGET_CPP_ENDIAN_SPEC \
    "%{mb:-D__BIG_ENDIAN__} \
*************** Boston, MA 02111-1307, USA.  */
*** 60,91 ****
  #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -Dlinux -Asystem=posix"
  
  #undef ASM_SPEC
! #define ASM_SPEC  "%{!mb:-little} %{mrelax:-relax}"
  
  #undef CC1_SPEC
  #define CC1_SPEC \
!   "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
  
  #undef CC1PLUS_SPEC
  #define CC1PLUS_SPEC \
!   "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
  
  #undef LINK_SPEC
  #define LINK_SPEC \
!   "%{!mb:-m shlelf_linux} %{mrelax:-relax} \
     %{shared:-shared} \
     %{!static: \
       %{rdynamic:-export-dynamic} \
       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
!      %{!rpath:-rpath /lib}} \
     %{static:-static}"
  
- #undef LIB_SPEC
- #define LIB_SPEC \
-   "%{shared: -lc} \
-    %{!shared: %{pthread:-lthread} \
-      %{profile:-lc_p} %{!profile: -lc}}"
- 
  #undef STARTFILE_SPEC
  #define STARTFILE_SPEC \
    "%{!shared: \
--- 81,110 ----
  #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -Dlinux -Asystem=posix"
  
  #undef ASM_SPEC
! #define ASM_SPEC  "%{mb:-big} %{!mb:-little} %{mrelax:-relax}"
  
  #undef CC1_SPEC
  #define CC1_SPEC \
!   "-musermode %{!mb:-ml} %{!m4:-m3}"
  
  #undef CC1PLUS_SPEC
  #define CC1PLUS_SPEC \
!   "-musermode %{!mb:-ml} %{!m4:-m3}"
  
+ /* XXX: It's wrong if prefix != /usr */
  #undef LINK_SPEC
  #define LINK_SPEC \
!   "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \
     %{shared:-shared} \
     %{!static: \
       %{rdynamic:-export-dynamic} \
       %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
!      %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \
!      %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \
!      %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \
!      %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \
     %{static:-static}"
  
  #undef STARTFILE_SPEC
  #define STARTFILE_SPEC \
    "%{!shared: \
*************** Boston, MA 02111-1307, USA.  */
*** 93,95 ****
--- 112,122 ----
  		       %{!p:%{profile:gcrt1.o%s} \
  			 %{!profile:crt1.o%s}}}} \
     crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+ 
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+   "%{shared: -lc} \
+    %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
+ 	%{profile:-lc_p} %{!profile: -lc}}"
+ 
+ #define NO_SHARED_LIBGCC_MULTILIB
diff -rc3pN gcc-mainline/gcc/config/sh/t-linux gcc-mainline+patch/gcc/config/sh/t-linux
*** gcc-mainline/gcc/config/sh/t-linux	Tue Oct  2 11:05:27 2001
--- gcc-mainline+patch/gcc/config/sh/t-linux	Tue Oct  2 11:17:38 2001
***************
*** 1,10 ****
! TARGET_LIBGCC2_CFLAGS = -fpic
  LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
    _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
!   _ic_invalidate
  
! MULTILIB_OPTIONS= mb m3e/m4
! MULTILIB_DIRNAMES= 
  MULTILIB_MATCHES = 
  
  EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
--- 1,13 ----
! TARGET_LIBGCC2_CFLAGS =
! LIBGCC1 = libgcc1-asm.a
! CROSS_LIBGCC1 = libgcc1-asm.a
! LIBGCC1_TEST = libgcc1-test
  LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
    _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
!   _ic_invalidate _fpscr_values
  
! MULTILIB_OPTIONS= mb m4
! MULTILIB_DIRNAMES= mb m4
  MULTILIB_MATCHES = 
  
  EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
diff -rc3pN gcc-mainline/gcc/config/sh/libgcc-sh.ver gcc-mainline+patch/gcc/config/sh/libgcc-sh.ver
*** gcc-mainline/gcc/config/sh/libgcc-sh.ver	Thu Jan  1 09:00:00 1970
--- gcc-mainline+patch/gcc/config/sh/libgcc-sh.ver	Tue Oct  2 11:49:45 2001
***************
*** 0 ****
--- 1,4 ----
+ GCC_3.0 {
+   global:
+ 	__fpscr_values
+ }
diff -rc3pN gcc-mainline/gcc/config/sh/sh3-linux.h gcc-mainline+patch/gcc/config/sh/sh3-linux.h
*** gcc-mainline/gcc/config/sh/sh3-linux.h	Thu Jan  1 09:00:00 1970
--- gcc-mainline+patch/gcc/config/sh/sh3-linux.h	Tue Oct  2 09:58:30 2001
***************
*** 0 ****
--- 1,31 ----
+ #undef TARGET_VERSION
+ #define TARGET_VERSION  fputs (" (SH3 GNU/Linux with ELF)", stderr);
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC \
+   "-D__LITTLE_ENDIAN__ \
+    -D__SH3__ -D__sh3__ \
+    %{fPIC:-D__PIC__ -D__pic__} \
+    %{fpic:-D__PIC__ -D__pic__} \
+    %{posix:-D_POSIX_SOURCE} \
+    %{pthread:-D_REENTRANT -D_PTHREADS}"
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC  "%{mrelax:-relax}"
+ 
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+   "-musermode -ml -m3"
+ 
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+   "-musermode -ml -m3"
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{mrelax:-relax} \
+    %{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+     %{static:-static}"
diff -rc3pN gcc-mainline/gcc/config/sh/sh3eb-linux.h gcc-mainline+patch/gcc/config/sh/sh3eb-linux.h
*** gcc-mainline/gcc/config/sh/sh3eb-linux.h	Thu Jan  1 09:00:00 1970
--- gcc-mainline+patch/gcc/config/sh/sh3eb-linux.h	Tue Oct  2 09:58:30 2001
***************
*** 0 ****
--- 1,31 ----
+ #undef TARGET_VERSION
+ #define TARGET_VERSION  fputs (" (SH3EB GNU/Linux with ELF)", stderr);
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC \
+   "-D__BIG_ENDIAN__ \
+    -D__SH3__ -D__sh3__ \
+    %{fPIC:-D__PIC__ -D__pic__} \
+    %{fpic:-D__PIC__ -D__pic__} \
+    %{posix:-D_POSIX_SOURCE} \
+    %{pthread:-D_REENTRANT -D_PTHREADS}"
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC  "%{mrelax:-relax}"
+ 
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+   "-musermode -mb -m3"
+ 
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+   "-musermode -mb -m3"
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{mrelax:-relax} \
+    %{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+     %{static:-static}"
diff -rc3pN gcc-mainline/gcc/config/sh/sh4-linux.h gcc-mainline+patch/gcc/config/sh/sh4-linux.h
*** gcc-mainline/gcc/config/sh/sh4-linux.h	Thu Jan  1 09:00:00 1970
--- gcc-mainline+patch/gcc/config/sh/sh4-linux.h	Tue Oct  2 09:58:30 2001
***************
*** 0 ****
--- 1,31 ----
+ #undef TARGET_VERSION
+ #define TARGET_VERSION  fputs (" (SH4 GNU/Linux with ELF)", stderr);
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC \
+   "-D__LITTLE_ENDIAN__ \
+    -D__SH4__ \
+    %{fPIC:-D__PIC__ -D__pic__} \
+    %{fpic:-D__PIC__ -D__pic__} \
+    %{posix:-D_POSIX_SOURCE} \
+    %{pthread:-D_REENTRANT -D_PTHREADS}"
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC  "%{mrelax:-relax}"
+ 
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+   "-musermode -ml -m4"
+ 
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+   "-musermode -ml -m4"
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{mrelax:-relax} \
+    %{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+     %{static:-static}"
diff -rc3pN gcc-mainline/gcc/config/sh/sh4eb-linux.h gcc-mainline+patch/gcc/config/sh/sh4eb-linux.h
*** gcc-mainline/gcc/config/sh/sh4eb-linux.h	Thu Jan  1 09:00:00 1970
--- gcc-mainline+patch/gcc/config/sh/sh4eb-linux.h	Tue Oct  2 09:58:30 2001
***************
*** 0 ****
--- 1,31 ----
+ #undef TARGET_VERSION
+ #define TARGET_VERSION  fputs (" (SH4EB GNU/Linux with ELF)", stderr);
+ 
+ #undef CPP_SPEC
+ #define CPP_SPEC \
+   "-D__BIG_ENDIAN__ \
+    -D__SH4__ \
+    %{fPIC:-D__PIC__ -D__pic__} \
+    %{fpic:-D__PIC__ -D__pic__} \
+    %{posix:-D_POSIX_SOURCE} \
+    %{pthread:-D_REENTRANT -D_PTHREADS}"
+ 
+ #undef ASM_SPEC
+ #define ASM_SPEC  "%{mrelax:-relax}"
+ 
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+   "-musermode -mb -m4"
+ 
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+   "-musermode -mb -m4"
+ 
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+   "%{mrelax:-relax} \
+    %{shared:-shared} \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+     %{static:-static}"
diff -rc3pN gcc-mainline/gcc/config/sh/t-linux-nomulti gcc-mainline+patch/gcc/config/sh/t-linux-nomulti
*** gcc-mainline/gcc/config/sh/t-linux-nomulti	Thu Jan  1 09:00:00 1970
--- gcc-mainline+patch/gcc/config/sh/t-linux-nomulti	Tue Oct  2 09:58:30 2001
***************
*** 0 ****
--- 1,11 ----
+ LIBGCC = libgcc.a
+ EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o
+ 
+ SHLIB_MAPFILES += $(srcdir)/config/sh/libgcc-sh.ver
+ 
+ INSTALL_LIBGCC = install-libgcc
+ 
+ MULTILIB_OPTIONS=
+ MULTILIB_DIRNAMES= 
+ MULTILIB_MATCHES = 
+ EXTRA_MULTILIB_PARTS=
-- 


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