On 02/17/2016 06:01 PM, Óscar Fuentes wrote:
Apparently you are wrapping the MinGW-64 toolset with your own
application. At this point I can't help you any further, except
suggesting to try the cross-compilation with a tool chain file that
points to the MinGW-w64 toolset. Here is a very old one of mine, which
was what I used when I wrote the LLVM/Clang CMake build system. Hope it
still works. You need to adjust paths and names to your install.
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
SET(MPATH /home/oscar/dev/other/mingw-cross-env-2.8/usr/i386-mingw32msvc)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER ${MPATH}/../bin/i386-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER ${MPATH}/../bin/i386-mingw32msvc-g++)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH ${MPATH})
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Hi Óscar,
It looks like it is something going wrong with my compiler. Thanks for
your help, though.
I googled around a little bit and found this bug:
https://llvm.org/bugs/show_bug.cgi?id=9744
The generated code is somewhat different, but the little test case fails
for me in exactly the same way:
[~] dev% cat test.cpp
#include <stdio.h>
#include <string>
using std::string;
int main()
{
string a(" test");
a = "a" + a;
printf("%s\n", a.c_str());
return 0;
}
[~] dev% ~/ellcc/bin/ecc++ -target x86_64-w64-mingw32 test.cpp
/home/rich/ellcc/bin/../libecc/mingw/x86_64-w64-mingw32/sys-root/mingw/lib/libstdc++.a(string-inst.o):
In function `std::basic_string<char, std::char_traits<char>,
std::allocator<char> > std::operator+<char, std::char_traits<char>,
std::allocator<char> >(char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
/builddir/build/BUILD/gcc-4.9.2/build_win64/x86_64-w64-mingw32/libstdc++-v3/include/bits/basic_string.tcc:692:
multiple definition of `std::basic_string<char, std::char_traits<char>,
std::allocator<char> > std::operator+<char, std::char_traits<char>,
std::allocator<char> >(char const*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)'
/tmp/test-1e978b.o:(.text[_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_]+0x0):
first defined here
clang-3.9: error: linker command failed with exit code 1 (use -v to see
invocation)
[~] dev%
-Rich
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public