Skip to content

Commit a642514

Browse files
hdellergregkh
authored andcommitted
parisc: Enable -mlong-calls gcc option with CONFIG_COMPILE_TEST
commit 778e45d upstream The kernel test robot reported multiple linkage problems like this: hppa64-linux-ld: init/main.o(.init.text+0x56c): cannot reach printk init/main.o: in function `unknown_bootoption': (.init.text+0x56c): relocation truncated to fit: R_PARISC_PCREL22F against symbol `printk' defined in .text.unlikely section in kernel/printk/printk.o There are two ways to solve it: a) Enable the -mlong-call compiler option (CONFIG_MLONGCALLS), b) Add long branch stub support in 64-bit linker. While b) is the long-term solution, this patch works around the issue by automatically enabling the CONFIG_MLONGCALLS option when CONFIG_COMPILE_TEST is set, which indicates that a non-production kernel (e.g. 0-day kernel) is built. Signed-off-by: Helge Deller <deller@gmx.de> Reported-by: kernel test robot <lkp@intel.com> Fixes: 00e35f2 ("parisc: Enable -mlong-calls gcc option by default when !CONFIG_MODULES") Cc: stable@vger.kernel.org # v5.6+ Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ea22242 commit a642514

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

arch/parisc/Kconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,12 @@ config PREFETCH
201201
def_bool y
202202
depends on PA8X00 || PA7200
203203

204+
config PARISC_HUGE_KERNEL
205+
def_bool y if !MODULES || UBSAN || FTRACE || COMPILE_TEST
206+
204207
config MLONGCALLS
205-
def_bool y if !MODULES || UBSAN || FTRACE
206-
bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE
208+
def_bool y if PARISC_HUGE_KERNEL
209+
bool "Enable the -mlong-calls compiler option for big kernels" if !PARISC_HUGE_KERNEL
207210
depends on PA8X00
208211
help
209212
If you configure the kernel to include many drivers built-in instead

0 commit comments

Comments
 (0)