From 1a2c30abbf79d2c1e0ec8c55e4c985d0cc6cbe0f Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Mon, 26 Feb 2018 02:07:55 -0500 Subject: [PATCH] rules.mak: Don't extract libs from .mo-libs in link command For module build, .mo objects are passed to LINK and consumed in process-archive-undefs. The reason behind that is documented in the comment above process-archive-undefs. Similarly, extract-libs should be called with .mo filtered out too. Otherwise, the .mo-libs are added to the link command incorrectly, spoiling the purpose of modularization. Currently we don't have any .mo-libs usage, but it will be used soon when we modularize more multi-source objects, like sdl and gtk. Backports commit 5b1b6dbd94e2e2e98920f886cb32fcf4a1520b50 from qemu --- qemu/rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/rules.mak b/qemu/rules.mak index cc045d83..f3f24484 100644 --- a/qemu/rules.mak +++ b/qemu/rules.mak @@ -47,7 +47,7 @@ process-archive-undefs = $(filter-out %.a %.mo,$1) \ $(call undefined-symbols,$(filter %.mo,$1)))) \ $(filter %.a,$1) -extract-libs = $(strip $(foreach o,$1,$($o-libs))) +extract-libs = $(strip $(foreach o,$(filter-out %.mo,$1),$($o-libs))) expand-objs = $(strip $(sort $(filter %.o,$1)) \ $(foreach o,$(filter %.mo,$1),$($o-objs)) \ $(filter-out %.o %.mo,$1))