[v2] elf: Properly remove the initial 'env' command

Message ID 20240209131754.2353321-1-hjl.tools@gmail.com
State Superseded
Headers
Series [v2] elf: Properly remove the initial 'env' command |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 fail Patch failed to apply

Commit Message

H.J. Lu Feb. 9, 2024, 1:17 p.m. UTC
  tst-rtld-list-diagnostics.py is called by

"$(test-wrapper-env) $(objpfx)$(rtld-installed-name) --list-diagnostics"

and $(test-wrapper-env) is set to "$(test-wrapper) env".  When there is
a test wrapper, it is incorrect to use:

    # Remove the initial 'env' command.
    parse_diagnostics(opts.command.split()[1:])

to remove 'env'.  Change tst-rtld-list-diagnostics.py to explicitly
remove 'env' instead.  This fixes [BZ #31357].
---
 elf/tst-rtld-list-diagnostics.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/elf/tst-rtld-list-diagnostics.py b/elf/tst-rtld-list-diagnostics.py
index 9e70e74bf8..c59b04d49a 100644
--- a/elf/tst-rtld-list-diagnostics.py
+++ b/elf/tst-rtld-list-diagnostics.py
@@ -294,7 +294,9 @@  def main(argv):
         check_consistency_with_manual(opts.manual)
 
     # Remove the initial 'env' command.
-    parse_diagnostics(opts.command.split()[1:])
+    options = opts.command.split()[:]
+    options.remove('env')
+    parse_diagnostics(options)
 
     if errors:
         sys.exit(1)