builder: fix cross compiling from linux to windows, when passing -g/-cg

This commit is contained in:
Delyan Angelov 2024-11-13 11:59:04 +02:00
parent 4aa87796ed
commit 7c3c5891b0
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -319,7 +319,10 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
if ccoptions.cc != .tcc && current_os == 'macos' { if ccoptions.cc != .tcc && current_os == 'macos' {
ccoptions.linker_flags << '-Wl,-export_dynamic' // clang for mac needs export_dynamic instead of -rdynamic ccoptions.linker_flags << '-Wl,-export_dynamic' // clang for mac needs export_dynamic instead of -rdynamic
} else { } 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 { if v.pref.os == .freebsd {