From 5e3622402d37e3d0c14d67fcb2dacb8a7b4bce5f Mon Sep 17 00:00:00 2001 From: childerxxx Date: Sat, 10 Sep 2022 15:05:35 +0800 Subject: [PATCH] [tools/link-order] Sort objects so that compilation can be done in a fixed link order. --- tools/building.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/building.py b/tools/building.py index d9fecd1567..680c6a55ab 100644 --- a/tools/building.py +++ b/tools/building.py @@ -775,8 +775,16 @@ def DoBuilding(target, objects): objects.remove(obj) # re-add the source files to the objects + + objects_in_group = [] for group in Projects: - local_group(group, objects) + local_group(group, objects_in_group) + + # sort seperately, because the data type of + # the members of the two lists are different + objects_in_group = sorted(objects_in_group) + objects = sorted(objects) + objects.append(objects_in_group) program = Env.Program(target, objects)