Skip to content

Commit

Permalink
Strip debug information from the native executable unconditionally
Browse files Browse the repository at this point in the history
PR quarkusio#13963 mistakenly stopped stripping debug information from the native
executable when debug info generation is enabled resulting in both the
native executable and the corresponding `.debug` file containing the
debug information. Which also results in the native executable being
larger when `-Dquarkus.native.debug.enabled` is used:

```
$ du -hs quarkus-integration-test-main-999-SNAPSHOT-runner-nodebug
108M	quarkus-integration-test-main-999-SNAPSHOT-runner-nodebug

$ du -hs quarkus-integration-test-main-999-SNAPSHOT-runner-debug
182M	quarkus-integration-test-main-999-SNAPSHOT-runner-debug

$ du -hs quarkus-integration-test-main-999-SNAPSHOT-runner-debug.debug
75M	quarkus-integration-test-main-999-SNAPSHOT-runner-debug.debug
```

Inspecting `quarkus-integration-test-main-999-SNAPSHOT-runner-debug` and
`quarkus-integration-test-main-999-SNAPSHOT-runner-debug` with
`readelf --debug-dump=info` we observe that both files are containing
debug information while only the latter should contain them.

(cherry picked from commit f69d98d)
  • Loading branch information
zakkak authored and gsmet committed Jan 13, 2023
1 parent 21e50b2 commit 1c927ac
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ public Result build(List<String> args, String nativeImageName, String resultingE
if (objcopyExists) {
if (debugSymbolsEnabled) {
splitDebugSymbols(nativeImageName, resultingExecutableName);
} else {
// Strip debug symbols regardless, because the underlying JDK might contain them
objcopy("--strip-debug", resultingExecutableName);
}
// Strip debug symbols regardless, because the underlying JDK might contain them
objcopy("--strip-debug", resultingExecutableName);
} else if (SystemUtils.IS_OS_LINUX) {
log.warn(
"objcopy executable not found in PATH. Debug symbols will therefore not be separated from the executable.");
Expand Down

0 comments on commit 1c927ac

Please sign in to comment.