Skip to content

Commit

Permalink
Strip debug symbols regardless quarkusio#9792
Browse files Browse the repository at this point in the history
  • Loading branch information
galderz committed Jun 18, 2020
1 parent e2ffd66 commit ca327b1
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,12 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa
Files.delete(generatedImage);
System.setProperty("native.image.path", finalPath.toAbsolutePath().toString());

if (nativeConfig.debug.enabled && objcopyExists(env)) {
splitDebugSymbols(finalPath);
if (objcopyExists(env)) {
if (nativeConfig.debug.enabled) {
splitDebugSymbols(finalPath);
}
// Strip debug symbols regardless, because the the underlying JDK might contain them
objcopy("--strip-debug", finalPath.toString());
}

return new NativeImageBuildItem(finalPath);
Expand Down Expand Up @@ -558,7 +562,6 @@ private boolean objcopyExists(Map<String, String> env) {
private void splitDebugSymbols(Path executable) {
Path symbols = Paths.get(String.format("%s.debug", executable.toString()));
objcopy("--only-keep-debug", executable.toString(), symbols.toString());
objcopy("--strip-debug", executable.toString());
objcopy(String.format("--add-gnu-debuglink=%s", symbols.toString()), executable.toString());
}

Expand Down

0 comments on commit ca327b1

Please sign in to comment.