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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQsD5KMA-DrDS-9krNdQLfHJEnJ2NB6mq2aLemY2xs+-w@mail.gmail.com>
Date:   Sat, 21 Dec 2019 01:00:22 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Sam Ravnborg <sam@...nborg.org>,
        Johan Hovold <johan@...nel.org>,
        Jonathan Corbet <corbet@....net>,
        Michal Marek <michal.lkml@...kovi.net>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kbuild: clarify the difference between obj-y and obj-m
 w.r.t. descending

On Fri, Dec 20, 2019 at 4:53 AM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Thu, Dec 19, 2019 at 08:51:00PM +0900, Masahiro Yamada wrote:
> > Kbuild descends into a directory by either 'y' or 'm', but there is an
> > important difference.
> >
> > Kbuild combines the built-in objects into built-in.a in each directory.
> > The built-in.a in the directory visited by obj-y is merged into the
> > built-in.a in the parent directory. This merge happens recursively when
> > Kbuild is ascending back towards the top directory, so built-in objects
> > are linked into vmlinux eventually. This works properly only when the
> > Makefile that specifies obj-y is reachable by the chain of obj-y.
> >
> > On the other hand, Kbuild does not take built-in.a from the directory
> > visited by obj-m. This it, all the objects in that directory are supposed
> > to be modular. If Kbuild descends into a directory by obj-m, but the
> > Makefile in the sub-directory specifies obj-y, those objects are just
> > left orphan.
> >
> > The current statement "Kbuild only uses this information to decide that
> > it needs to visit the directory" is misleading. Clarify the difference.
>
> > +     Kbuild uses this information not only to decide that it needs to visit
> > +     the directory, but also to decide whether or not to link objects from
> > +     the directory into vmlinux.
> > +
> > +     When Kbuild descends into the directory with 'y', all built-in objects
> > +     from that directory are combined into the built-in.a, which will be
> > +     eventually linked into vmlinux.
> > +
> > +     When Kbuild descends into the directory with 'm', in contrast, nothing
> > +     from that directory will be linked into vmlinux. If the Makefile in
> > +     that directory specifies obj-y, those objects will be left orphan.
> > +     It is very likely a bug of the Makefile or of dependencies in Kconfig.
>
> Perhaps the implementation should be changed to match the documentation?
> This seems like a very subtle point for people to know.

I also considered this, but
I do not think the current behavior is too odd.
So, I am not changing it.

-- 
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ