Skip to content

Commit

Permalink
[GR-41537] Workaround for dsymutil bug on Darwin
Browse files Browse the repository at this point in the history
PullRequest: graal/12850
  • Loading branch information
lewurm committed Oct 4, 2022
2 parents c2af78b + 6ddd2e6 commit 0e6baa5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,15 @@ protected List<String> getArgs() {
return sulongArgs;
}

protected void getCompilerArgs(List<String> sulongArgs) {
protected void getDebugCompilerArgs(List<String> sulongArgs) {
// use -gdwarf-5 instead of -g to enable source file checksums
sulongArgs.addAll(Arrays.asList("-flto=full", "-gdwarf-5", "-O1"));
sulongArgs.add("-gdwarf-5");
}

protected void getCompilerArgs(List<String> sulongArgs) {
sulongArgs.addAll(Arrays.asList("-flto=full", "-O1"));
sulongArgs.addAll(getVectorInstructionSetFlags());
getDebugCompilerArgs(sulongArgs);
}

private List<String> getVectorInstructionSetFlags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ public static void runClangCL(String[] args) {
new DarwinClangLike(args, ClangLikeBase.Tool.ClangCL, OS.getCurrent(), Arch.getCurrent(), NATIVE_PLATFORM).run();
}

@Override
protected void getDebugCompilerArgs(List<String> sulongArgs) {
// [GR-41537] Use -gdwarf-4 instead of -gdwarf-5, as the latter causes a problem in
// dsymutil:
// > https://github.com/llvm/llvm-project/commit/a17c90daf2e7c3b1817ec29ad6648ce89b927f9a
// This workaround can be removed when LLVM is upgraded to >= 15
sulongArgs.add("-gdwarf-4");
}

@Override
public void runDriver(List<String> sulongArgs, List<String> userArgs, boolean verb, boolean hlp, boolean earlyexit) {
DarwinLinker.runDriverWithSaveTemps(this, sulongArgs, userArgs, verb, hlp, earlyexit, "-Wl,", needLinkerFlags, outputFlagPos);
Expand Down

0 comments on commit 0e6baa5

Please sign in to comment.