]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
rules.mak: Use -r instead of -Wl, -r to fix building when PIE is default
authorAdrian Bunk <bunk@stusta.de>
Sun, 27 Nov 2016 16:28:17 +0000 (18:28 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 13 Dec 2016 00:05:55 +0000 (18:05 -0600)
Building qemu fails in distributions where gcc enables PIE by default
(e.g. Debian unstable) with:

/usr/bin/ld: -r and -pie may not be used together

Use -r instead of -Wl,-r to avoid gcc passing -pie to the linker
when PIE is enabled and a relocatable object is passed.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Message-Id: <20161127162817.15144-1-bunk@stusta.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit c96f0ee6a67ca6277366e78ce5d84d5c20dd596f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
rules.mak

index 99cd0b3371c00396439a5100d7798c18e60c083b..97f1aa16774a6ef044c171936b908b2a2776be09 100644 (file)
--- a/rules.mak
+++ b/rules.mak
@@ -92,7 +92,7 @@ module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS)
        $(if $(findstring /,$@),$(call quiet-command,cp $@ $(subst /,-,$@), "  CP    $(subst /,-,$@)"))
 
 
-LD_REL := $(CC) -nostdlib -Wl,-r $(LD_REL_FLAGS)
+LD_REL := $(CC) -nostdlib -r $(LD_REL_FLAGS)
 
 %.mo:
        $(call quiet-command,$(LD_REL) -o $@ $^,"  LD -r $(TARGET_DIR)$@")