mips: fix dynamic ftrace
[openwrt/openwrt.git] / target / linux / generic / pending-4.9 / 305-mips_module_reloc.patch
index fc8015b5f6d304874051e282d1e18f99c77d61b2..10d9f0bdd5679bcac0543e34ba228c27a3020637 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/arch/mips/Makefile
 +++ b/arch/mips/Makefile
-@@ -93,8 +93,13 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
+@@ -93,8 +93,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
  cflags-y                      += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely
  cflags-y                      += -msoft-float
  LDFLAGS_vmlinux                       += -G 0 -static -n -nostdlib
@@ -19,8 +19,13 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  KBUILD_AFLAGS_MODULE          += -mlong-calls
  KBUILD_CFLAGS_MODULE          += -mlong-calls
 +else
-+KBUILD_AFLAGS_MODULE          += -mno-long-calls
-+KBUILD_CFLAGS_MODULE          += -mno-long-calls
++  ifdef CONFIG_DYNAMIC_FTRACE
++    KBUILD_AFLAGS_MODULE      += -mlong-calls
++    KBUILD_CFLAGS_MODULE      += -mlong-calls
++  else
++    KBUILD_AFLAGS_MODULE      += -mno-long-calls
++    KBUILD_CFLAGS_MODULE      += -mno-long-calls
++  endif
 +endif
  
  ifeq ($(CONFIG_RELOCATABLE),y)