From: Joe Seymour Date: Wed, 18 Jan 2017 03:56:10 +0000 (+0000) Subject: t-msp430 (LIB2ADD): Remove mpy.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4701fba31cd2c7d5d6cd0af9a971ef802afc89e3;p=gcc.git t-msp430 (LIB2ADD): Remove mpy.c libgcc/ * config/msp430/t-msp430 (LIB2ADD): Remove mpy.c (mpy.o): New rule. (libmul_none.a): Add mpy.o gcc/testsuite/ * gcc.target/msp430/mul_f5_muldef.c: New test. From-SVN: r244564 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0628f49ff02..738afb621b2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-01-17 Joe Seymour + + * gcc.target/msp430/mul_f5_muldef.c: New test. + 2017-01-17 Michael Meissner PR target/79004 diff --git a/gcc/testsuite/gcc.target/msp430/mul_f5_muldef.c b/gcc/testsuite/gcc.target/msp430/mul_f5_muldef.c new file mode 100644 index 00000000000..da1b1bb983c --- /dev/null +++ b/gcc/testsuite/gcc.target/msp430/mul_f5_muldef.c @@ -0,0 +1,15 @@ +/* { dg-do link } */ +/* { dg-options "-mhwmult=f5series" } */ + +/* This program used to result in a multiple definition error: + +libmul_f5.a(lib2hw_mul_f5.o): In function `__mulhi2_f5': +(.text.__mulhi2_f5+0x0): multiple definition of `__mspabi_mpyi' +libgcc.a(mpy.o):mpy.c:(.text.__mulhi3+0x0): first defined here */ + +#include + +int main (void) +{ + printf ("%d", 430); +} diff --git a/libgcc/config/msp430/t-msp430 b/libgcc/config/msp430/t-msp430 index 107eb3ded6c..668b9437dc2 100644 --- a/libgcc/config/msp430/t-msp430 +++ b/libgcc/config/msp430/t-msp430 @@ -30,7 +30,6 @@ LIB2ADD = \ $(srcdir)/config/msp430/lib2mul.c \ $(srcdir)/config/msp430/lib2shift.c \ $(srcdir)/config/msp430/epilogue.S \ - $(srcdir)/config/msp430/mpy.c \ $(srcdir)/config/msp430/slli.S \ $(srcdir)/config/msp430/srai.S \ $(srcdir)/config/msp430/srli.S \ @@ -43,6 +42,9 @@ LIB2ADD = \ HOST_LIBGCC2_CFLAGS += -Os -ffunction-sections -fdata-sections -mhwmult=none +mpy.o: $(srcdir)/config/msp430/mpy.c + $(gcc_compile) $< -c + lib2_mul_none.o: $(srcdir)/config/msp430/lib2mul.c $(gcc_compile) $< -c -DMUL_NONE @@ -58,7 +60,7 @@ lib2hw_mul_32.o: $(srcdir)/config/msp430/lib2hw_mul.S lib2hw_mul_f5.o: $(srcdir)/config/msp430/lib2hw_mul.S $(gcc_compile) $< -c -DMUL_F5 -libmul_none.a: lib2_mul_none.o +libmul_none.a: lib2_mul_none.o mpy.o $(AR_CREATE_FOR_TARGET) $@ $(filter %.o,$^) libmul_16.a: lib2hw_mul_16.o lib2_mul_16bit.o