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