Article View: gnu.gcc.bug
Article #1384Fix for LINK_SPEC and SIZE_TYPE in config files for mips-riscos5.00
From: Mike Rendell
Date: Thu, 12 Nov 1992 06:38
Date: Thu, 12 Nov 1992 06:38
117 lines
4661 bytes
4661 bytes
Environment: Mips M/120 running Riscos 5.00, gcc 2.3.1
The LINK_SPEC in mips-5*.h knows about the `-shared' and `-non_shared'
ld options but doesn't know about `-call_shared'. `-shared' means
build a shared library object, `-non_shared' means build a staticly
linked executable and `-call_shared' means build a dynamically linked
executable. The following diffs let gcc know about -call_shared.
The diff for config/mips-5bsd.h also adds a definition for SIZE_TYPE.
This is because, in the bsd43 environment, `size_t' is a signed long,
not the default unsigned long.
By the way, code compiled by gcc 2.3.1 can't make use of shared
libraries because of a bug in Mips's dynamic linker. The linker
messes with the stack frames of functions, adding and modifying
instructions as necessary. In the process, it adjusts `move $sp,$fp'
instructions in function epilogues the wrong way. The result is
that the function returns to a random address (usually causes a
memory fault).
*** config/mips-5.h.orig Sun Nov 8 11:45:05 1992
--- config/mips-5.h Sun Nov 8 11:46:20 1992
***************
*** 24,29 ****
%{EB} %{!EB: -EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{non_shared} %{!shared: %{!non_shared: -non_shared}}"
#include "mips.h"
--- 24,30 ----
%{EB} %{!EB: -EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{call_shared} %{non_shared} \
! %{!shared:%{!call_shared:%{!non_shared: -non_shared}}}}"
#include "mips.h"
*** config/mips-5bsd.h.orig Sun Nov 8 14:43:39 1992
--- config/mips-5bsd.h Sun Nov 8 14:43:58 1992
***************
*** 37,43 ****
%{EB} %{!EB: -EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{non_shared} %{!shared: %{!non_shared: -non_shared}} \
-systype /bsd43/ }"
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} -lc"
--- 37,44 ----
%{EB} %{!EB: -EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{call_shared} %{non_shared} \
! %{!shared:%{!call_shared:%{!non_shared: -non_shared}}} \
-systype /bsd43/ }"
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} -lc"
***************
*** 52,56 ****
--- 53,60 ----
/* Override defaults for finding the MIPS tools. */
#define MD_STARTFILE_PREFIX "/bsd43/usr/lib/cmplrs/cc/"
#define MD_EXEC_PREFIX "/bsd43/usr/lib/cmplrs/cc/"
+
+ /* This is non-ANSI, but it's whats in /usr/include/bsd43/sys/types.h */
+ #define SIZE_TYPE "long int"
#include "mips.h"
*** config/mips-5svr4.h.orig Sun Nov 8 11:45:05 1992
--- config/mips-5svr4.h Sun Nov 8 11:46:54 1992
***************
*** 37,43 ****
%{EB} %{!EB:-EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{non_shared} %{!shared: %{!non_shared: -non_shared}} \
-systype /svr4/}"
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} -lc crtn.o%s"
--- 37,44 ----
%{EB} %{!EB:-EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{call_shared} %{non_shared} \
! %{!shared:%{!call_shared:%{!non_shared: -non_shared}}} \
-systype /svr4/}"
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} -lc crtn.o%s"
*** config/mips-5sysv.h.orig Sun Nov 8 11:45:06 1992
--- config/mips-5sysv.h Sun Nov 8 11:47:05 1992
***************
*** 37,43 ****
%{EB} %{!EB:-EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{non_shared} %{!shared: %{!non_shared: -non_shared}} \
-systype /sysv/}"
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} -lc crtn.o%s"
--- 37,44 ----
%{EB} %{!EB:-EB} \
%{EL: %e-EL not supported} \
%{mips1} %{mips2} %{mips3} %{bestGnum} \
! %{shared} %{call_shared} %{non_shared} \
! %{!shared:%{!call_shared:%{!non_shared: -non_shared}}} \
-systype /sysv/}"
#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} -lc crtn.o%s"
--
Michael Rendell - Dept. of Comp. Sci., Memorial University of Newfoundland
Technical Details
Message-ID:
<9211121356.AA07132@mercury.cs.mun.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!know!mips2!news.bbn.com!usc!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mercury.cs.mun.ca!michaelShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!know!mips2!news.bbn.com!usc!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!mercury.cs.mun.ca!michael From: michael@mercury.cs.mun.ca (Mike Rendell) Newsgroups: gnu.gcc.bug Subject: Fix for LINK_SPEC and SIZE_TYPE in config files for mips-riscos5.00 Message-ID: <9211121356.AA07132@mercury.cs.mun.ca> Date: 12 Nov 92 06:38:58 GMT Sender: gnulists@ai.mit.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 117 Approved: bug-gcc@prep.ai.mit.edu