diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index 088019da2e..093e9f691f 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -319,7 +319,10 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) { if ccoptions.cc != .tcc && current_os == 'macos' { ccoptions.linker_flags << '-Wl,-export_dynamic' // clang for mac needs export_dynamic instead of -rdynamic } else { - ccoptions.linker_flags << '-rdynamic' // needed for nicer symbolic backtraces + if v.pref.ccompiler != 'x86_64-w64-mingw32-gcc' { + // the mingw-w64-gcc cross compiler does not support -rdynamic, and windows/wine already does have nicer backtraces + ccoptions.linker_flags << '-rdynamic' // needed for nicer symbolic backtraces + } } } if v.pref.os == .freebsd {