Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp546260ybl; Tue, 28 Jan 2020 07:40:12 -0800 (PST) X-Google-Smtp-Source: APXvYqywJm4weS4vR6q0XHoVnsJCpVkXWLFK4AhJ664rTAj+IQKGf8CwIXGd0fZeQb+mGdfYxgXU X-Received: by 2002:a05:6808:a8a:: with SMTP id q10mr3209406oij.66.1580226012040; Tue, 28 Jan 2020 07:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580226012; cv=none; d=google.com; s=arc-20160816; b=TJCXmM9xdBL3ib4Or5pvnnng4z2ImuEomfy5PhJsoP7N0CXxJKTXHkGwnopapE53gs rAHveFMg1XkGJFVnQu6jlt71W4dP6gydRDoUhiUtTKiRRF5U/nEfbuIMm5HBtVNMmQm8 GQ4WngPU69g4bqZuOvmLHx6NQ4zpJB2tFAbksL4njPJmBTMIlnKyRpOxVuh2rcGN4gZn He+fwgJm7sJJDocaUibQcPLDS2FB1vWd/YQckugNQZw5ehhNxO4DHPpEoaR1G053g3M1 sOj4KsYF/KghOMk3g6vexBKyyAOT8Jjq/HZNBPBiKbPAdkQ/odARUm1u2HsKVem+AV2X u3RA== 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=p/deCH70MeRzW576JyUqvHOFrulpoT9ELP3wElLzEto=; b=PLoPcBns5oU1s5uAjDxC+bYytAUnWsBe+b1keRfxQha7b1buuyiuCehRUc5ZyYQKAo N73upCnPXwDpDI1vakdSaN8BjS+wSPtNdk5YneW+D2u8YRzJtr5aFwaxYYPVFa32yJsJ JBeCIWejY6RFDGcM5Rm3KwzfI5eifWxU3WWUUudaVKAeW5XEZJFOr3iPfuVdu1IFOkYI SHafrdAcSK6qHw8NaVybIGixUhII7Q8C+tpucxm9+OwfXrNArvK+vyJUHvriWceonuss 4fWQHmR+kHBVsY+89fLlVZvaLAMqLy3yX7S7fMz77ewW+7mk9ETpXAbUa90vxE24upSp shZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RwoHxlEi; 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 w24si4730693oic.260.2020.01.28.07.39.59; Tue, 28 Jan 2020 07:40:12 -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=RwoHxlEi; 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 S1726558AbgA1PiC (ORCPT + 99 others); Tue, 28 Jan 2020 10:38:02 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40483 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbgA1PiC (ORCPT ); Tue, 28 Jan 2020 10:38:02 -0500 Received: by mail-pl1-f196.google.com with SMTP id y1so1697971plp.7 for ; Tue, 28 Jan 2020 07:38:02 -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=p/deCH70MeRzW576JyUqvHOFrulpoT9ELP3wElLzEto=; b=RwoHxlEidVrtaVNrBr0sHELF0cy8c6FVzBJXx6cAvJrkquD1+CKsZJV/qXjli3jaNM XWfhnmy9vVl5o7cYuwmpa41NoXIxNCrXMAbs1T57v8ur4xmaxoQacltl9Yr9DcnNRteZ Ay/vGiN+8oFIJ4IlX9jQVMbOrRfAW5hsMA6pQblkf68Fe5wOiq3vF4wJeGWTU/JlD4TW yf5ChdcfN6f1GHP/SjbVIiQMwDmlkFgTw3t4Ul3dhRb56MFabj4LPxs8KKuqG0i5fO/t K9587nBMg+bN0IcRYOh+m2tUNxzbNw8U/MrvBApvpMbSU9bPMlQyDvwJRU0Ez/ovDgRk hAFg== 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=p/deCH70MeRzW576JyUqvHOFrulpoT9ELP3wElLzEto=; b=iuE306YD+wPad/gWTGmveVcIzQAE8Jz813RvLNZAeOrdqz4waAZVA4VoWGuVGr3o2c KcrwIoznSc0LzzQtDh4IDM7pwtnFJgO3ticYJeR3iFTJJFDpN1Jf2qIJb7icTjJ8WLYx a89mi+1uNtOXYUt7D3qihY8Flijil1h5zKzr6zzcPgsTIpTyy36LVhzSe4AzKU/r6gpA Coorxnh8ociMD+kJtrsaFrF/LxJXI/SZhpUI5b/Vj/IDKxOiEMLhJVbnNgZ3+56H5+k2 TYpjgt5acIKGhw28VdohLTEkkPz6etIHy0xXXmYv68xb3kuTOhzf4gsdSY4mzOYupM/6 1s3g== X-Gm-Message-State: APjAAAVW+Aqx+kZ9vaTUtvW8840FDysF0dWqm9WqZ4O5OMy+KRDJWtLg UiryfP5CPI48k5iq3qXHJyE= X-Received: by 2002:a17:90a:8043:: with SMTP id e3mr5270015pjw.24.1580225881520; Tue, 28 Jan 2020 07:38:01 -0800 (PST) Received: from [192.168.0.16] (97-115-104-237.ptld.qwest.net. [97.115.104.237]) by smtp.gmail.com with ESMTPSA id r6sm19887749pfh.91.2020.01.28.07.37.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jan 2020 07:38:00 -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> From: Gregory Rose Message-ID: Date: Tue, 28 Jan 2020 07:37:58 -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: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Thanks, I'll see if I can get that to work. - Greg > >> Make sure to include the external kernel module's Kbuild so that the >> necessary command line flags from the external module are set. >> >> Reported-by: David Ahern >> CC: Masahiro Yamada >> Signed-off-by: Greg Rose >> --- >> scripts/Makefile.modfinal | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal >> index 411c1e60..a645ba6 100644 >> --- a/scripts/Makefile.modfinal >> +++ b/scripts/Makefile.modfinal >> @@ -21,6 +21,10 @@ __modfinal: $(modules) >> modname = $(notdir $(@:.mod.o=)) >> part-of-module = y >> >> +# Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS >> +include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \ >> + $(KBUILD_EXTMOD)/Kbuild) >> + >> quiet_cmd_cc_o_c = CC [M] $@ >> cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< >> >> -- >> 1.8.3.1 >> >