From cdd7fcd820a361a9ed3bc0a20417cd8fceea3a01 Mon Sep 17 00:00:00 2001 From: Stephen Tawn Date: Thu, 17 Sep 2015 13:36:33 +0100 Subject: [PATCH 1/6] Remove unnecessary `mkdir` in `build-extensions.sh` This was unnecessary as `build_widget` will make the directory if needed. Moreover, the `-s` option for `basename` isn't available on Debian Wheezy. --- util/build-extensions.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/build-extensions.sh b/util/build-extensions.sh index 583d33abd54..55c072b40fb 100755 --- a/util/build-extensions.sh +++ b/util/build-extensions.sh @@ -44,9 +44,5 @@ build_order=$(${lc_compile} --modulepath ${module_dir} --deps changed-order -- $ # Loop over the extensions that need to be (re-)built for ext in ${build_order} ; do - # Create the output directory - mkdir -p "${destination_dir}"/com.livecode.extensions.livecode.$(basename -s .lcb "${ext}") - - # Build this extension build_widget $(dirname "${ext}") "${destination_dir}" "${module_dir}" "${lc_compile}" done From d4b9d72bdaf70d3e36de5b72f4134b6c2f97018d Mon Sep 17 00:00:00 2001 From: Stephen Tawn Date: Thu, 23 Jul 2015 14:29:03 +0100 Subject: [PATCH 2/6] Precisely preserve the timestamps when stripping debugging symbols The `--preserve-dates` flag for `strip` and `objcopy` only has whole second resolution. This meant that the modification time was being truncated to an integer number of seconds. Consequently, when stripping a file, some of the dependencies of that file would appear to be newer, and hence the file would be unnecessarily remade during a second call to make. Simple soultion: copy the timestamps to a separate file before we strip and copy them back after. --- tools/extract-debug-symbols.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/extract-debug-symbols.sh b/tools/extract-debug-symbols.sh index 92507e7b62c..5926b47ace9 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" + # 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" + rm "$input.attributes" done } From d7ccc5711ac27a2e2815725f2e6ac27fddd6f75a Mon Sep 17 00:00:00 2001 From: Stephen Tawn Date: Mon, 27 Jul 2015 13:54:19 +0100 Subject: [PATCH 3/6] Remove the correct file in tools/extract-debug-symbols.sh --- tools/extract-debug-symbols.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/extract-debug-symbols.sh b/tools/extract-debug-symbols.sh index 5926b47ace9..d40e78868b3 100755 --- a/tools/extract-debug-symbols.sh +++ b/tools/extract-debug-symbols.sh @@ -32,7 +32,7 @@ for input in $@ ; do $OBJCOPY --add-gnu-debuglink="$output" "$input" cp --attributes-only --preserve=timestamps "$input.timestamps" "$input" - rm "$input.attributes" + rm "$input.timestamps" done } From 22c1cceb438aa59be1ba2615b55be4bb8c44296c Mon Sep 17 00:00:00 2001 From: Stephen Tawn Date: Fri, 31 Jul 2015 10:50:09 +0100 Subject: [PATCH 4/6] Ignore failure to copy attributes in extract-debug-symbols.sh The 32-bit linux build is built on Debian Squeeze which only has coreutils 8.5. Version >= 8.6 is required for the `--attributes-only` option on `cp`, so ignore failure of these commands. --- tools/extract-debug-symbols.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/extract-debug-symbols.sh b/tools/extract-debug-symbols.sh index d40e78868b3..de27f9218b9 100755 --- a/tools/extract-debug-symbols.sh +++ b/tools/extract-debug-symbols.sh @@ -18,7 +18,7 @@ for input in $@ ; do # 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" + cp --attributes-only --preserve=timestamps "$input" "$input.timestamps" 2>&1 || true # Extract a copy of the debugging information $OBJCOPY --only-keep-debug "$input" "$output" @@ -31,8 +31,8 @@ for input in $@ ; do $OBJCOPY --remove-section=.gnu_debuglink "$input" $OBJCOPY --add-gnu-debuglink="$output" "$input" - cp --attributes-only --preserve=timestamps "$input.timestamps" "$input" - rm "$input.timestamps" + cp --attributes-only --preserve=timestamps "$input.timestamps" "$input" 2>&1 || true + rm "$input.timestamps" 2>&1 || true done } From 25cdcfa25a7a73d75e61103f1a4a4cc4c82ac57b Mon Sep 17 00:00:00 2001 From: Stephen Tawn Date: Thu, 17 Sep 2015 15:00:49 +0100 Subject: [PATCH 5/6] Use `touch` to copy the modification time instead of `cp` On Debian Wheezy the `cp` command was deleting the contents of the destination, so switch to using `touch` with a reference file. --- tools/extract-debug-symbols.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/extract-debug-symbols.sh b/tools/extract-debug-symbols.sh index de27f9218b9..29b62b1b6a6 100755 --- a/tools/extract-debug-symbols.sh +++ b/tools/extract-debug-symbols.sh @@ -13,12 +13,14 @@ STRIP="${STRIP:-strip}" function extract_linux_or_android { -for input in $@ ; do - output="${input}${suffix}" +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 + # The --preserve-dates flag for strip and objcopy only has + # whole second resolution, so move to a new file and copy to + # preserve the timestamps + mv "$input" "$input.timestamps" + cp "$input.timestamps" "$input" # Extract a copy of the debugging information $OBJCOPY --only-keep-debug "$input" "$output" @@ -31,15 +33,16 @@ for input in $@ ; do $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 + # Restore the original modification time + touch -m -r "$input.timestamps" "$input" + rm "$input.timestamps" 2>&1 done } function extract_emscripten { -for input in $@ ; do +for input in "$@" ; do touch "${input}${suffix}" done @@ -47,7 +50,7 @@ done function extract_mac_or_ios { -for input in $@ ; do +for input in "$@" ; do output="${input}${suffix}" # If this is an app bundle, find the executable name From e419ee1c498a65434945935322941480f2fc1ea7 Mon Sep 17 00:00:00 2001 From: Stephen Tawn Date: Wed, 30 Sep 2015 09:53:05 +0100 Subject: [PATCH 6/6] Use `touch` to copy the timestamps --- tools/extract-debug-symbols.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/extract-debug-symbols.sh b/tools/extract-debug-symbols.sh index 29b62b1b6a6..f4bf1febe90 100755 --- a/tools/extract-debug-symbols.sh +++ b/tools/extract-debug-symbols.sh @@ -16,11 +16,10 @@ function extract_linux_or_android { for input in "$@" ; do output="${input}${suffix}" - # The --preserve-dates flag for strip and objcopy only has - # whole second resolution, so move to a new file and copy to - # preserve the timestamps - mv "$input" "$input.timestamps" - cp "$input.timestamps" "$input" + # The --preserve-dates flag for strip and objcopy only has whole + # second resolution, so save the timestamps in a separate file + # instead. + touch -m -r "$input" "$input.timestamps" # Extract a copy of the debugging information $OBJCOPY --only-keep-debug "$input" "$output"