From patchwork Fri Jul 6 06:34:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 141257 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2758726ljj; Thu, 5 Jul 2018 23:34:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcz/cogWcYVqSxQJaaJu4P3DUuacXG+HrtSu2UVWBV2GbnUrxxbSd+05h9/GdmJikevDM2h X-Received: by 2002:a62:3c4:: with SMTP id 187-v6mr9455056pfd.128.1530858895581; Thu, 05 Jul 2018 23:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530858895; cv=none; d=google.com; s=arc-20160816; b=BK3G/FpJsB+D4tUNuWnpeyS1wztMpFpOPzLg3Gt1gxnH/YjQ9IDqMfSP4ymAiujEm0 GqXTEbLoWvPUI/7+NSiftLVd67nfN7TAhX7FZ2s9UTpJkegPgr4UJkWEzig5W/jO88jV eC8QDsriXymmSfsqTB/rUM40axNuz0h8wEpTLCxl7ujzMBKMAl9woQvqItaFG2tt1wIh 1gnmdEnZPp2drx/qNR59spUDnLjIg+KCIvP9BxoXaymHH0a/S9hnEGqAH2bw4cpLPpyp EjKV6o/dKlS+nCywk5cXTOUSk63XVvczz2B1A2E2UiUlgzfQdJ4D/oiM9o6Hih+k9KXw 7H8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=7GX18oZJST8/k1SjpZDzbu+MZYATUT0/OJ/lJ3BFPGI=; b=g34qWwZdR+lPKLjmRB/BnZuJ3XdJXDKlJN2W/tgi3+9NEGSsWvAErehREo+J6vgc4O IDDELpuVe9X2FFig0zdR3jPJyxVptrlnLP5/iiXjNvWvnNhtioZy9TPpQwVpjzTOwIXL YgcX9znTgkWODlpfGBqNSOerxoZIYx2586Pd8HYm5dwFQS6iYzT5h1WAlkQLM5AALwvi 6Fv4gXGXEOyQWdVOAPByKZgR1syb6eEmswca2BIbrEPIrCigzixnhAWfu0j3oJDm8vXv 6rldAxKj1vd8t4nBHVBSEZY4YnXU/6Y80klwJJ686d/+ITKODHRMT/VWMC4/NvtvcOgp YvBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=h3nowq4W; 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 b13-v6si6880560pgw.478.2018.07.05.23.34.55; Thu, 05 Jul 2018 23:34:55 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=h3nowq4W; 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 S932563AbeGFGex (ORCPT + 30 others); Fri, 6 Jul 2018 02:34:53 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:41225 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753224AbeGFGev (ORCPT ); Fri, 6 Jul 2018 02:34:51 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id w666Y6xF022276; Fri, 6 Jul 2018 15:34:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w666Y6xF022276 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1530858847; bh=7GX18oZJST8/k1SjpZDzbu+MZYATUT0/OJ/lJ3BFPGI=; h=From:To:Cc:Subject:Date:From; b=h3nowq4Wjomg7PodKdV442Kaw59Z7skRWnfzIsRBt8AztqbapWgdhUrW5zb3WOM0J 4D5tJ+POu9F9U3wPG1JCgG05VrELH+VJ10K01K5g4vYZg1Is6owpZPRlsh9FMXQXQw m5mE/Mp3m/IYWZwj/dVEJTRxZ39cX6IkpXy2usUHIx1u/0/5iLP+ErbCmdaxg2YKKH lCfA8Sf8NChpcSQY6cXWbXXQqO+JX0hfY7SKXMMeOl9TunEP+M3RG49uT+/hjJgLm4 oqUTh6rVPUbGFENUJ198DbRNJ6xWkA40aZ3Nu8nEcl1pzouY+elp1fX8d1cynyI3wH 6AZ2Pqi6yvEzg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Sam Ravnborg , Masahiro Yamada , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Corbet , Michal Marek Subject: [PATCH] kbuild: add LDFLAGS_KERNEL to pass additional linker flags for vmlinux Date: Fri, 6 Jul 2018 15:34:03 +0900 Message-Id: <1530858843-14997-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kbuild provides LDFLAGS_MODULE to allows users to give additional options for linking modules, but there is no way to append flags for linking vmlinux. It is true LDFLAGS_vmlinux specifies the linker options for vmlinux, but it is only for internal-use. We have CFLAGS_KERNEL, AFLAGS_KERNEL already, so LDFLAGS_KERNEL is the same pattern. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/kbuild.txt | 4 ++++ Makefile | 2 ++ 2 files changed, 6 insertions(+) -- 2.7.4 diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt index 6c9c69e..f3a0a47 100644 --- a/Documentation/kbuild/kbuild.txt +++ b/Documentation/kbuild/kbuild.txt @@ -46,6 +46,10 @@ CFLAGS_MODULE -------------------------------------------------- Additional module specific options to use for $(CC). +LDFLAGS_KERNEL +-------------------------------------------------- +Additional options used for $(LD) when linking vmlinux. + LDFLAGS_MODULE -------------------------------------------------- Additional options used for $(LD) when linking modules. diff --git a/Makefile b/Makefile index 58bd78b..6f9f4b1 100644 --- a/Makefile +++ b/Makefile @@ -848,6 +848,8 @@ ifeq ($(CONFIG_STRIP_ASM_SYMS),y) LDFLAGS_vmlinux += $(call ld-option, -X,) endif +LDFLAGS_vmlinux += $(LDFLAGS_KERNEL) + # insure the checker run with the right endianness CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian)