diff --git a/tools/extract-debug-symbols.sh b/tools/extract-debug-symbols.sh index 0c14f0f4709..6a7466e9395 100755 --- a/tools/extract-debug-symbols.sh +++ b/tools/extract-debug-symbols.sh @@ -16,16 +16,23 @@ function extract_linux_or_android { for input in $@ ; do output="${input}${suffix}" + # The --preserver-dates flag for strip and objcopy only has whole + # second resolution, so copy the timestamps to a separate file instead + cp --attributes-only --preserve=timestamps "$input" "$input.timestamps" 2>&1 || true + # Extract a copy of the debugging information $OBJCOPY --only-keep-debug "$input" "$output" # Because we export symbols from the engine, only debug symbols # should be stripped. - $STRIP -x --preserve-dates --strip-debug "$input" + $STRIP -x --strip-debug "$input" # Add a hint for the debugger so it can find the debug info - $OBJCOPY --preserve-dates --remove-section=.gnu_debuglink "$input" - $OBJCOPY --preserve-dates --add-gnu-debuglink="$output" "$input" + $OBJCOPY --remove-section=.gnu_debuglink "$input" + $OBJCOPY --add-gnu-debuglink="$output" "$input" + + cp --attributes-only --preserve=timestamps "$input.timestamps" "$input" 2>&1 || true + rm "$input.timestamps" 2>&1 || true done }