parisc: add CONFIG_MLONGCALLS option to enable linkage of huge vmlinux executables
authorHelge Deller <deller@gmx.de>
Thu, 31 Jan 2013 21:44:28 +0000 (21:44 +0000)
committerHelge Deller <deller@gmx.de>
Wed, 20 Feb 2013 21:46:57 +0000 (22:46 +0100)
When building a 64bit kernel which includes all necessary drivers and
filesystems the vmlinux kernel often gets so huge, that the linker won't
be able to resolve the branch stubs. This patch overcomes this limit by
providing an option to compile the kernel with the -mlong-calls compiler
option.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/Kconfig
arch/parisc/Makefile

index b77feffbadea9b91f46d85be47d35a0f49d4b2f4..3df1c35a217a3c2f34c85bc3825c02ce1c937451 100644 (file)
@@ -161,6 +161,23 @@ config PREFETCH
        def_bool y
        depends on PA8X00 || PA7200
 
+config MLONGCALLS
+       bool "Enable the -mlong-calls compiler option for big kernels"
+       def_bool y if (!MODULES)
+       depends on PA8X00
+       help
+         If you configure the kernel to include many drivers built-in instead
+         as modules, the kernel executable may become too big, so that the
+         linker will not be able to resolve some long branches and fails to link
+         your vmlinux kernel. In that case enabling this option will help you
+         to overcome this limit by using the -mlong-calls compiler option.
+
+         Usually you want to say N here, unless you e.g. want to build
+         a kernel which includes all necessary drivers built-in and which can
+         be used for TFTP booting without the need to have an initrd ramdisk.
+
+         Enabling this option will probably slow down your kernel.
+
 config 64BIT
        bool "64-bit kernel"
        depends on PA8X00
index 87f64d6b5dcb5569acf4dffcba4641ad9abdbd3d..ed9a14ccd066e5550225d1ee3566b3ea669159a2 100644 (file)
@@ -64,6 +64,10 @@ ifndef CONFIG_FUNCTION_TRACER
   cflags-y     += -ffunction-sections
 endif
 
+# Use long jumps instead of long branches (needed if your linker fails to
+# link a too big vmlinux executable)
+cflags-$(CONFIG_MLONGCALLS)    += -mlong-calls
+
 # select which processor to optimise for
 cflags-$(CONFIG_PA7100)                += -march=1.1 -mschedule=7100
 cflags-$(CONFIG_PA7200)                += -march=1.1 -mschedule=7200