eggert@SM.UNISYS.COM (Paul Eggert) (09/22/88)
In building GCC 1.28 for a Sun-3/50 without a floating point unit, I found it difficult to figure out exactly how to change CPP_SPEC and STARTFILE_SPEC. The machine-dependent definitions for CPP_SPEC and STARTFILE_SPEC can be determined automatically from TARGET_DEFAULT, and it will make it much easier for us novices with cheap Sun-3s if there's only one definition to change. Here are changes for tm-sun3.h that deduce CPP_SPEC and STARTFILE_SPEC automatically from TARGET_DEFAULT's value. (I suppose that another possibility would be to have a tm-sun3-50.h file.) (Better yet, why not make soft-float the default on Suns? This would encourage users to switch from Sun's C compiler, because soft-float is Sun's default and it would be one less incompatibility for users to worry about.) =================================================================== RCS file: RCS/tm-sun3.h,v retrieving revision 1.28 diff -c2 -r1.28 tm-sun3.h *** /tmp/,RCSt1a08911 Wed Sep 21 11:38:56 1988 --- tm-sun3.h Wed Sep 21 09:48:53 1988 *************** *** 9,14 **** --- 9,21 ---- Also inform the program which CPU this is for. */ + #if TARGET_DEFAULT & 0102 + /* m68881 or mfpa is the default */ #define CPP_SPEC "%{!msoft-float:-D__HAVE_FPU__}\ %{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}" + #else + /* msoft-float is the default */ + #define CPP_SPEC "%{m68881:-D__HAVE_FPU__}%{mfpa:-D__HAVE_FPU__}\ + %{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}" + #endif /* -m68000 requires special flags to the assembler. */ *************** *** 24,37 **** This is necessary (tr: Sun does it) for both the m68881 and the fpa routines. - Note that includes knowledge of the default specs for gcc, ie. no - args translates to the same effect as -m68881 I'm not sure what would happen below if people gave contradictory arguments (eg. -msoft-float -mfpa) */ #define STARTFILE_SPEC \ "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}\ ! %{mfpa:Wcrt1.o%s} %{!mfpa:%{m68881:Mcrt1.o%s}} \ ! %{!mfpa:%{msoft-float:Fcrt1.o%s}} \ ! %{!mfpa:%{!m68881:%{!msoft-float:Mcrt1.o%s}}}" /* Every structure or union's size must be a multiple of 2 bytes. */ --- 31,61 ---- This is necessary (tr: Sun does it) for both the m68881 and the fpa routines. I'm not sure what would happen below if people gave contradictory arguments (eg. -msoft-float -mfpa) */ + #if TARGET_DEFAULT & 0100 + /* mfpa is the default */ #define STARTFILE_SPEC \ "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}\ ! %{m68881:Mcrt1.o%s} \ ! %{msoft-float:Fcrt1.o%s} \ ! %{!m68881:%{!msoft-float:Wcrt1.o%s}}" ! #else ! #if TARGET_DEFAULT & 2 ! /* m68881 is the default */ ! #define STARTFILE_SPEC \ ! "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}\ ! %{mfpa:Wcrt1.o%s} \ ! %{msoft-float:Fcrt1.o%s} \ ! %{!mfpa:%{!msoft-float:Mcrt1.o%s}}" ! #else ! /* msoft-float is the default */ ! #define STARTFILE_SPEC \ ! "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}\ ! %{m68881:Mcrt1.o%s} \ ! %{mfpa:Wcrt1.o%s} \ ! %{!m68881:%{!mfpa:Fcrt1.o%s}}" ! #endif ! #endif /* Every structure or union's size must be a multiple of 2 bytes. */