Skip to content

Commit c042606

Browse files
Merge pull request livecode#2642 from livecodestephen/build-timestamps
Precisely preserve the timestamps when stripping debugging symbols
2 parents 21170c7 + b7180c7 commit c042606

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tools/extract-debug-symbols.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,23 @@ function extract_linux_or_android {
1616
for input in $@ ; do
1717
output="${input}${suffix}"
1818

19+
# The --preserver-dates flag for strip and objcopy only has whole
20+
# second resolution, so copy the timestamps to a separate file instead
21+
cp --attributes-only --preserve=timestamps "$input" "$input.timestamps" 2>&1 || true
22+
1923
# Extract a copy of the debugging information
2024
$OBJCOPY --only-keep-debug "$input" "$output"
2125

2226
# Because we export symbols from the engine, only debug symbols
2327
# should be stripped.
24-
$STRIP -x --preserve-dates --strip-debug "$input"
28+
$STRIP -x --strip-debug "$input"
2529

2630
# Add a hint for the debugger so it can find the debug info
27-
$OBJCOPY --preserve-dates --remove-section=.gnu_debuglink "$input"
28-
$OBJCOPY --preserve-dates --add-gnu-debuglink="$output" "$input"
31+
$OBJCOPY --remove-section=.gnu_debuglink "$input"
32+
$OBJCOPY --add-gnu-debuglink="$output" "$input"
33+
34+
cp --attributes-only --preserve=timestamps "$input.timestamps" "$input" 2>&1 || true
35+
rm "$input.timestamps" 2>&1 || true
2936
done
3037

3138
}

0 commit comments

Comments
 (0)