lkml.org 
[lkml]   [2022]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] kbuild: upgrade the orphan section warning to an error if CONFIG_WERROR is set
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

\
 
 \ /
  Last update: 2022-10-24 21:05    [W:0.092 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site