> 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@xxxxxxxxxx> > > > Suggested-by: Nathan Chancellor <nathan@xxxxxxxxxx> > > > Signed-off-by: Xin Li <xin3.li@xxxxxxxxx> > > > > Thanks for the patch! > > > > Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx> > > Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx> > > > > 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. Agree this looks much cleaner. > > -- > Kees Cook