6ca6e8
commit 183d99737298bb3200f0610fdcd1c7549c8ed560
6ca6e8
Author: Florian Weimer <fweimer@redhat.com>
6ca6e8
Date:   Tue Sep 6 07:38:10 2022 +0200
6ca6e8
6ca6e8
    scripts/dso-ordering-test.py: Generate program run-time dependencies
6ca6e8
    
6ca6e8
    The main program needs to depend on all shared objects, even objects
6ca6e8
    that have link-time dependencies among shared objects.  Filtering
6ca6e8
    out shared objects that already have an link-time dependencies is not
6ca6e8
    necessary here; make will do this automatically.
6ca6e8
    
6ca6e8
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
6ca6e8
6ca6e8
diff --git a/scripts/dso-ordering-test.py b/scripts/dso-ordering-test.py
6ca6e8
index bde0406be9da14fc..4ffcff6136145ef1 100644
6ca6e8
--- a/scripts/dso-ordering-test.py
6ca6e8
+++ b/scripts/dso-ordering-test.py
6ca6e8
@@ -707,13 +707,12 @@ def process_testcase(t):
6ca6e8
                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
6ca6e8
         makefile.write (rule)
6ca6e8
 
6ca6e8
-        not_depended_objs = find_objs_not_depended_on(test_descr)
6ca6e8
-        if not_depended_objs:
6ca6e8
-            depstr = ""
6ca6e8
-            for dep in not_depended_objs:
6ca6e8
-                depstr += (" $(objpfx)" + test_subdir + "/"
6ca6e8
-                           + test_name + "-" + dep + ".so")
6ca6e8
-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
6ca6e8
+        # Ensure that all shared objects are built before running the
6ca6e8
+        # test, whether there link-time dependencies or not.
6ca6e8
+        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
6ca6e8
+                   for dep in test_descr.objs]
6ca6e8
+        makefile.write("$(objpfx){}.out: {}\n".format(
6ca6e8
+            base_test_name, " ".join(depobjs)))
6ca6e8
 
6ca6e8
         # Add main executable to test-srcs
6ca6e8
         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))