Commit fbf8b71c by J. Kean Johnston Committed by Jeff Law

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
parent c14a951f
Mon Sep 22 11:21:33 1997 J. Kean Johnston <jkj@sco.com>
* 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) Mon Sep 22 02:10:43 1997 Jeffrey A Law (law@cygnus.com)
* version.c: Bump for snapshot. * version.c: Bump for snapshot.
......
...@@ -737,6 +737,12 @@ dtors_section () \ ...@@ -737,6 +737,12 @@ dtors_section () \
#define WCHAR_TYPE "long int" #define WCHAR_TYPE "long int"
#define WCHAR_TYPE_SIZE BITS_PER_WORD #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 /* Please note that these specs may look messy but they are required in
order to emulate the SCO Development system as closely as possible. order to emulate the SCO Development system as closely as possible.
...@@ -759,20 +765,20 @@ dtors_section () \ ...@@ -759,20 +765,20 @@ dtors_section () \
does. does.
SCO also allows you to compile, link and generate either ELF or COFF 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. binaries. With gcc, unlike the SCO compiler, the default is ELF.
Specify -melf to gcc to produce elf binaries. -fpic will get the Specify -mcoff to gcc to produce elf binaries. -fpic will get the
assembler and linker to produce PIC code. assembler and linker to produce PIC code.
*/ */
/* Set up assembler flags for PIC and ELF compilations */ /* Set up assembler flags for PIC and ELF compilations */
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC \ #define ASM_SPEC \
"-b %{melf:elf}%{!melf:coff \ "-b %{!mcoff:elf}%{mcoff:coff \
%{static:%e-static only valid with -melf} \ %{static:%e-static not valid with -mcoff} \
%{shared:%e-shared only valid with -melf} \ %{shared:%e-shared not valid with -mcoff} \
%{symbolic:%e-symbolic only valid with -melf}} \ %{symbolic:%e-symbolic not valid with -mcoff}} \
%{Ym,*} %{Yd,*} %{Wa,*:%*} \ %{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. */ /* Use crt1.o as a startup file and crtn.o as a closing file. */
...@@ -790,13 +796,13 @@ dtors_section () \ ...@@ -790,13 +796,13 @@ dtors_section () \
%{!Xc:%{Xk:values-Xk.o%s} \ %{!Xc:%{Xk:values-Xk.o%s} \
%{!Xk:%{Xt:values-Xt.o%s} \ %{!Xk:%{Xt:values-Xt.o%s} \
%{!Xt:values-Xa.o%s}}}}}} \ %{!Xt:values-Xa.o%s}}}}}} \
%{!melf:crtbegin.o%s} \ %{mcoff:crtbeginS.o%s} \
%{melf:%{static:crtbegin.o%s}%{!static:crtbeginS.o%s}}" %{!mcoff:%{!static:crtbegin.o%s}%{static:crtbeginS.o%s}}"
#undef ENDFILE_SPEC #undef ENDFILE_SPEC
#define ENDFILE_SPEC \ #define ENDFILE_SPEC \
"%{melf:%{!static:crtendS.o%s}%{static:crtend.o%s}} \ "%{!mcoff:%{!static:crtend.o%s}%{static:crtendS.o%s}} \
%{!melf:crtend.o%s} \ %{mcoff:crtendS.o%s} \
%{pg:gcrtn.o%s}%{!pg:crtn.o%s}" %{pg:gcrtn.o%s}%{!pg:crtn.o%s}"
#undef CPP_PREDEFINES #undef CPP_PREDEFINES
...@@ -807,8 +813,8 @@ dtors_section () \ ...@@ -807,8 +813,8 @@ dtors_section () \
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \ #define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] \
%{fpic:%{!melf:%e-fpic is only valid with -melf}} \ %{fpic:%{mcoff:%e-fpic is not valid with -mcoff}} \
%{fPIC:%{!melf:%e-fPIC is only valid with -melf}} \ %{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 \ -D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX \
%{!Xods30:-D_STRICT_NAMES} \ %{!Xods30:-D_STRICT_NAMES} \
%{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \ %{!ansi:%{!posix:%{!Xods30:-D_SCO_XPG_VERS=4}}} \
...@@ -828,9 +834,9 @@ dtors_section () \ ...@@ -828,9 +834,9 @@ dtors_section () \
-DM_WORDSWAP}}}} \ -DM_WORDSWAP}}}} \
%{scointl:-DM_INTERNAT -D_M_INTERNAT} \ %{scointl:-DM_INTERNAT -D_M_INTERNAT} \
%{traditional:-D_KR -D_SVID -D_NO_PROTOTYPE} \ %{traditional:-D_KR -D_SVID -D_NO_PROTOTYPE} \
%{melf:-D_SCO_ELF} \ %{!mcoff:-D_SCO_ELF} \
%{!melf:-D_M_COFF -D_SCO_COFF} \ %{mcoff:-D_M_COFF -D_SCO_COFF} \
%{melf:%{fpic:-D__PIC__ -D__pic__} \ %{!mcoff:%{fpic:-D__PIC__ -D__pic__} \
%{fPIC:%{!fpic:-D__PIC__ -D__pic__}}} \ %{fPIC:%{!fpic:-D__PIC__ -D__pic__}}} \
%{Xa:-D_SCO_C_DIALECT=1} \ %{Xa:-D_SCO_C_DIALECT=1} \
%{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \ %{!Xa:%{Xc:-D_SCO_C_DIALECT=3} \
...@@ -841,19 +847,19 @@ dtors_section () \ ...@@ -841,19 +847,19 @@ dtors_section () \
#undef LINK_SPEC #undef LINK_SPEC
#define LINK_SPEC \ #define LINK_SPEC \
"-b %{melf:elf}%{!melf:coff \ "-b %{!mcoff:elf}%{mcoff:coff \
%{static:%e-static only valid with -melf} \ %{static:%e-static not valid with -mcoff} \
%{shared:%e-shared only valid with -melf} \ %{shared:%e-shared not valid with -mcoff} \
%{symbolic:%e-symbolic only valid with -melf} \ %{symbolic:%e-symbolic not valid with -mcoff} \
%{fpic:%e-fpic only valid with -melf} \ %{fpic:%e-fpic not valid with -mcoff} \
%{fPIC:%e-fPIC only valid with -melf}} \ %{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}}}}},%{melf:ELF}%{!melf:COFF} \ -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,*} \ %{Wl,*%*} %{YP,*} %{YL,*} %{YU,*} \
%{!YP,*:%{p:-YP,/usr/ccs/libp:/lib/libp:/usr/lib/libp:/usr/ccs/lib:/lib:/usr/lib} \ %{!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}} \ %{!p:-YP,/usr/ccs/lib:/lib:/usr/lib}} \
%{h*} %{static:-dn -Bstatic} %{shared:-G -dy %{!z*:-z text}} \ %{h*} %{static:-dn -Bstatic} %{shared:-G -dy %{!z*:-z text}} \
%{symbolic:-Bsymbolic -G -dy %{!z*:-z text}} %{z*} %{R*} %{Y*} \ %{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" /* The SCO COFF linker gets confused on the difference between "-ofoo"
and "-o foo". So we just always force a single space. */ and "-o foo". So we just always force a single space. */
...@@ -867,15 +873,14 @@ dtors_section () \ ...@@ -867,15 +873,14 @@ dtors_section () \
#define LIB_SPEC \ #define LIB_SPEC \
"%{!shared:%{!symbolic:-lcrypt -lgen -lc}}" "%{!shared:%{!symbolic:-lcrypt -lgen -lc}}"
#undef LIBGCC_SPEC #define MASK_COFF 010000000000 /* Mask for elf generation */
#define LIBGCC_SPEC \ #define TARGET_COFF (target_flags & MASK_COFF)
"%{!melf:-lgcc}%{melf:%{!shared:%{!symbolic:-lgcc-elf}}}" #define TARGET_ELF (!(target_flags & MASK_COFF))
#define MASK_ELF 010000000000 /* Mask for elf generation */
#define TARGET_ELF (target_flags & MASK_ELF)
#undef SUBTARGET_SWITCHES #undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES { "elf", MASK_ELF }, #define SUBTARGET_SWITCHES \
{ "coff", MASK_COFF }, \
{ "elf", -MASK_COFF },
#define NO_DOLLAR_IN_LABEL #define NO_DOLLAR_IN_LABEL
......
# The pushl in CTOR initialization interferes with frame pointer elimination. # The pushl in CTOR initialization interferes with frame pointer elimination.
CRTSTUFF_T_CFLAGS =-fno-omit-frame-pointer CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer
CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -melf -fPIC CRTSTUFF_T_CFLAGS_S = -mcoff -fno-omit-frame-pointer
# #
# Becuase we can be compiling for either elf or coff, we need to create # I am still a little unsure of the multilib architecture. The following
# special versions of libgcc.a. It IS possible for this not to be done # 4 lines are based on advice from meissner@cygnus.com.
# 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.
# #
# NOTE: This is duplicated directly from Makefile.in. If you change it MULTILIB_OPTIONS = mcoff/fPIC
# there, be sure to change things here! MULTILIB_DIRNAMES = coff pic
# MULTILIB_EXCEPTIONS = *mcoff*/*fPIC*
EXTRA_PARTS = libgcc-elf.a crtbegin.o crtend.o crtbeginS.o crtendS.o MULTILIB_MATCHES = fPIC=fpic
TAROUTOPTS = xpf MULTILIB_EXTRA_OPTS =
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
LIBGCC=stmp-multilib
INSTALL_LIBGCC=install-multilib
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment