Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5437169ybl; Tue, 4 Feb 2020 14:05:24 -0800 (PST) X-Google-Smtp-Source: APXvYqxPuFrYXyDng1Hyw7NsEecoU2LkNgMDGUa8QZwPYKkm3Edmqp/wmM37Yy+TGxUBMuYMYV5H X-Received: by 2002:a54:4085:: with SMTP id i5mr812875oii.17.1580853924768; Tue, 04 Feb 2020 14:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580853924; cv=none; d=google.com; s=arc-20160816; b=yE5aH0/6rc1IetA4Nw5hJ92mVVOBmv+VoTkqNLXRcJ91GJGo0M9oEg2zpVWkvzsJMv HJKc3Ys0GptI6biNKfTfn6W5rdcNNDCN8FIQAQBl98kZZFclX+eh5Ya19P7p9DVc8Uqz fTm4abqryHOGroS69E2OTuRyFJPa2xeNUjAN704InGWQCVMIkdNM3t4UUfoTf7LAqJL8 5hokPEVvURuJTgSiLV736l6ZwHNt5R91AspbOxJj2Zm12zWCrWQjmXzNbpn1HSKMUU4O HKRmBedgrtGGiBfFWlzmmq5krdxTIrAF0pLHwiEuaABPIq+2cMhgG/E8hLgK36IACGHp onGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=cw7uphHP9U6UP+lxamhBKouzCmQh7IsOGgJhwnSNEpw=; b=yN5e7142WcOvPP7dgU/PTqXDb9cfzefELVvj949sqGRIfuxTxq9/Z7DAssEq1EHdVW 4P1YpYjcwUubaIkoFFokrpMIvOCgMuIvKgzg8zvQ1bLhTEJlkyCKLuUnBzZXkzCjwt4g eG28iAA8ueXbAbQTEjZDAesFiYO6ZxWvJhOokIeUCBynRHyOqlqg4+W8fxvKDYwuc6wa uMgiH89D6GS/Ltdsm4N4iaZB9WfDgaa0KFbqbpfiNBc9Dp/YTzqWtw/rq/0Tz7pkY0f/ SI6HT0rM8ItH+PV4c7hsdM3tZpxeLiaf2DXg+asDnduHdWbTbSC+p/blxrbgJOrU6W1B 142Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uQnUHfdR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h125si10934728oia.253.2020.02.04.14.05.11; Tue, 04 Feb 2020 14:05:24 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=uQnUHfdR; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727566AbgBDWC6 (ORCPT + 99 others); Tue, 4 Feb 2020 17:02:58 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:44633 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727461AbgBDWC6 (ORCPT ); Tue, 4 Feb 2020 17:02:58 -0500 Received: by mail-pg1-f196.google.com with SMTP id g3so4653251pgs.11 for ; Tue, 04 Feb 2020 14:02:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=cw7uphHP9U6UP+lxamhBKouzCmQh7IsOGgJhwnSNEpw=; b=uQnUHfdRIINQILC2vRhlGkfEXV7/liBdS6QaMg0YF6q1CGpK6rMZpNPZG9zXgQeeIQ 2tXaPr0DFInuRmBMRG5JRCe7d4jcpjLg9zsCbVTrvmUQdCtfZ+i9QSZxpPrbjkh1IWnh Zxq3X4+r+nhA/VVK+ExH5EGCsE2wFdJ0d6tIIt3WYMhaB2mbHgb3pezQPrlkzhh9XkfZ uU0RIShMQBqMG+ue5S0Tawxj5xXrADcyBwyi7RD/9T7ZCDfTkZlBwljmVQSSjNQ8MTrt AwICamJr2Vze485Ve9ATOP5OEQ8F+XAhiMfyYcOAT+D1pHEHZ/cq3euRl0FO+pcpGD7P sVdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cw7uphHP9U6UP+lxamhBKouzCmQh7IsOGgJhwnSNEpw=; b=M5zeouMh4xOQvA+AQXXg1wiGZFEYPuR89k9G80J2ankiX7KAcVFuaImQ++tJq3M7Or vPvTy6qZddR2O9nciK/HXA0Z+uCun+38Icj+vzCesGMuysRl1vUVFtDNXALhnaMFLb4v lpL4Av+X2M8YH9Xnq5BOdc0epXDfyrrjpHdpRrjtkU5N4dQwVIYxO48tG55AWpy07HVJ Didbd4Is4ERkOI8y23YdkTw5760PPIPuU+85TKplhM4HVsjHP6Sa4Er3SrE8IuPIPgyI 0JOREGCSkdazWOa/Fdtk3+VHhbNbAfYI79eHF2TFMhhvO4c6AXdqGaQkkZeZg6kRvP1G Vexg== X-Gm-Message-State: APjAAAUwjcFlYqhvxP9r8le91ayyL5txze2YfKoN2DqXTEkQowckieUm L5U9ZxZmx5cv8wR3Hs2iAoE= X-Received: by 2002:a63:120f:: with SMTP id h15mr4104893pgl.235.1580853777898; Tue, 04 Feb 2020 14:02:57 -0800 (PST) Received: from [192.168.0.16] ([97.115.141.236]) by smtp.gmail.com with ESMTPSA id gx2sm4698984pjb.18.2020.02.04.14.02.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Feb 2020 14:02:57 -0800 (PST) Subject: Re: [PATCH] kbuild: Include external modules compile flags To: Masahiro Yamada Cc: Linux Kernel Mailing List , dev@openvswitch.org, dsahern@gmail.com References: <1580161806-8037-1-git-send-email-gvrose8192@gmail.com> <677aff5a-a52e-08ae-f341-547af08f7566@gmail.com> From: Gregory Rose Message-ID: <660c4df3-16c8-4b06-9f06-cd847871e7ad@gmail.com> Date: Tue, 4 Feb 2020 14:02:55 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/1/2020 10:07 PM, Masahiro Yamada wrote: > On Thu, Jan 30, 2020 at 3:09 AM Gregory Rose wrote: >> >> On 1/28/2020 7:37 AM, Gregory Rose wrote: >>> On 1/27/2020 7:35 PM, Masahiro Yamada wrote: >>>> On Tue, Jan 28, 2020 at 6:50 AM Greg Rose wrote: >>>>> Since this commit: >>>>> 'commit 9b9a3f20cbe0 ("kbuild: split final module linking out into >>>>> Makefile.modfinal")' >>>>> at least one out-of-tree external kernel module build fails >>>>> during the modfinal make phase because Makefile.modfinal does >>>>> not include the ccflags-y variable from the exernal module's Kbuild. >>>> ccflags-y is passed only for compiling C files in that directory. >>>> >>>> It is not used for compiling *.mod.c >>>> This is true for both in-kernel and external modules. >>>> >>>> So, ccflags-y is not a good choice >>>> for passing such flags that should be globally effective. >>>> >>>> >>>> Maybe, KCFLAGS should work. >>>> >>>> >>>> module: >>>> $(MAKE) KCFLAGS=... M=$(PWD) -C /lib/modules/$(uname >>>> -r)/build modules >>>> >> Hi Masahiro, >> >> I'm unable to get that to work. KCFLAGS does not seem to be used in >> Makefile.modfinal. > > I quickly tested it, and confirmed > KCFLAGS works for external modules, too. > > > Makefile.modfinal includes scripts/Makefile.lib > > > So, c_flags contains $(KCFLAGS) > > c_flags -> KBUILD_CFLAGS -> KCFLAGS > Hi Masahiro, I must have missed  something then - again, my unfamiliarity with the Linux Makefiles is probably tripping me up.  I'll dig around and see if I can get that working. Thanks for your help, - Greg