atollk / copper

Port of Golang channels to C++
MIT License
175 stars 8 forks source link

Mingw builds fail #4

Open atollk opened 3 years ago

atollk commented 3 years ago

When building copper_tests in CI with Mingw64, the linking fails for both GCC and Clang but with different errors and only when building in Debug mode.

see e.g. https://github.com/atollk/copper/actions/runs/794387279

Clang:

[100%] Linking CXX executable copper_tests
D:/a/_temp/msys/msys64/mingw64/bin/ld: DWARF error: could not find variable specification at offset 141e
D:/a/_temp/msys/msys64/mingw64/bin/ld: DWARF error: could not find variable specification at offset 7ce5
D:/a/_temp/msys/msys64/mingw64/bin/ld: DWARF error: could not find variable specification at offset 7d2f
CMakeFiles/copper_tests.dir/tests/main.cpp.obj:main.cpp:(.debug_info+0x16): relocation truncated to fit: IMAGE_REL_AMD64_SECREL against `.debug_line'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

GCC:

[100%] Linking CXX executable copper_tests
D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/copper_tests.dir/tests/main.cpp.obj:main.cpp:(.text+0xa2e): undefined reference to `typeinfo for Catch::TestFailureException'
D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/copper_tests.dir/tests/main.cpp.obj: in function `Catch::handleExceptionMatchExpr(Catch::AssertionHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Catch::StringRef const&)':
D:/a/copper/copper/build/_deps/catch2-src/single_include/catch2/catch.hpp:8275: undefined reference to `Catch::Matchers::StdString::EqualsMatcher::~EqualsMatcher()'
D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/a/copper/copper/build/_deps/catch2-src/single_include/catch2/catch.hpp:8275: undefined reference to `Catch::Matchers::StdString::EqualsMatcher::~EqualsMatcher()'
D:/a/_temp/msys/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/copper_tests.dir/tests/main.cpp.obj: in function `Catch::handleExceptionMatchExpr(Catch::AssertionHandler&, Catch::Matchers::Impl::MatcherBase<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&, Catch::StringRef const&)':

...
atollk commented 3 years ago

Running the Mingw tests on a commit on which they passed three weeks ago now causes a segfault for unknown reasons:

Run ctest -C Release --output-on-failure --timeout 240
  ctest -C Release --output-on-failure --timeout 240
  shell: D:\a\_temp\msys\msys2.CMD {0}
  env:
    MSYSTEM: MINGW64
Test project /d/a/copper/copper/build
    Start 1: copper_tests
1/1 Test #1: copper_tests .....................***Exception: SegFault  0.04 sec
Errors while running CTest

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.05 sec

The following tests FAILED:
      1 - copper_tests (SEGFAULT)

Therefore, clang Mingw was disabled for the time being.