t-ppccomm revision 132718
1# Common support for PowerPC ELF targets (both EABI and SVR4).
2
3LIB2FUNCS_EXTRA = tramp.S
4
5# This one can't end up in shared libgcc
6LIB2FUNCS_STATIC_EXTRA = eabi.S
7
8eabi.S: $(srcdir)/config/rs6000/eabi.asm
9	cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
10
11tramp.S: $(srcdir)/config/rs6000/tramp.asm
12	cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
13
14# Switch synonyms
15MULTILIB_MATCHES_ENDIAN	= mlittle=mlittle-endian mbig=mbig-endian
16MULTILIB_MATCHES_SYSV	= mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
17
18EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
19  crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
20  ecrti$(objext) ecrtn$(objext) \
21  ncrti$(objext) ncrtn$(objext) \
22  crtsavres$(objext)
23
24# We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
25# end labels to all of the special sections used when we link using gcc.
26
27# Assemble startup files.
28ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
29	cat $(srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
30
31ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
32	cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
33
34ncrti.S: $(srcdir)/config/rs6000/sol-ci.asm
35	cat $(srcdir)/config/rs6000/sol-ci.asm >ncrti.S
36
37ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
38	cat $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
39
40crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
41	cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
42
43# Build multiple copies of ?crt{i,n}.o, one for each target switch.
44$(T)ecrti$(objext): ecrti.S
45	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrti.S -o $(T)ecrti$(objext)
46
47$(T)ecrtn$(objext): ecrtn.S
48	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrtn.S -o $(T)ecrtn$(objext)
49
50$(T)ncrti$(objext): ncrti.S
51	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrti.S -o $(T)ncrti$(objext)
52
53$(T)ncrtn$(objext): ncrtn.S
54	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
55
56$(T)crtsavres$(objext): crtsavres.S
57	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavres.S -o $(T)crtsavres$(objext)
58
59# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
60CRTSTUFF_T_CFLAGS = -msdata=none
61# Make sure crt*.o are built with -fPIC even if configured with 
62# --enable-shared --disable-multilib
63CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none
64