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