All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARC: Explicitly add -mmedium-calls to CFLAGS
@ 2018-05-16 15:03 ` Alexey Brodkin
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Brodkin @ 2018-05-16 15:03 UTC (permalink / raw)
  To: linux-snps-arc; +Cc: linux-kernel, Vineet Gupta, Alexey Brodkin

GCC built for arc*-*-linux has "-mmedium-calls" implicitly enabled by default
thus we don't see any problems during Linux kernel compilation.
----------------------------->8------------------------
arc-linux-gcc -mcpu=arc700 -Q --help=target | grep calls
  -mlong-calls                          [disabled]
  -mmedium-calls                        [enabled]
----------------------------->8------------------------

But if we try to use so-called Elf32 toolchain with GCC configured for
arc*-*-elf* then we'd see the following failure:
----------------------------->8------------------------
init/do_mounts.o: In function 'init_rootfs':
do_mounts.c:(.init.text+0x108): relocation truncated to fit: R_ARC_S21W_PCREL
against symbol 'unregister_filesystem' defined in .text section in fs/filesystems.o

arc-elf32-ld: final link failed: Symbol needs debug section which does not exist
make: *** [vmlinux] Error 1
----------------------------->8------------------------

That happens because neither "-mmedium-calls" nor "-mlong-calls" are enabled in
Elf32 GCC:
----------------------------->8------------------------
arc-elf32-gcc -mcpu=arc700 -Q --help=target | grep calls
  -mlong-calls                          [disabled]
  -mmedium-calls                        [disabled]
----------------------------->8------------------------

Now to make it possible to use Elf32 toolchain for building Linux kernel
we're explicitly add "-mmedium-calls" to CFLAGS.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 arch/arc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index d37f49d6a27f..db9ce90c3cc0 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -16,7 +16,7 @@ endif
 
 KBUILD_DEFCONFIG := nsim_700_defconfig
 
-cflags-y	+= -fno-common -pipe -fno-builtin -D__linux__
+cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
 cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
 cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARC: Explicitly add -mmedium-calls to CFLAGS
@ 2018-05-16 15:03 ` Alexey Brodkin
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Brodkin @ 2018-05-16 15:03 UTC (permalink / raw)
  To: linux-snps-arc

GCC built for arc*-*-linux has "-mmedium-calls" implicitly enabled by default
thus we don't see any problems during Linux kernel compilation.
----------------------------->8------------------------
arc-linux-gcc -mcpu=arc700 -Q --help=target | grep calls
  -mlong-calls                          [disabled]
  -mmedium-calls                        [enabled]
----------------------------->8------------------------

But if we try to use so-called Elf32 toolchain with GCC configured for
arc*-*-elf* then we'd see the following failure:
----------------------------->8------------------------
init/do_mounts.o: In function 'init_rootfs':
do_mounts.c:(.init.text+0x108): relocation truncated to fit: R_ARC_S21W_PCREL
against symbol 'unregister_filesystem' defined in .text section in fs/filesystems.o

arc-elf32-ld: final link failed: Symbol needs debug section which does not exist
make: *** [vmlinux] Error 1
----------------------------->8------------------------

That happens because neither "-mmedium-calls" nor "-mlong-calls" are enabled in
Elf32 GCC:
----------------------------->8------------------------
arc-elf32-gcc -mcpu=arc700 -Q --help=target | grep calls
  -mlong-calls                          [disabled]
  -mmedium-calls                        [disabled]
----------------------------->8------------------------

Now to make it possible to use Elf32 toolchain for building Linux kernel
we're explicitly add "-mmedium-calls" to CFLAGS.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
---
 arch/arc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index d37f49d6a27f..db9ce90c3cc0 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -16,7 +16,7 @@ endif
 
 KBUILD_DEFCONFIG := nsim_700_defconfig
 
-cflags-y	+= -fno-common -pipe -fno-builtin -D__linux__
+cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
 cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
 cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARC: Explicitly add -mmedium-calls to CFLAGS
  2018-05-16 15:03 ` Alexey Brodkin
@ 2018-05-30 16:31   ` Vineet Gupta
  -1 siblings, 0 replies; 4+ messages in thread
From: Vineet Gupta @ 2018-05-30 16:31 UTC (permalink / raw)
  To: Alexey Brodkin, linux-snps-arc; +Cc: linux-kernel, Vineet Gupta

On 05/16/2018 08:03 AM, Alexey Brodkin wrote:
> GCC built for arc*-*-linux has "-mmedium-calls" implicitly enabled by default
> thus we don't see any problems during Linux kernel compilation.
> ----------------------------->8------------------------
> arc-linux-gcc -mcpu=arc700 -Q --help=target | grep calls
>   -mlong-calls                          [disabled]
>   -mmedium-calls                        [enabled]
> ----------------------------->8------------------------
> 
> But if we try to use so-called Elf32 toolchain with GCC configured for
> arc*-*-elf* then we'd see the following failure:
> ----------------------------->8------------------------
> init/do_mounts.o: In function 'init_rootfs':
> do_mounts.c:(.init.text+0x108): relocation truncated to fit: R_ARC_S21W_PCREL
> against symbol 'unregister_filesystem' defined in .text section in fs/filesystems.o
> 
> arc-elf32-ld: final link failed: Symbol needs debug section which does not exist
> make: *** [vmlinux] Error 1
> ----------------------------->8------------------------
> 
> That happens because neither "-mmedium-calls" nor "-mlong-calls" are enabled in
> Elf32 GCC:
> ----------------------------->8------------------------
> arc-elf32-gcc -mcpu=arc700 -Q --help=target | grep calls
>   -mlong-calls                          [disabled]
>   -mmedium-calls                        [disabled]
> ----------------------------->8------------------------
> 
> Now to make it possible to use Elf32 toolchain for building Linux kernel
> we're explicitly add "-mmedium-calls" to CFLAGS.
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> ---
>  arch/arc/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> index d37f49d6a27f..db9ce90c3cc0 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -16,7 +16,7 @@ endif
>  
>  KBUILD_DEFCONFIG := nsim_700_defconfig
>  
> -cflags-y	+= -fno-common -pipe -fno-builtin -D__linux__
> +cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
>  cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
>  cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs

LGTM. Bbut while we are here, can you now remove -mmedium-calls for specific files
further down in the makefile.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARC: Explicitly add -mmedium-calls to CFLAGS
@ 2018-05-30 16:31   ` Vineet Gupta
  0 siblings, 0 replies; 4+ messages in thread
From: Vineet Gupta @ 2018-05-30 16:31 UTC (permalink / raw)
  To: linux-snps-arc

On 05/16/2018 08:03 AM, Alexey Brodkin wrote:
> GCC built for arc*-*-linux has "-mmedium-calls" implicitly enabled by default
> thus we don't see any problems during Linux kernel compilation.
> ----------------------------->8------------------------
> arc-linux-gcc -mcpu=arc700 -Q --help=target | grep calls
>   -mlong-calls                          [disabled]
>   -mmedium-calls                        [enabled]
> ----------------------------->8------------------------
> 
> But if we try to use so-called Elf32 toolchain with GCC configured for
> arc*-*-elf* then we'd see the following failure:
> ----------------------------->8------------------------
> init/do_mounts.o: In function 'init_rootfs':
> do_mounts.c:(.init.text+0x108): relocation truncated to fit: R_ARC_S21W_PCREL
> against symbol 'unregister_filesystem' defined in .text section in fs/filesystems.o
> 
> arc-elf32-ld: final link failed: Symbol needs debug section which does not exist
> make: *** [vmlinux] Error 1
> ----------------------------->8------------------------
> 
> That happens because neither "-mmedium-calls" nor "-mlong-calls" are enabled in
> Elf32 GCC:
> ----------------------------->8------------------------
> arc-elf32-gcc -mcpu=arc700 -Q --help=target | grep calls
>   -mlong-calls                          [disabled]
>   -mmedium-calls                        [disabled]
> ----------------------------->8------------------------
> 
> Now to make it possible to use Elf32 toolchain for building Linux kernel
> we're explicitly add "-mmedium-calls" to CFLAGS.
> 
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> ---
>  arch/arc/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arc/Makefile b/arch/arc/Makefile
> index d37f49d6a27f..db9ce90c3cc0 100644
> --- a/arch/arc/Makefile
> +++ b/arch/arc/Makefile
> @@ -16,7 +16,7 @@ endif
>  
>  KBUILD_DEFCONFIG := nsim_700_defconfig
>  
> -cflags-y	+= -fno-common -pipe -fno-builtin -D__linux__
> +cflags-y	+= -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
>  cflags-$(CONFIG_ISA_ARCOMPACT)	+= -mA7
>  cflags-$(CONFIG_ISA_ARCV2)	+= -mcpu=archs

LGTM. Bbut while we are here, can you now remove -mmedium-calls for specific files
further down in the makefile.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-30 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 15:03 [PATCH] ARC: Explicitly add -mmedium-calls to CFLAGS Alexey Brodkin
2018-05-16 15:03 ` Alexey Brodkin
2018-05-30 16:31 ` Vineet Gupta
2018-05-30 16:31   ` Vineet Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.