lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQyh9CFgKd1DtAPFW8DuHNp1gn8YABuP8-LsF=hHK2DFw@mail.gmail.com>
Date:   Tue, 28 Jan 2020 12:35:32 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Greg Rose <gvrose8192@...il.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        dev@...nvswitch.org, dsahern@...il.com
Subject: Re: [PATCH] kbuild: Include external modules compile flags

On Tue, Jan 28, 2020 at 6:50 AM Greg Rose <gvrose8192@...il.com> 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



> 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 <dsahern@...il.com>
> CC: Masahiro Yamada <yamada.masahiro@...ionext.com>
> Signed-off-by: Greg Rose <gvrose8192@...il.com>
> ---
>  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
>


-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ