Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1334905imm; Thu, 23 Aug 2018 01:01:32 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz+Y0+Jrep72Cnx9bEDEt1EWzs7pvxHXE4v10h4NYEBiugsjzS8i+PEE3ZCivMeZSUnBb47 X-Received: by 2002:a62:4494:: with SMTP id m20-v6mr61453454pfi.205.1535011292561; Thu, 23 Aug 2018 01:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011292; cv=none; d=google.com; s=arc-20160816; b=V6riGbT8E9bEOysSHjaFI4EyS8JHEchO1ht6UQDLRNjZOzKbUg7lxEAol61q4kEj5/ JzK4S/3bNKIZyzuM/Qs7PHtr9ofEjhpUZZjkOyDqv/2InwYUY6FWLf2KudYSma5C/bFU XXsuNe23AMsTIy43OznM+fMb03hvNkPzGRmCCR4Q8v3cfAnmbPFwwz3YrY/BL/vfCOai 1zZAtL0ZQ92WAbGKNeOV+9/Hgtgmy423ZvYy9wwfQW7hN2qvFhO9rKnuqZMeYa157dd1 nG3b4R6+TjlAge+MgSqKtPOkKeLSoLpb855weQVtDHZrqMQ45OTJ8ybvwgC1jOKZSOLk kSzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=UpGsVYOkYOYKiiHPVMOE1Q9IMTT7fiulHi4Q1StwEuE=; b=X6FaRmy1gLCGY0DIDTigVgnw+zF88UBZR6pItIBN+t7DNM98cTUvTzEYYEkjDXAtaE 0aTrckIHL6IOuA8/AY+2/FfiVqjJpI8XO01VL7rPeOyp+8dxtrwBn1ALaClJuqXd1i2R c/zY2NbxOORX+iymNkjM0LE29du1FTHOGToTWo9ROe152Zg2hiIusNPTfO0YYY+y+PNA xQ6OSzM9RhVV09FQJEX2X550R/KgoLYSGqVjGHKusTyTzPiiIRBHBdKODedvZIvwBt/3 v4gwblXuy37CoTUvRbzoxXG+U34AV3n2TnK5iwhC2xhpg1TeioavRKA86pNt2ZyddUdL N6DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12-v6si4079760pfd.254.2018.08.23.01.00.54; Thu, 23 Aug 2018 01:01:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbeHWLZZ (ORCPT + 99 others); Thu, 23 Aug 2018 07:25:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41512 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbeHWLZZ (ORCPT ); Thu, 23 Aug 2018 07:25:25 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 079ABACC; Thu, 23 Aug 2018 07:57:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Brodkin , Vineet Gupta , Sasha Levin Subject: [PATCH 4.4 01/79] ARC: Explicitly add -mmedium-calls to CFLAGS Date: Thu, 23 Aug 2018 09:52:37 +0200 Message-Id: <20180823074918.728499037@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Brodkin [ Upstream commit 74c11e300c103af47db5b658fdcf28002421e250 ] 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. And since we add "-mmedium-calls" to the global CFLAGS there's no point in having per-file copies thus removing them. Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/Makefile | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -14,7 +14,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 @@ -137,16 +137,3 @@ dtbs: scripts archclean: $(Q)$(MAKE) $(clean)=$(boot) - -# Hacks to enable final link due to absence of link-time branch relexation -# and gcc choosing optimal(shorter) branches at -O3 -# -# vineetg Feb 2010: -mlong-calls switched off for overall kernel build -# However lib/decompress_inflate.o (.init.text) calls -# zlib_inflate_workspacesize (.text) causing relocation errors. -# Thus forcing all exten calls in this file to be long calls -export CFLAGS_decompress_inflate.o = -mmedium-calls -export CFLAGS_initramfs.o = -mmedium-calls -ifdef CONFIG_SMP -export CFLAGS_core.o = -mmedium-calls -endif