[CRIU] [PATCH 7/9] nmk: do not sort lib-y objects
Kir Kolyshkin
kir at openvz.org
Fri Mar 24 15:07:44 PDT 2017
When performing static linking, the order of objects is important
(when the linker finds an undefined reference, it looks forward,
never back). Therefore, sorting objects breaks things.
Required for the next patch.
Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
scripts/nmk/scripts/build.mk | 2 +-
scripts/nmk/scripts/utils.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/nmk/scripts/build.mk b/scripts/nmk/scripts/build.mk
index 907967c..cd49ace 100644
--- a/scripts/nmk/scripts/build.mk
+++ b/scripts/nmk/scripts/build.mk
@@ -89,7 +89,7 @@ endif
#
# Prepare the unique entries.
obj-y := $(sort $(call uniq,$(obj-y)))
-lib-y := $(filter-out $(obj-y),$(sort $(call uniq,$(lib-y))))
+lib-y := $(filter-out $(obj-y),$(lib-y))
#
# Add subdir path
diff --git a/scripts/nmk/scripts/utils.mk b/scripts/nmk/scripts/utils.mk
index bf84141..1736ada 100644
--- a/scripts/nmk/scripts/utils.mk
+++ b/scripts/nmk/scripts/utils.mk
@@ -16,7 +16,7 @@ uniq = $(strip $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),
#
# Add $(obj)/ for paths that are not relative
-objectify = $(foreach o,$(sort $(call uniq,$(1))),$(if $(filter /% ./% ../%,$(o)),$(o),$(obj)/$(o)))
+objectify = $(foreach o,$(1),$(if $(filter /% ./% ../%,$(o)),$(o),$(obj)/$(o)))
# To cleanup entries.
cleanify = $(foreach o,$(sort $(call uniq,$(1))),$(o) $(o:.o=.d) $(o:.o=.i) $(o:.o=.s) $(o:.o=.gcda) $(o:.o=.gcno))
--
2.9.3
More information about the CRIU
mailing list