Open ivmai opened 2 years ago
Related issue: #229 Tip from there: -D GC_NOT_DLL is essential if compiling client C++ code and linking it static libs on Cygwin, otherwise clang produces warnings in gc_cpp.h.
make check CFLAGS_EXTRA="-D GC_NOT_DLL" Gives other error:
libtool: link: clang++ -fexceptions -Wall -Wextra -Wpedantic -Wno-long-long -g -O2 -D GC_NOT_DLL -o .libs/cpptest.exe tests/cpp.o ./.libs/libgccpp.dll.a /cygdrive/c/_/PersonalWS/git/bdwgc-m/.libs/libgc.dll.a -lsupc++ ./.libs/libgc.dll.a -L/usr/local/lib
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-cygwin/11/libstdc++.dll.a(d006580.o):(.text+0x0): multiple definition of `__cxa_throw'; /usr/lib/gcc/x86_64-pc-cygwin/11/libsupc++.a(eh_throw.o):/usr/src/debug/gcc-11.2.0-1/libstdc++-v3/libsupc++/eh_throw.cc:77: first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-cygwin/11/libstdc++.dll.a(d006561.o):(.text+0x0): multiple definition of `__cxa_begin_catch'; /usr/lib/gcc/x86_64-pc-cygwin/11/libsupc++.a(eh_catch.o):/usr/src/debug/gcc-11.2.0-1/libstdc++-v3/libsupc++/eh_catch.cc:41: first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-cygwin/11/libstdc++.dll.a(d006558.o):(.text+0x0): multiple definition of `__cxa_allocate_exception'; /usr/lib/gcc/x86_64-pc-cygwin/11/libsupc++.a(eh_alloc.o):/usr/src/debug/gcc-11.2.0-1/libstdc++-v3/libsupc++/eh_alloc.cc:280: first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-cygwin/11/libstdc++.dll.a(d005443.o):(.text+0x0): multiple definition of `std::terminate()'; /usr/lib/gcc/x86_64-pc-cygwin/11/libsupc++.a(eh_terminate.o):/usr/src/debug/gcc-11.2.0-1/libstdc++-v3/libsupc++/eh_terminate.cc:57: first defined here
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
Unclear who to fix it properly. The W/A could be just suppress the warning.
Source: master (2e1b8f205) Host: Cygwin (64-bit) Compiler: clang version 8.0.1 (tags/RELEASE_801/final) How to reproduce: Variant 1: clang++ -I include -c tests/cpp.cc Variant 2: CC=clang CXX=clang++ ./configure && make check Output:
Note: not observed with gcc.