# Don't let CTOR_LIST end up in sdata section.

CRTSTUFF_T_CFLAGS = -G 0 -fno-asynchronous-unwind-tables

# Assemble startup files.

$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm

$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm

# N32 uses TFmode for long double.

TPBIT = tp-bit.c

tp-bit.c: $(srcdir)/config/fp-bit.c
	echo '#ifdef __MIPSEL__' > tp-bit.c
	echo '# define FLOAT_BIT_ORDER_MISMATCH' >> tp-bit.c
	echo '#endif' >> tp-bit.c
	echo '#if __LDBL_MANT_DIG__ == 113' >> tp-bit.c
	echo '#define QUIET_NAN_NEGATED' >> tp-bit.c
	echo '# define TFLOAT' >> tp-bit.c
	cat $(srcdir)/config/fp-bit.c >> tp-bit.c
	echo '#endif' >> tp-bit.c

# We must build libgcc2.a with -G 0, in case the user wants to link
# without the $gp register.

TARGET_LIBGCC2_CFLAGS = -G 0
 
# Build both ABIs.

MULTILIB_OPTIONS = mabi=n32/mabi=eabi/mabi=64 march=octeon2
MULTILIB_DIRNAMES = n32 eabi n64 octeon2
MULTILIB_EXCEPTIONS = mabi=64/march=octeon2
EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o

LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
