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