Skip to contentSkip to conversation

rules.mak: remove $(sort) from extract-libs

PATCH Applied Paolo Bonzini 3 participants 3 messages Jun 16, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rules.mak: remove $(sort) from extract-libs

Duplicate removal was added to extract-libs in order to avoid including the same library multiple times into the linking command line; this could potentially happen when using "foo.mo-libs" (which adds the library to all components, causing it to appear N times if the module is composed of N objects). However, sorting and removing duplicates causes problems with static linking, and also with space-separated linker options as found in some Mac OS X packaging systems. Furthermore, the "optimization" is really a non-problem since we do not expect .mo modules to be composed of many files.

---
Peter, can you please apply this directly as it fixes the build and there are no other pending patches?

---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rules.mak +1 -1
index dde8e00..945484e 100644
@@ -22,7 +22,7 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
 # Same as -I$(SRC_PATH) -I., but for the nested source/object directories
 QEMU_INCLUDES += -I$(<D) -I$(@D)
 
-extract-libs = $(strip $(sort $(foreach o,$1,$($o-libs))))
+extract-libs = $(strip $(foreach o,$1,$($o-libs)))
 expand-objs = $(strip $(sort $(filter %.o,$1)) \
                   $(foreach o,$(filter %.mo,$1),$($o-objs)) \
                   $(filter-out %.o %.mo,$1))
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Paolo Bonzini

Duplicate removal was added to extract-libs in order to avoid including the same library multiple times into the linking command line; this could potentially happen when using "foo.mo-libs" (which adds the library to all components, causing it to appear N times if the module is composed of N objects). However, sorting and removing duplicates causes problems with static linking, and also with space-separated linker options as found in some Mac OS X packaging systems. Furthermore, the "optimization" is really a non-problem since we do not expect .mo modules to be composed of many files.

---
Peter, can you please apply this directly as it fixes the build and there are no other pending patches?

---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rules.mak +0 -0
index dde8e00..945484e 100644

rules.mak QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d · line 28

Quoted 8 lines
rules.mak +1 -1
@@ -22,7 +22,7 @@ QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
 # Same as -I$(SRC_PATH) -I., but for the nested source/object directories
 QEMU_INCLUDES += -I$(<D) -I$(@D)
 
-extract-libs = $(strip $(sort $(foreach o,$1,$($o-libs))))
+extract-libs = $(strip $(foreach o,$1,$($o-libs)))
 expand-objs = $(strip $(sort $(filter %.o,$1)) \
                   $(foreach o,$(filter %.mo,$1),$($o-objs)) \
                   $(filter-out %.o %.mo,$1))

I was wondering about the $(sort), now this matches what I proposed in

http://lists.nongnu.org/archive/html/qemu-devel/2014-06/msg02351.html

#2 lore raw
In reply to Paolo Bonzini
Quoted 10 lines · Paolo Bonzini

Duplicate removal was added to extract-libs in order to avoid including the same library multiple times into the linking command line; this could potentially happen when using "foo.mo-libs" (which adds the library to all components, causing it to appear N times if the module is composed of N objects). However, sorting and removing duplicates causes problems with static linking, and also with space-separated linker options as found in some Mac OS X packaging systems. Furthermore, the "optimization" is really a non-problem since we do not expect .mo modules to be composed of many files.

Quoted 7 lines

---
Peter, can you please apply this directly as it fixes the build and there are no other pending patches?
---

Applied, thanks.

-- PMM