mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Alexey Brodkin <Alexey.Brodkin@synopsys.com>,
	<linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>,
	Vineet Gupta <Vineet.Gupta1@synopsys.com>
Subject: Re: [PATCH] ARC: Explicitly add -mmedium-calls to CFLAGS
Date: Wed, 30 May 2018 09:31:11 -0700	[thread overview]
Message-ID: <a9a04d22-e6be-a9e5-f478-b2b723d7e40d@synopsys.com> (raw)
In-Reply-To: <20180516150330.31182-1-abrodkin@synopsys.com>

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.

      reply	other threads:[~2018-05-30 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 15:03 Alexey Brodkin
2018-05-30 16:31 ` Vineet Gupta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9a04d22-e6be-a9e5-f478-b2b723d7e40d@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®