Open Quuxplusone opened 10 years ago
Attached e.cpp
(70 bytes, text/plain): testcase source code
Will you please linker output here as well?
Yes. Let's create a trivial DLL :
#include <stdexcept>
int ddd() { throw std::exception(); return 0; }
compiled with:
gcc -shared d.cpp -o d.dll -lstdc++
e_gcc.o can link against it OK:
gcc e_gcc.o -o e_gcc.exe -lstdc++ d.dll
without error, but linking the clang-compiled object against it:
gcc e_clang.o -o e_clang.exe -lstdc++ d.dll
produces error of multiple definition of the typename exception.
d000001.o:(.idata$5+0x0): multiple definition of `_imp___ZTISt9exception'
c:/mingw-builds/i686-4.8.2-release-win32-dwarf-rt_v3-
rev2/mingw32/bin/../lib/gcc/i686-w64-
mingw32/4.8.2/libstdc++.dll.a(d003499.o):(.idata$5+0x0): first defined here
d000001.o:(.idata$6+0x0): multiple definition of `_nm___ZTISt9exception'
c:/mingw-builds/i686-4.8.2-release-win32-dwarf-rt_v3-
rev2/mingw32/bin/../lib/gcc/i686-w64-
mingw32/4.8.2/libstdc++.dll.a(d003499.o):(.idata$6+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
I will attach the DLL source and updated compile script.
Oh, linking with the additional DLL works for both gcc and clang.
Oh, linking without the additional DLL works for both gcc and clang.
Attached c1.bat
(522 bytes, application/octet-stream): batch file to compile
Attached d.cpp
(69 bytes, text/plain): Trivial DLL source
Attached c2.bat
(721 bytes, application/octet-stream): Updated batch file to compile and link against a trivial DLL
Attached c.sh
(277 bytes, application/octet-stream): shell script to run example
still fails as of mingw 5.4 and clang r305089
c1.bat
(522 bytes, application/octet-stream)e.cpp
(70 bytes, text/plain)c2.bat
(721 bytes, application/octet-stream)d.cpp
(69 bytes, text/plain)c.sh
(277 bytes, application/octet-stream)