build: sort objects in link commands

Build logs are easier to compare if the commands don't change. This
shouldn't have any effect on the build result.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2024-10-21 12:48:41 +02:00
parent 9beed389fe
commit 5a85a0e167

View File

@ -577,15 +577,16 @@ class Build(Command):
cmd = [linker]
elib = env.lib_dirs_to_ldflags(ext.lib_dirs)
xlib = env.libraries_to_ldflags(ext.libraries)
all_objects = sorted(objects + ext.extra_objs)
if iswindows or env is self.windows_cross_env:
pre_ld_flags = []
if ext.uses_icu:
# windows has its own ICU libs that dont work
pre_ld_flags = elib
cmd += pre_ld_flags + env.ldflags + ext.ldflags + elib + xlib + \
['/EXPORT:' + init_symbol_name(ext.name)] + objects + ext.extra_objs + ['/OUT:'+dest]
['/EXPORT:' + init_symbol_name(ext.name)] + all_objects + ['/OUT:'+dest]
else:
cmd += objects + ext.extra_objs + ['-o', dest] + env.ldflags + ext.ldflags + elib + xlib
cmd += all_objects + ['-o', dest] + env.ldflags + ext.ldflags + elib + xlib
return LinkCommand(cmd, objects, dest)
env = self.env_for_compilation_db(ext)