From patchwork Mon Oct 9 14:35:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9993597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0200960230 for ; Mon, 9 Oct 2017 14:37:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E778D287FF for ; Mon, 9 Oct 2017 14:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBEE928802; Mon, 9 Oct 2017 14:37:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 606D3287FF for ; Mon, 9 Oct 2017 14:37:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YNcQBBUOSJY8VTMfQG0BL5afniwkMES4H+mzSINAotI=; b=CIQB+gLL2elaHAL9F4uYp/6uA6 VjAMcZwIzhhiA/aAYKKY7dP4zoXcLpeOeTCvJs6TVkCg3crp4ytNSp26jm9r/x0lXKo6Xet6YAlOS 9CWiHKJIaVaIn8cJSjblk0dtI28UT3SLNtvfJGFj4t4Ys+g1UlFyPPQ7CAQP1w1nVTn7SNGV1Ee9W dXPj2mjYVK1TQnFZ6hTJOT0Kj93LjcAiC4xN50sIIbYh3nimg/1M9UQexW5+OuoFs5vOdSgUUe827 ChG7v43XwscL9OwYlSQgOegtYj9LismlKa0owy6MryAcCRJA4UvbLLm/RY4nfGEkayUzp+76qh2u9 A4OMjchw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e1ZAc-0004Lj-Rz; Mon, 09 Oct 2017 14:36:38 +0000 Received: from conuserg-11.nifty.com ([210.131.2.78]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e1ZAI-00044T-RK for linux-arm-kernel@lists.infradead.org; Mon, 09 Oct 2017 14:36:21 +0000 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-11.nifty.com with ESMTP id v99EZVZE018442; Mon, 9 Oct 2017 23:35:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com v99EZVZE018442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1507559733; bh=vhZK8jdpmCMsB6s0pfqfXlqRIWFAzlmu1PRPxwQLrTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gSDGxejtjJWQDXg5q+Kyw8jdqzMAwIFr+0St73spMmeenkZu3J7lauqnYZIYdZ5tC HDrmCF7L+tGetY6N4CsGixflCzG5ayAhCHjP9LUG+/SLCELEnLFIA+YCMAkTaTwCMM 4N/PZ9QNafaWaVcQ26d8higfbsTgESKIQH+4RNvRxcjyXOKTw4dhzQagfasSP/0V8b zMe7oKkLGl5Mm2u0Hi1Zbd3Irr82gbCuyGBGDjfu3Cv8hknPGJmJbElOC/qcb8is6e /QYDk3W2lnZVmy6MZoaKGOlRoMtACuB2hKRLzSt2BeNyOi1fYs/w7h0kZDNgOhoLyR 46lsr4bVRVFlA== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Subject: [PATCH 1/3] ARM: add KBUILD_ prefix to CFLAGS_MODULE, LDFLAGS_MODULE Date: Mon, 9 Oct 2017 23:35:13 +0900 Message-Id: <1507559715-30918-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507559715-30918-1-git-send-email-yamada.masahiro@socionext.com> References: <1507559715-30918-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171009_073619_140124_9DDD6F29 X-CRM114-Status: UNSURE ( 7.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masahiro Yamada , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP {CFLAGS,LDFLAGS}_MODULE are supposed to be set by users, not by in-kernel makefiles. Documentation/kbuild/makefiles.txt clearly explains the difference: KBUILD_CFLAGS_MODULE Options for $(CC) when building modules $(KBUILD_CFLAGS_MODULE) is used to add arch-specific options that are used for $(CC). From commandline CFLAGS_MODULE shall be used (see kbuild.txt). KBUILD_LDFLAGS_MODULE Options for $(LD) when linking modules $(KBUILD_LDFLAGS_MODULE) is used to add arch-specific options used when linking modules. This is often a linker script. From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). Signed-off-by: Masahiro Yamada Acked-by: Russell King --- arch/arm/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index cdb5b55..cafa4d4 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -16,11 +16,11 @@ LDFLAGS := LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) LDFLAGS_vmlinux += --be8 -LDFLAGS_MODULE += --be8 +KBUILD_LDFLAGS_MODULE += --be8 endif ifeq ($(CONFIG_ARM_MODULE_PLTS),y) -LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds +KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm/kernel/module.lds endif GZFLAGS :=-9 @@ -120,7 +120,7 @@ CFLAGS_ISA :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN) AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb # Work around buggy relocation from gas if requested: ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y) -CFLAGS_MODULE +=-fno-optimize-sibling-calls +KBUILD_CFLAGS_MODULE +=-fno-optimize-sibling-calls endif else CFLAGS_ISA :=$(call cc-option,-marm,)