]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
scripts/dso-ordering-test.py: Generate program run-time dependencies
authorFlorian Weimer <fweimer@redhat.com>
Tue, 6 Sep 2022 05:38:10 +0000 (07:38 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 6 Sep 2022 05:38:16 +0000 (07:38 +0200)
The main program needs to depend on all shared objects, even objects
that have link-time dependencies among shared objects.  Filtering
out shared objects that already have an link-time dependencies is not
necessary here; make will do this automatically.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
scripts/dso-ordering-test.py

index 2dd6bfda183257a8a4c7bad4862f6d3171c1eaca..b87cf2f80996de25ea4686704ec7b28cb5eaa8ba 100644 (file)
@@ -707,13 +707,12 @@ def process_testcase(t):
                 "\t$(compile.c) $(OUTPUT_OPTION)\n")
         makefile.write (rule)
 
-        not_depended_objs = find_objs_not_depended_on(test_descr)
-        if not_depended_objs:
-            depstr = ""
-            for dep in not_depended_objs:
-                depstr += (" $(objpfx)" + test_subdir + "/"
-                           + test_name + "-" + dep + ".so")
-            makefile.write("$(objpfx)%s.out:%s\n" % (base_test_name, depstr))
+        # Ensure that all shared objects are built before running the
+        # test, whether there link-time dependencies or not.
+        depobjs = ["$(objpfx){}/{}-{}.so".format(test_subdir, test_name, dep)
+                   for dep in test_descr.objs]
+        makefile.write("$(objpfx){}.out: {}\n".format(
+            base_test_name, " ".join(depobjs)))
 
         # Add main executable to test-srcs
         makefile.write("test-srcs += %s/%s\n" % (test_subdir, test_name))