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,9 +319,12 @@ 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 {
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 ccoptions.linker_flags << '-rdynamic' // needed for nicer symbolic backtraces
} }
} }
}
if v.pref.os == .freebsd { if v.pref.os == .freebsd {
// Needed for -usecache on FreeBSD 13, otherwise we get `ld: error: duplicate symbol: _const_math__bits__de_bruijn32` errors there // Needed for -usecache on FreeBSD 13, otherwise we get `ld: error: duplicate symbol: _const_math__bits__de_bruijn32` errors there
if ccoptions.cc != .tcc { if ccoptions.cc != .tcc {