From 3a1f5bc13a835243b2ea070b495a5f14c1b337b0 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 17 Mar 2020 12:19:37 +0100 Subject: [PATCH] tool/check_abi: prevent use of temporary files Issue #3696 --- tool/check_abi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tool/check_abi b/tool/check_abi index 49d259224..8b1453778 100755 --- a/tool/check_abi +++ b/tool/check_abi @@ -17,9 +17,16 @@ set env(LC_COLLATE) C set lib_path [lindex $argv 0] set abi_path [lindex $argv 1] -# obtain symbol information for the shared library via 'nm' -set lib_content [split [exec nm --format posix --dynamic $lib_path | sort] "\n"] -set abi_content [split [exec cat $abi_path] "\n"] +# +# Obtain symbol information for the shared library via 'nm' +# +# The redirection of stderr to /dev/null is solely needed to prevent tclsh from +# creating a temporary file at /tmp/tcl_XXXX and relying on POSIX's late unlink +# mechanism. The latter is not available when executing the tool chain on +# Genode. +# +set lib_content [split [exec nm --format posix --dynamic $lib_path 2> /dev/null | sort] "\n"] +set abi_content [split [exec cat $abi_path 2> /dev/null] "\n"] set abi_name [lindex [file split $abi_path] end] set num_errors 0