Commit f62818d9 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

compel: no -r for ARM ldflags

Commit d9486bd7 ("arm/pie/build: do not produce relocatable parasite
object") removed -r from LDFLAGS used to compile criu pie. This
functionality somehow never made it to criu-dev, and was also lost
in master then compel was ported to it.

Make it work with compel.

Unfortunately it was not as simple as I initially thought, as -r flag
to ld was built into nmk. This patch removes it, and adds it to all
places that need intermediate linking.

Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8b99809a
......@@ -11,6 +11,7 @@ ccflags-y += -iquote compel/arch/$(ARCH)/src/lib/include
ccflags-y += -iquote compel/include
ccflags-y += -fno-strict-aliasing
ccflags-y += -fPIC
ldflags-y += -r
#
# UAPI inclusion, referred as <compel/...>
......
......@@ -26,7 +26,11 @@
#define COMPEL_CFLAGS_PIE CFLAGS_DEFAULT_SET "-fpie"
#define COMPEL_CFLAGS_NOPIC CFLAGS_DEFAULT_SET "-fno-pic"
#ifdef NO_RELOCS
#define COMPEL_LDFLAGS_COMMON "-z noexecstack -T "
#else
#define COMPEL_LDFLAGS_COMMON "-r -z noexecstack -T "
#endif
typedef struct {
const char *arch; // dir name under arch/
......
ccflags-y += -iquote criu/$(ARCH)
ccflags-y += $(COMPEL_UAPI_INCLUDES)
CFLAGS_REMOVE_clone-noasan.o += $(CFLAGS-ASAN)
ldflags-y += -r
obj-y += action-scripts.o
obj-y += external.o
......
......@@ -4,6 +4,7 @@ ccflags-y += -iquote $(obj)/include -iquote criu/include
ccflags-y += -iquote include
ccflags-y += $(COMPEL_UAPI_INCLUDES)
asflags-y += -D__ASSEMBLY__
ldflags-y += -r
obj-y += cpu.o
obj-y += crtools.o
......
......@@ -5,6 +5,7 @@ ccflags-y += -iquote criu/include -iquote include
ccflags-y += $(COMPEL_UAPI_INCLUDES)
asflags-y += -D__ASSEMBLY__
ldflags-y += -r
obj-y += cpu.o
obj-y += crtools.o
......
......@@ -3,6 +3,7 @@ builtin-name := crtools.built-in.o
ccflags-y += -iquote $(obj)/include
ccflags-y += -iquote criu/include -iquote include
ccflags-y += $(COMPEL_UAPI_INCLUDES)
ldflags-y += -r
obj-y += cpu.o
obj-y += crtools.o
......
......@@ -7,7 +7,7 @@ ccflags-y += $(COMPEL_UAPI_INCLUDES)
asflags-y += -Wstrict-prototypes
asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer
asflags-y += -iquote $(obj)/include
ldflags-y += -z noexecstack
ldflags-y += -r -z noexecstack
obj-y += cpu.o
obj-y += crtools.o
......
......@@ -5,4 +5,4 @@ ccflags-y += -iquote criu/$(ARCH_DIR)/include
ccflags-y += -iquote criu/include
ccflags-y += -iquote images
ccflags-y += -fPIC -fno-stack-protector
ldflags-y += -z noexecstack
ldflags-y += -r -z noexecstack
......@@ -142,7 +142,7 @@ endif
define gen-ld-target-rule
$(1): $(3)
$$(call msg-link, $$@)
$$(Q) $$(LD) $(2) -r -o $$@ $(4)
$$(Q) $$(LD) $(2) -o $$@ $(4)
endef
define gen-ar-target-rule
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment