From patchwork Mon Feb 26 18:41:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Jarry X-Patchwork-Id: 10243063 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 9EBB4602DC for ; Mon, 26 Feb 2018 18:42:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 944982A06A for ; Mon, 26 Feb 2018 18:42:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 893122A0AD; Mon, 26 Feb 2018 18:42:45 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED26F2A06A for ; Mon, 26 Feb 2018 18:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752085AbeBZSmo (ORCPT ); Mon, 26 Feb 2018 13:42:44 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35498 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751663AbeBZSmm (ORCPT ); Mon, 26 Feb 2018 13:42:42 -0500 Received: by mail-wm0-f65.google.com with SMTP id x7so16842455wmc.0 for ; Mon, 26 Feb 2018 10:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9IkzrnbpwUNh9qGJL+j6zIwG0FGkOYGqpu2zLbnP678=; b=jFDJGfQgPME+CmNc5Kms7Y7PSR0IBgy4fGDamLi2qrnI2JDmSlFRJkYSEcLoz/Pbmw uaxHkBqYDM0zYUZw5xUMmQzQhi3t60DPyxUdOyEhSOuF0e5FUkPrzL0SyN1igmZ/2lXo 1yFEP2dk7Xi2lZ1/JQvhpkT20zNUfLCFaD/GEYU9RRc8hfRPJdYj0S3pkTf+TcMcJ7M7 Kgcwa1+IixCEDgVakt3GrzSnKC3aAH5Gzs9sF8qcMqrOI0+KAH6XIPanOeeqYyFD5Tv5 3lcsV+OpKdqUO3b/6FZBYwJwd7MrAMHa8X+637yC4mQU8Oq36OXL95c8Fb452g2RJ4WH o8rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9IkzrnbpwUNh9qGJL+j6zIwG0FGkOYGqpu2zLbnP678=; b=AHzjV/6bvypS9KOUR4WN4MJYNY/96bDtUkF8+hhwHe9vrEDN9Q32/trWJTeJQzuHJk Iqyk3ebcdxKRy2cfcMvqtSYY7YZ+W3TU8KN0lE43YrsmSLg8xr09Fnyg0KQsqbXv9gCN nGewqQrhTnhOcnb2Din4YBgmOS+vMw8NQ7gVb799duGVOFojvu+JFLeLEMM3saflXuPi tp8qSy7etF//1ImUEsS6NmOMt3ntrwNSHn+w5vXwpmHNqsb35KYPE77jXv8YwCRQ30dK JiC/6wAIJoglJHV26SwfOqpZsTIbxs7Xx59N6D94XL9NSi9J+/U7LO9jbDMFIT7V+11J iQIA== X-Gm-Message-State: APf1xPANqJ3qgXaOOjypVrEbtH4UFmx5a3113ETgK/vQsHDUaH/7JZ7E 6Wdob08WW/92Qf2I1rYPxZlHPw== X-Google-Smtp-Source: AH8x227po5CszI+sIVWEMJU/4ZBjLsfofExs+O0C0Vsn4LOtNyb910GGtZhLE6+de4JDlkupAs3zIQ== X-Received: by 10.28.229.85 with SMTP id c82mr9571716wmh.76.1519670561385; Mon, 26 Feb 2018 10:42:41 -0800 (PST) Received: from tom.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id l11sm7221746wrg.71.2018.02.26.10.42.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 10:42:39 -0800 (PST) From: Robin Jarry To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Josh Poimboeuf , Ingo Molnar Subject: [PATCH v2 1/3] kbuild: introduce HOST_{C,LD}FLAGS Date: Mon, 26 Feb 2018 19:41:46 +0100 Message-Id: <864ea8d9df0428826f85bbf3b7fc0af4e3669c5f.1519668832.git.robin.jarry@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add user-specifiable compiler/linker flags for host programs. Append these to already existing HOST{C,CXX,LD}FLAGS. Update documentation accordingly. Signed-off-by: Robin Jarry Cc: Josh Poimboeuf Cc: Ingo Molnar --- Documentation/admin-guide/README.rst | 16 ++++++++++++++++ Makefile | 7 ++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/README.rst b/Documentation/admin-guide/README.rst index af5a437198d0..22ba3140e85f 100644 --- a/Documentation/admin-guide/README.rst +++ b/Documentation/admin-guide/README.rst @@ -271,6 +271,22 @@ Compiling the kernel To have the build system also tell the reason for the rebuild of each target, use ``V=2``. The default is ``V=0``. + - Host libs in non standard locations: + + Some host programs are linked with external libraries, such as openssl + or libelf. If these libs are installed in non standard locations on + your build system, you may specify it via the ``HOST_CFLAGS`` and + ``HOST_LDFLAGS`` parameters on the ``make`` command line. + + For example, if you have installed host libs in ``/foo/staging``, you + may use the following command:: + + make HOST_CFLAGS="-I/foo/staging/include" \ + HOST_LDFLAGS="-L/foo/staging/lib -Wl,-rpath=/foo/staging/lib" + + Please note: If the ``HOST_CFLAGS`` or ``HOST_LDFLAGS`` options are + used, then they must be used for all invocations of make. + - Keep a backup kernel handy in case something goes wrong. This is especially true for the development releases, since each new release contains new code which has not been debugged. Make sure you keep a diff --git a/Makefile b/Makefile index 659a7780aeb3..f7c543cebfc6 100644 --- a/Makefile +++ b/Makefile @@ -362,9 +362,10 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS) HOSTCC = gcc HOSTCXX = g++ HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ - -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) -HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) -HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) + -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ + $(HOST_CFLAGS) +HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOST_CFLAGS) +HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOST_LDFLAGS) HOST_LOADLIBES := $(HOST_LFS_LIBS) # Make variables (CC, etc...)