Skip to content

Commit

Permalink
fix nim-lang#12735 osx: dsymutil needs to be called for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 21, 2019
1 parent e1d79d4 commit ea6a2e3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,14 @@ proc execLinkCmd(conf: ConfigRef; linkCmd: string) =
execExternalProgram(conf, linkCmd,
if optListCmd in conf.globalOptions or conf.verbosity > 1: hintExecuting else: hintLinking)

proc maybeRunDsymutil(conf: ConfigRef; exe: AbsoluteFile) =
when not defined(osx): return
if optCDebug notin conf.globalOptions: return
# if needed, add an option to skip or override location
let cmd = "dsymutil " & $(exe).quoteShell
tryExceptOSErrorMessage(conf, "invocation of dsymutil failed."):
execExternalProgram(conf, cmd, hintExecuting)

proc execCmdsInParallel(conf: ConfigRef; cmds: seq[string]; prettyCb: proc (idx: int)) =
let runCb = proc (idx: int, p: Process) =
let exitCode = p.peekExitCode
Expand Down Expand Up @@ -979,6 +987,7 @@ proc callCCompiler*(conf: ConfigRef) =
linkViaResponseFile(conf, linkCmd)
else:
execLinkCmd(conf, linkCmd)
maybeRunDsymutil(conf, mainOutput)
else:
linkCmd = ""
if optGenScript in conf.globalOptions:
Expand Down

0 comments on commit ea6a2e3

Please sign in to comment.