Discussion:
[OpenRISC] Multiple definition error while building TestFloat with newlib toolchain
BAndViG
2014-08-09 20:48:58 UTC
Permalink
Hello all.
Now days I'm working on port of FPU functionality to mor1kx cappuccino
pipeline. So I decided to use TestFloat tool from ORPSoC v2 pack ported to
actual newlib-based tool chain. The result of the port is attached. It is
enough to unpack it, go to folder testfloat_newlib and try to execute:
make V=1 testfloat.bin
Unfortunately, the link process fails with the messages:

or1k-elf-gcc
test_float_fail.c -save-temps -O2 -mhard-mul -mhard-div -mboard=atlys
test_float_fail.c random.c writeHex.c softfloat.c testCases.c testLoops.c
systmodes.c systflags.c systfloat.S testFunction.c testfloat.c -o
testfloat.elf
test_float_fail.o: In function `test_float_fail':
test_float_fail.c:(.text+0x0): multiple definition of `test_float_fail'
test_float_fail.o:test_float_fail.c:(.text+0x0): first defined here
test_float_fail.o:(.data+0x0): multiple definition of `fail_program_name'
test_float_fail.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:57: recipe for target 'testfloat.elf' failed
make: *** [testfloat.elf] Error 1

As I'm not very familiar with such kind errors, could anybody help me?

WBR
Andrey
Peter Gavin
2014-08-09 21:35:27 UTC
Permalink
You have test_float_fail.c in your command line in two places. It's
compiling and linking that file twice, resulting in the duplicate
definition.

-Pete
Post by BAndViG
Hello all.
Now days I'm working on port of FPU functionality to mor1kx cappuccino
pipeline. So I decided to use TestFloat tool from ORPSoC v2 pack ported to
actual newlib-based tool chain. The result of the port is attached. It is
make V=1 testfloat.bin
or1k-elf-gcc test_float_fail.c -save-temps -O2 -mhard-mul -mhard-div
-mboard=atlys test_float_fail.c random.c writeHex.c softfloat.c testCases.c
testLoops.c systmodes.c systflags.c systfloat.S testFunction.c testfloat.c
-o testfloat.elf
test_float_fail.c:(.text+0x0): multiple definition of `test_float_fail'
test_float_fail.o:test_float_fail.c:(.text+0x0): first defined here
test_float_fail.o:(.data+0x0): multiple definition of `fail_program_name'
test_float_fail.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:57: recipe for target 'testfloat.elf' failed
make: *** [testfloat.elf] Error 1
As I'm not very familiar with such kind errors, could anybody help me?
WBR
Andrey
_______________________________________________
OpenRISC mailing list
http://lists.openrisc.net/listinfo/openrisc
BAndViG
2014-08-10 08:00:55 UTC
Permalink
It’s really stupid bug . I just wasn’t attentively enough to find it by myself. Thanks, Peter.


From: Peter Gavin
Sent: Sunday, August 10, 2014 1:35 AM
To: BAndViG
Cc: ***@lists.openrisc.net
Subject: Re: [OpenRISC] Multiple definition error while building TestFloat with newlib toolchain

You have test_float_fail.c in your command line in two places. It's compiling and linking that file twice, resulting in the duplicate definition.

-Pete



On Sat, Aug 9, 2014 at 4:48 PM, BAndViG <***@mail.ru> wrote:

Hello all.
Now days I'm working on port of FPU functionality to mor1kx cappuccino pipeline. So I decided to use TestFloat tool from ORPSoC v2 pack ported to actual newlib-based tool chain. The result of the port is attached. It is enough to unpack it, go to folder testfloat_newlib and try to execute:
make V=1 testfloat.bin
Unfortunately, the link process fails with the messages:

or1k-elf-gcc test_float_fail.c -save-temps -O2 -mhard-mul -mhard-div -mboard=atlys test_float_fail.c random.c writeHex.c softfloat.c testCases.c testLoops.c systmodes.c systflags.c systfloat.S testFunction.c testfloat.c -o testfloat.elf
test_float_fail.o: In function `test_float_fail':
test_float_fail.c:(.text+0x0): multiple definition of `test_float_fail'
test_float_fail.o:test_float_fail.c:(.text+0x0): first defined here
test_float_fail.o:(.data+0x0): multiple definition of `fail_program_name'
test_float_fail.o:(.data+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:57: recipe for target 'testfloat.elf' failed
make: *** [testfloat.elf] Error 1

As I'm not very familiar with such kind errors, could anybody help me?

WBR
Andrey
_______________________________________________
OpenRISC mailing list
***@lists.openrisc.net
http://lists.openrisc.net/listinfo/openrisc

Loading...