Skip to content

Commit

Permalink
v: builder: Suppress the use of '-Wl,-export-dynamic' for 'bare' builds
Browse files Browse the repository at this point in the history
Needed to prevent bare-metal development on macOS.
  • Loading branch information
raw-bin committed Oct 3, 2024
1 parent c1037ed commit 3055d7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vlib/v/builder/cc.v
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
}
if ccoptions.debug_mode && current_os != 'windows' && v.pref.build_mode != .build_module {
if ccoptions.cc != .tcc && current_os == 'macos' {
ccoptions.linker_flags << '-Wl,-export_dynamic' // clang for mac needs export_dynamic instead of -rdynamic
if !v.pref.is_bare {
ccoptions.linker_flags << '-Wl,-export_dynamic' // clang for mac needs export_dynamic instead of -rdynamic
}
} else {
if !v.pref.is_bare {
ccoptions.linker_flags << '-rdynamic' // needed for nicer symbolic backtraces
Expand Down

0 comments on commit 3055d7b

Please sign in to comment.