From: J. Kean Johnston Date: Mon, 22 Sep 1997 17:31:47 +0000 (+0000) Subject: sco5.h: Make ELF default file format and add -mcoff/-melf.. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fbf8b71c36b4c47adc8fa005e97070ca4ece8668;p=gcc.git sco5.h: Make ELF default file format and add -mcoff/-melf.. * i386/sco5.h: Make ELF default file format and add -mcoff/-melf.. (MULTILIB_DEFAULTS): Define. (ASM_SPEC, CPP_SPEC): Handle -mcoff. (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): Likewise. (LIBGCC_SPEC): Likewise. (MASK_COFF, TARGET_COFF, TARGET_ELF): Define. (SUBTARGET_SWITCHES): Add -mcoff and -melf. * i386/t-sco5 (CRTSTUFF_T_CFLAGS): Add -fPIC. (CRTSTUFF_T_CFLAGS_S): Tweak for COFF. (EXTRA_PARTS, TAROUTOPTS): Delete. (libgcc1-elf, libgcc2-elf, libgcc-elf targets): Delete. (MULTILIB_OPTIONS): Define. (MULTILIB_DIRNAMES, MULTILIB_EXCEPTIONS): Likewise. (MULTILIB_MATCHE, MULTILIB_EXTRA_OPTS): Likewise. SCO Open Server patches. From-SVN: r15627 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 97348d84895..40f26a668e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +Mon Sep 22 11:21:33 1997 J. Kean Johnston + + * i386/sco5.h: Make ELF default file format and add -mcoff/-melf.. + (MULTILIB_DEFAULTS): Define. + (ASM_SPEC, CPP_SPEC): Handle -mcoff. + (STARTFILE_SPEC, ENDFILE_SPEC, LINK_SPEC): Likewise. + (LIBGCC_SPEC): Likewise. + (MASK_COFF, TARGET_COFF, TARGET_ELF): Define. + (SUBTARGET_SWITCHES): Add -mcoff and -melf. + * i386/t-sco5 (CRTSTUFF_T_CFLAGS): Add -fPIC. + (CRTSTUFF_T_CFLAGS_S): Tweak for COFF. + (EXTRA_PARTS, TAROUTOPTS): Delete. + (libgcc1-elf, libgcc2-elf, libgcc-elf targets): Delete. + (MULTILIB_OPTIONS): Define. + (MULTILIB_DIRNAMES, MULTILIB_EXCEPTIONS): Likewise. + (MULTILIB_MATCHE, MULTILIB_EXTRA_OPTS): Likewise. + Mon Sep 22 02:10:43 1997 Jeffrey A Law (law@cygnus.com) * version.c: Bump for snapshot. diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h index baf9bc318ca..40862e0c904 100644 --- a/gcc/config/i386/sco5.h +++ b/gcc/config/i386/sco5.h @@ -737,6 +737,12 @@ dtors_section () \ #define WCHAR_TYPE "long int" #define WCHAR_TYPE_SIZE BITS_PER_WORD +/* + * New for multilib support. Set the default switches for multilib, + * which is -melf. + */ +#define MULTILIB_DEFAULTS { "melf" } + /* Please note that these specs may look messy but they are required in order to emulate the SCO Development system as closely as possible. @@ -759,20 +765,20 @@ dtors_section () \ does. SCO also allows you to compile, link and generate either ELF or COFF - binaries. With gcc, as with the SCO compiler, the default is coff. - Specify -melf to gcc to produce elf binaries. -fpic will get the + binaries. With gcc, unlike the SCO compiler, the default is ELF. + Specify -mcoff to gcc to produce elf binaries. -fpic will get the assembler and linker to produce PIC code. */ /* Set up assembler flags for PIC and ELF compilations */ #undef ASM_SPEC #define ASM_SPEC \ - "-b %{melf:elf}%{!melf:coff \ - %{static:%e-static only valid with -melf} \ - %{shared:%e-shared only valid with -melf} \ - %{symbolic:%e-symbolic only valid with -melf}} \ + "-b %{!mcoff:elf}%{mcoff:coff \ + %{static:%e-static not valid with -mcoff} \ + %{shared:%e-shared not valid with -mcoff} \ + %{symbolic:%e-symbolic not valid with -mcoff}} \ %{Ym,*} %{Yd,*} %{Wa,*:%*} \ - %{melf:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}" + %{!mcoff:-E%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},ELF %{Qn:} %{!Qy:-Qn}}" /* Use crt1.o as a startup file and crtn.o as a closing file. */ @@ -790,13 +796,13 @@ dtors_section () \ %{!Xc:%{Xk:values-Xk.o%s} \ %{!Xk:%{Xt:values-Xt.o%s} \ %{!Xt:values-Xa.o%s}}}}}} \ - %{!melf:crtbegin.o%s} \ - %{melf:%{static:crtbegin.o%s}%{!static:crtbeginS.o%s}}" + %{mcoff:crtbeginS.o%s} \ + %{!mcoff:%{!static:crtbegin.o%s}%{static:crtbeginS.o%s}}" #undef ENDFILE_SPEC #define ENDFILE_SPEC \ - "%{melf:%{!static:crtendS.o%s}%{static:crtend.o%s}} \ - %{!melf:crtend.o%s} \ + "%{!mcoff:%{!static:crtend.o%s}%{static:crtendS.o%s}} \ + %{mcoff:crtendS.o%s} \ %{pg:gcrtn.o%s}%{!pg:crtn.o%s}" #undef CPP_PREDEFINES @@ -807,8 +813,8 @@ dtors_section () \ #undef CPP_SPEC #define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \ - %{fpic:%{!melf:%e-fpic is only valid with -melf}} \ - %{fPIC:%{!melf:%e-fPIC is only valid with -melf}} \ + %{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \ + %{fPIC:%{mcoff:%e-fPIC is not valid with -mcoff}} \ -D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX \ %{!Xods30:-D_STRICT_NAMES} \ %{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \ @@ -828,9 +834,9 @@ dtors_section () \ -DM_WORDSWAP}}}} \ %{scointl:-DM_INTERNAT -D_M_INTERNAT} \ %{traditional:-D_KR -D_SVID -D_NO_PROTOTYPE} \ - %{melf:-D_SCO_ELF} \ - %{!melf:-D_M_COFF -D_SCO_COFF} \ - %{melf:%{fpic:-D__PIC__ -D__pic__} \ + %{!mcoff:-D_SCO_ELF} \ + %{mcoff:-D_M_COFF -D_SCO_COFF} \ + %{!mcoff:%{fpic:-D__PIC__ -D__pic__} \ %{fPIC:%{!fpic:-D__PIC__ -D__pic__}}} \ %{Xa:-D_SCO_C_DIALECT=1} \ %{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \ @@ -841,19 +847,19 @@ dtors_section () \ #undef LINK_SPEC #define LINK_SPEC \ - "-b %{melf:elf}%{!melf:coff \ - %{static:%e-static only valid with -melf} \ - %{shared:%e-shared only valid with -melf} \ - %{symbolic:%e-symbolic only valid with -melf} \ - %{fpic:%e-fpic only valid with -melf} \ - %{fPIC:%e-fPIC only valid with -melf}} \ - -R%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},%{melf:ELF}%{!melf:COFF} \ + "-b %{!mcoff:elf}%{mcoff:coff \ + %{static:%e-static not valid with -mcoff} \ + %{shared:%e-shared not valid with -mcoff} \ + %{symbolic:%e-symbolic not valid with -mcoff} \ + %{fpic:%e-fpic not valid with -mcoff} \ + %{fPIC:%e-fPIC not valid with -mcoff}} \ + -R%{Xa:a}%{!Xa:%{Xc:c}%{!Xc:%{Xk:k}%{!Xk:%{Xt:t}%{!Xt:a}}}},%{ansi:ansi}%{!ansi:%{posix:posix}%{!posix:%{Xpg4:xpg4}%{!Xpg4:%{Xpg4plus:XPG4PLUS}%{!Xpg4plus:%{Xods30:ods30}%{!Xods30:XPG4PLUS}}}}},%{mcoff:COFF}%{!mcoff:ELF} \ %{Wl,*%*} %{YP,*} %{YL,*} %{YU,*} \ %{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \ %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \ %{h*} %{static:-dn -Bstatic} %{shared:-G -dy %{!z*:-z text}} \ %{symbolic:-Bsymbolic -G -dy %{!z*:-z text}} %{z*} %{R*} %{Y*} \ - %{G:-G} %{melf:%{Qn:} %{!Qy:-Qn}}" + %{G:-G} %{!mcoff:%{Qn:} %{!Qy:-Qn}}" /* The SCO COFF linker gets confused on the difference between "-ofoo" and "-o foo". So we just always force a single space. */ @@ -867,15 +873,14 @@ dtors_section () \ #define LIB_SPEC \ "%{!shared:%{!symbolic:-lcrypt -lgen -lc}}" -#undef LIBGCC_SPEC -#define LIBGCC_SPEC \ - "%{!melf:-lgcc}%{melf:%{!shared:%{!symbolic:-lgcc-elf}}}" - -#define MASK_ELF 010000000000 /* Mask for elf generation */ -#define TARGET_ELF (target_flags & MASK_ELF) +#define MASK_COFF 010000000000 /* Mask for elf generation */ +#define TARGET_COFF (target_flags & MASK_COFF) +#define TARGET_ELF (!(target_flags & MASK_COFF)) #undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES { "elf", MASK_ELF }, +#define SUBTARGET_SWITCHES \ + { "coff", MASK_COFF }, \ + { "elf", -MASK_COFF }, #define NO_DOLLAR_IN_LABEL diff --git a/gcc/config/i386/t-sco5 b/gcc/config/i386/t-sco5 index 8dd7c5670e9..fd3d6c63b8e 100644 --- a/gcc/config/i386/t-sco5 +++ b/gcc/config/i386/t-sco5 @@ -1,91 +1,16 @@ # The pushl in CTOR initialization interferes with frame pointer elimination. -CRTSTUFF_T_CFLAGS =-fno-omit-frame-pointer -CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -melf -fPIC +CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer +CRTSTUFF_T_CFLAGS_S = -mcoff -fno-omit-frame-pointer # -# Becuase we can be compiling for either elf or coff, we need to create -# special versions of libgcc.a. It IS possible for this not to be done -# and let the SCO linker transform the coff objects (which are created -# by default) into elf objects. However, this is inefficient. So, -# we create a libgcc-elf.a, which is used in the specs in sco5.h. -# These are the rules for doing that. +# I am still a little unsure of the multilib architecture. The following +# 4 lines are based on advice from meissner@cygnus.com. # -# NOTE: This is duplicated directly from Makefile.in. If you change it -# there, be sure to change things here! -# -EXTRA_PARTS = libgcc-elf.a crtbegin.o crtend.o crtbeginS.o crtendS.o -TAROUTOPTS = xpf - -libgcc1-elf.a: stamp-crtS libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status - -rm -f tmplibgcc1-elf.a - for name in $(LIB1FUNCS); \ - do \ - echo $${name}; \ - rm -f $${name}$(objext); \ - $(OLDCC) -DIN_LIBGCC1 -dy $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \ - if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ - mv libgcc1$(objext) $${name}$(objext); \ - $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1-elf.a $${name}$(objext); \ - rm -f $${name}$(objext); \ - done - for file in .. $(LIB1FUNCS_EXTRA); \ - do \ - if [ x$${file} != x.. ]; then \ - name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \ - echo $${name}; \ - if [ $${name}.asm = $${file} ]; then \ - cp $${file} $${name}.s || exit 1; file=$${name}.s; \ - else true; fi; \ - $(OLDCC) -DIN_LIBGCC1 -dy $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \ - if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ - $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1-elf.a $${name}$(objext); \ - if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ - rm -f $${name}.s $${name}$(objext); \ - else true; \ - fi; \ - done - -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc1-elf.a; else true; fi - mv tmplibgcc1-elf.a libgcc1-elf.a - -libgcc2-elf.a: stamp-crtS libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \ - machmode.h longlong.h gbl-ctors.h config.status - -rm -f tmplibgcc2-elf.a - for name in $(LIB2FUNCS); \ - do \ - echo $${name}; \ - $(GCC_FOR_TARGET) -melf $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \ - $(srcdir)/libgcc2.c -o $${name}$(objext); \ - if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ - $(AR) $(AR_FLAGS) tmplibgcc2-elf.a $${name}$(objext); \ - rm -f $${name}$(objext); \ - done - for file in .. $(LIB2FUNCS_EXTRA); \ - do \ - if [ x$${file} != x.. ]; then \ - name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \ - oname=` echo $${name} | sed -e 's,.*/,,'`; \ - echo $${name}; \ - if [ $${name}.asm = $${file} ]; then \ - cp $${file} $${name}.s || exit 1; file=$${name}.s; \ - else true; fi; \ - $(GCC_FOR_TARGET) -melf $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \ - if [ $$? -eq 0 ] ; then true; else exit 1; fi; \ - $(AR) $(AR_FLAGS) tmplibgcc2-elf.a $${oname}$(objext); \ - rm -f $${name}.s $${oname}$(objext); \ - else true; \ - fi; \ - done - mv tmplibgcc2-elf.a libgcc2-elf.a - -# Combine the various libraries into a single library, libgcc.a. -libgcc-elf.a: libgcc1-elf.a libgcc2-elf.a - -rm -rf tmplibgcc-elf.a libgcc-elf.a tmpcopy - mkdir tmpcopy - -(cd tmpcopy; $(AR) x ../libgcc1-elf.a) - -(cd tmpcopy; chmod +w * > /dev/null 2>&1) - -(cd tmpcopy; $(AR) x ../libgcc2-elf.a) - (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc-elf.a *$(objext)) - rm -rf tmpcopy - -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc-elf.a; else true; fi - mv tmplibgcc-elf.a libgcc-elf.a +MULTILIB_OPTIONS = mcoff/fPIC +MULTILIB_DIRNAMES = coff pic +MULTILIB_EXCEPTIONS = *mcoff*/*fPIC* +MULTILIB_MATCHES = fPIC=fpic +MULTILIB_EXTRA_OPTS = +LIBGCC=stmp-multilib +INSTALL_LIBGCC=install-multilib