On Tue, Oct 16, 2018 at 03:29:37PM +0300, Jani Nikula wrote: > When building the kernel with Clang with defconfig and CONFIG_64BIT > disabled, vmlinux fails to link because of the BUILD_BUG in > _print_param. > > ld: drivers/gpu/drm/i915/i915_params.o: in function `i915_params_dump': > i915_params.c:(.text+0x56): undefined reference to > `__compiletime_assert_191' > > This function is semantically invalid unless the code is first inlined > then constant folded, which doesn't work for Clang because semantic > analysis happens before optimization/inlining. > > [The above written by Nathan Chancellor <natechancellor@xxxxxxxxx>] > > Use WARN_ONCE() instead of BUILD_BUG() to avoid the problem. The > WARN_ONCE() should get optimized away unless there's a type that's not > handled by _print_param(). > > References: https://github.com/ClangBuiltLinux/linux/issues/191 > References: http://mid.mail-archive.com/20181009171401.14980-1-natechancellor@xxxxxxxxx > Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> > Cc: Nathan Chancellor <natechancellor@xxxxxxxxx> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Reported-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> > Reported-by: Nathan Chancellor <natechancellor@xxxxxxxxx> > Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> Tested-by: Nathan Chancellor <natechancellor@xxxxxxxxx> Thanks for the quick turnaround and help getting this fixed, Jani! > --- > drivers/gpu/drm/i915/i915_params.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c > index bd6bd8879cab..8d71886b5f03 100644 > --- a/drivers/gpu/drm/i915/i915_params.c > +++ b/drivers/gpu/drm/i915/i915_params.c > @@ -184,7 +184,8 @@ static __always_inline void _print_param(struct drm_printer *p, > else if (!__builtin_strcmp(type, "char *")) > drm_printf(p, "i915.%s=%s\n", name, *(const char **)x); > else > - BUILD_BUG(); > + WARN_ONCE(1, "no printer defined for param type %s (i915.%s)\n", > + type, name); > } > > /** > -- > 2.11.0 > _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx