1 # The pushl in CTOR initialization interferes with frame pointer elimination.
2 CRTSTUFF_T_CFLAGS =-fno-omit-frame-pointer
3 CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -melf -fPIC
6 # Becuase we can be compiling for either elf or coff, we need to create
7 # special versions of libgcc.a. It IS possible for this not to be done
8 # and let the SCO linker transform the coff objects (which are created
9 # by default) into elf objects. However, this is inefficient. So,
10 # we create a libgcc-elf.a, which is used in the specs in sco5.h.
11 # These are the rules for doing that.
13 # NOTE: This is duplicated directly from Makefile.in. If you change it
14 # there, be sure to change things here!
16 EXTRA_PARTS = libgcc-elf.a crtbegin.o crtend.o crtbeginS.o crtendS.o
19 libgcc1-elf.a: stamp-crtS stamp-crt libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
20 -rm -f tmplibgcc1-elf.a
21 for name in $(LIB1FUNCS); \
24 rm -f $${name}$(objext); \
25 $(OLDCC) -DIN_LIBGCC1 -dy $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
26 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
27 mv libgcc1$(objext) $${name}$(objext); \
28 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1-elf.a $${name}$(objext); \
29 rm -f $${name}$(objext); \
31 for file in .. $(LIB1FUNCS_EXTRA); \
33 if [ x$${file} != x.. ]; then \
34 name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
36 if [ $${name}.asm = $${file} ]; then \
37 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
39 $(OLDCC) -DIN_LIBGCC1 -dy $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
40 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
41 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1-elf.a $${name}$(objext); \
42 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
43 rm -f $${name}.s $${name}$(objext); \
47 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc1-elf.a; else true; fi
48 mv tmplibgcc1-elf.a libgcc1-elf.a
50 libgcc2-elf.a: stamp-crtS stamp-crt libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
51 machmode.h longlong.h gbl-ctors.h config.status
52 -rm -f tmplibgcc2-elf.a
53 for name in $(LIB2FUNCS); \
56 $(GCC_FOR_TARGET) -melf $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
57 $(srcdir)/libgcc2.c -o $${name}$(objext); \
58 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
59 $(AR) $(AR_FLAGS) tmplibgcc2-elf.a $${name}$(objext); \
60 rm -f $${name}$(objext); \
62 for file in .. $(LIB2FUNCS_EXTRA); \
64 if [ x$${file} != x.. ]; then \
65 name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
66 oname=` echo $${name} | sed -e 's,.*/,,'`; \
68 if [ $${name}.asm = $${file} ]; then \
69 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
71 $(GCC_FOR_TARGET) -melf $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
72 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
73 $(AR) $(AR_FLAGS) tmplibgcc2-elf.a $${oname}$(objext); \
74 rm -f $${name}.s $${oname}$(objext); \
78 mv tmplibgcc2-elf.a libgcc2-elf.a
80 # Combine the various libraries into a single library, libgcc.a.
81 libgcc-elf.a: libgcc1-elf.a libgcc2-elf.a
82 -rm -rf tmplibgcc-elf.a libgcc-elf.a tmpcopy
84 -(cd tmpcopy; $(AR) x ../libgcc1-elf.a)
85 -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
86 -(cd tmpcopy; $(AR) x ../libgcc2-elf.a)
87 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc-elf.a *$(objext))
89 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc-elf.a; else true; fi
90 mv tmplibgcc-elf.a libgcc-elf.a