All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH RFC kbuild] lib/crypto: blake2s: include as built-in
Date: Sat, 25 Dec 2021 16:10:52 +0900	[thread overview]
Message-ID: <CAK7LNAQViiExZQTKiRVE_2wiQVjeS+MLCvJO_xn3sJaqcuoPfA@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9oKMm_VZ10yArhstX4_=f6Vj6Po-uii_0t_wjtiG81dvg@mail.gmail.com>

On Thu, Dec 23, 2021 at 12:55 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> On Wed, Dec 22, 2021 at 4:49 PM Randy Dunlap <rdunlap@infradead.org> wrote:
> > If lib-y ignores (drops) an object file (usually because it is not used),
> > the usual way to force it to be included is to add it to obj-y instead
> > of lib-y (see many examples in lib/Makefile).
>
> This is not a problem with lib-y. This is a problem with libs-y. Note
> the 's'. The former is working as expected. The latter controls
> whether a directory's lib.a is picked up. For whatever reason, the
> build system isn't respecting a libs-y declaration added to
> lib/Makefile like it respects for one added to arch/*/Makefile.
>
> > However, this may cause problems with weak symbols. I don't recall it being
> > used in that scenario.
>
> The reason we're using lib-y is so that unused code is pruned in the
> case that the weak symbol isn't used. IOW, a usual use for lib-y. And
> it works just fine. As mentioned, the issue is just with libs-y not
> finding that lib.a file.

lib-y does not work like that.

See commit 7273ad2b08f8ac9563579d16a3cf528857b26f49

When CONFIG_MODULES=y (this is true for most of usecases),
there is not much difference between obj-y and lib-y.

So, weak functions will remain in vmlinux even if they are unused.



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2021-12-25  7:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 14:36 [PATCH RFC kbuild] lib/crypto: blake2s: include as built-in Jason A. Donenfeld
2021-12-22 15:49 ` Randy Dunlap
2021-12-22 15:55   ` Jason A. Donenfeld
2021-12-25  7:10     ` Masahiro Yamada [this message]
2021-12-22 16:59 ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNAQViiExZQTKiRVE_2wiQVjeS+MLCvJO_xn3sJaqcuoPfA@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.