sammielove45 / propgcc

Automatically exported from code.google.com/p/propgcc
1 stars 1 forks source link

Duplicate symbol, undefined reference in library #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Enter the following "standard" C++ program:

#include <iostream>

int main()
{
    std::cout << "Hello World\n";
}

2. Compile with the following commands:

propeller-elf-g++ -g -Os -mfcache -save-temps -mxmmc -fno-exceptions -fno-rtti 
-o main.o -c main.cpp
propeller-elf-g++ -Xlinker -Map=main.rawmap -mxmmc -o main.elf main.o

What is the expected output? What do you see instead?

Expected: No Error
Instead Received:

c:/users/ted/documents/propgcc/propgcc-0.2.2/bin/../lib/gcc/propeller-elf/4.6.1/
../../../../propeller-elf/lib/xmmc\libc.a(rdwr.o): In function `_write':
(.text+0x98): multiple definition of `_write'
c:/users/ted/documents/propgcc/propgcc-0.2.2/bin/../lib/gcc/propeller-elf/4.6.1/
../../../../propeller-elf/lib/xmmc\libc.a(write.o):(.text+0x0): first defined 
here
c:/users/ted/documents/propgcc/propgcc-0.2.2/bin/../lib/gcc/propeller-elf/4.6.1/
../../../../propeller-elf/lib/xmmc\libstdc++.a(basic_file.o): In function 
`.LVL35':
c:\src\build\gcc\propeller-elf\xmmc\libstdc++-v3\src/basic_file.cc:228: 
undefined reference to `_fdopen'

What version of the product are you using? On what operating system?

propgcc-0.2.2 and propgcc-0.2.3 (Windows)

Please provide any additional information below.

The first error is caused by duplicate "write()" definitions in 
lib/stdio/write.c and lib/misc/rdwr.c.  This could easily cause problems in 
other programs (i.e. "saner" programs that don't use C++ <iostream>).

The second error is caused by "fdopen()" being used by 
gcc/libstdc++-v3/config/io/basic_file_stdio.cc (I think that's the right file) 
and not being present in libc.a.  This error is probably limited to programs 
that try to use C++ <iostream> (which is not necessarily wise on the Propeller).

Original issue reported on code.google.com by tjstefan...@charter.net on 9 Feb 2012 at 7:24

GoogleCodeExporter commented 9 years ago
Thanks Ted -- the stdio/write.c is an older one, I think, and should have been 
replaced by misc/rdwr.c. I'll update it.

Original comment by ersm...@hfx.eastlink.ca on 11 Feb 2012 at 5:12