LKML Archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	 Linux Kernel Build System <linux-kbuild@vger.kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	 Kees Cook <keescook@chromium.org>, Xu Zhen <xuzhen@fastmail.com>,
	 Nathan Chancellor <nathan@kernel.org>
Subject: Re: Incorrect thinlto cache directory path in Makefile
Date: Sun, 12 May 2024 22:14:40 +0900	[thread overview]
Message-ID: <CAK7LNASVN7he-iuSTY8Z2cvxRA=97iqZHbW3mNL_38xzdbcvyw@mail.gmail.com> (raw)
In-Reply-To: <CAK7LNARrG0u2pSzAkdbzrcf_i7ByhEnDwHH=4LtaE_H7OgL=0A@mail.gmail.com>

On Sun, May 12, 2024 at 10:04 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> +CC: Nathan
>
>
> On Sat, May 11, 2024 at 8:18 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
> >
> > Hi,
> >
> > Xu Zhen <xuzhen@fastmail.com> reported on Bugzilla (https://bugzilla.kernel.org/show_bug.cgi?id=218825) thinlto build directory problem (especially on
> > DKMS modules). He wrote:
> >
> > > In Makefile, the ld flag `--thinlto-cache-dir' is set to
> > > `$(extmod_prefix).thinlto-cache'. But at that time, the variable extmod_prefix
> > > had not been assigned yet. Therefore, the thinlto cache dir is always created
> > > in the current directory.
> > >
> > > Even worse, the cache dir cannot be deleted when executing `make clean'. This
> > > is because its path was written as `$(KBUILD_EXTMOD)/.thinlto-cache' in the
> > > clean: target.
> > >
> > > Some users have been troubled by it: https://github.com/dell/dkms/issues/292
> > >
> > > This bug was introduced by commit dc5723b02e523b2c4a68667f7e28c65018f7202f
>
>
> I agree this is a bug.
>
>
>
>
> line 945:
>   KBUILD_LDFLAGS  += --thinlto-cache-dir=$(extmod_prefix).thinlto-cache
>
>
> line 1034:
>   KBUILD_LDFLAGS  += $(call ld-option,--no-warn-rwx-segments)


This one is probably OK because it is guarded by CONFIG_LD_IS_BFD,
while LTO requires LD_IS_LLD.






I see another ld-option at 1043.

  LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z
pack-relative-relocs)


Maybe, this is related to the issue
(although I did not attempt to reproduce it).




-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2024-05-12 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 11:18 Fwd: Incorrect thinlto cache directory path in Makefile Bagas Sanjaya
2024-05-12 13:04 ` Masahiro Yamada
2024-05-12 13:14   ` Masahiro Yamada [this message]

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='CAK7LNASVN7he-iuSTY8Z2cvxRA=97iqZHbW3mNL_38xzdbcvyw@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=bagasdotme@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=xuzhen@fastmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).