From: Henning Schild <
henning...@siemens.com>
Some distros enable their compilers to default to building
position independant executables. The linux kernel just
disables that when set, also for its tools.
In the inmates subdir we already have -no-pic so that is not
affected.
Reported-by: florian <
flol...@googlemail.com>
Signed-off-by: Henning Schild <
henning...@siemens.com>
diff --git a/tools/Makefile b/tools/Makefile
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -13,7 +13,7 @@
# includes installation-related variables and definitions
include $(src)/../scripts/
include.mk
-LD = $(CC)
+LD = $(CC) $(KBUILD_CFLAGS)
NOSTDINC_FLAGS :=
LINUXINCLUDE := -I$(src)/../driver
KBUILD_CFLAGS := -g -O3 -DLIBEXECDIR=\"$(libexecdir)\" \
@@ -22,6 +22,10 @@ KBUILD_CFLAGS := -g -O3 -DLIBEXECDIR=\"$
LDFLAGS :=
GCOV_PROFILE := n
+# force no-pie for distro compilers that enable pie by default
+KBUILD_CFLAGS += $(call cc-option, -fno-pie)
+KBUILD_CFLAGS += $(call cc-option, -no-pie)
+
BINARIES := jailhouse
HELPERS := \