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