From: Kees Cook <keescook@chromium.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Xin Li <xin3.li@intel.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
linux-kbuild@vger.kernel.org, x86@kernel.org,
andrew.cooper3@citrix.com, hpa@zytor.com, peterz@infradead.org
Subject: Re: [PATCH 1/1] kbuild: upgrade the orphan section warning to an error if CONFIG_WERROR is set
Date: Mon, 24 Oct 2022 10:32:58 -0700 [thread overview]
Message-ID: <202210241031.4BB6E70FB@keescook> (raw)
In-Reply-To: <Y1bLk47I4pyEmJVi@dev-arch.thelio-3990X>
On Mon, Oct 24, 2022 at 10:29:55AM -0700, Nathan Chancellor wrote:
> On Fri, Oct 21, 2022 at 08:05:19PM -0700, Xin Li wrote:
> > Andrew Cooper suggested upgrading the orphan section warning to a hard link
> > error. However Nathan Chancellor said outright turning the warning into an
> > error with no escape hatch might be too aggressive, as we have had these
> > warnings triggered by new compiler generated sections, and suggested turning
> > orphan sections into an error only if CONFIG_WERROR is set. Kees Cook echoed
> > and emphasized that the mandate from Linus is that we should avoid breaking
> > builds. It wrecks bisection, it causes problems across compiler versions, etc.
> >
> > Thus upgrade the orphan section warning to a hard link error only if
> > CONFIG_WERROR is set.
> >
> > Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Suggested-by: Nathan Chancellor <nathan@kernel.org>
> > Signed-off-by: Xin Li <xin3.li@intel.com>
>
> Thanks for the patch!
>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
>
> We could deduplicate the '$(if $(CONFIG_WERROR),error,warn)' logic if we
> hoisted it into Kconfig by having something like
>
> config LD_ORPHAN_WARN_LEVEL
> string
> depends on LD_ORPHAN_WARN
> default "error" if WERROR
> default "warn"
>
> in init/Kconfig then using it everywhere like
>
> --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
>
> but I will let others decide if they would prefer that over the
> direction we went here.
I think this makes it look cleaner, yeah.
--
Kees Cook
next prev parent reply other threads:[~2022-10-24 17:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-22 3:05 [PATCH 0/1] kbuild: upgrade the orphan section warning to an error if CONFIG_WERROR is set Xin Li
2022-10-22 3:05 ` [PATCH 1/1] " Xin Li
2022-10-24 17:29 ` Nathan Chancellor
2022-10-24 17:32 ` Kees Cook [this message]
2022-10-24 23:23 ` Li, Xin3
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=202210241031.4BB6E70FB@keescook \
--to=keescook@chromium.org \
--cc=andrew.cooper3@citrix.com \
--cc=hpa@zytor.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
--cc=xin3.li@intel.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