Re: [RFC PATCH] kbuild: add -fno-PIE

From: Joe Perches
Date: Mon Oct 24 2016 - 13:49:07 EST


On Mon, 2016-10-24 at 19:32 +0200, Sven Joachim wrote:

(in the attachment)
> +KBUILD_CFLAGS += $(call cc-option,-fno-pie,)

trivia:

The trailing comma is not necessary though the Makefile
is a bit inconsistent about this.

$ git grep "KBUILD_CFLAGS.*call cc-option" Makefile
Makefile:KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
Makefile:KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
Makefile:KBUILD_CFLAGS += $(call cc-option,-fdata-sections,)
Makefile:KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
Makefile:KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
Makefile:KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
Makefile:KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
Makefile:KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
Makefile:KBUILD_CFLAGS += $(call cc-option, -fno-var-tracking-assignments)
Makefile:KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
Makefile:KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
Makefile:KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
Makefile:KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
Makefile:KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
Makefile:KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
Makefile:KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
Makefile:KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int)
Makefile:KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
Makefile:KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
Makefile:KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)