Skip to content

Commit 190db3b

Browse files
paulmckrcuThomas Hellström
authored andcommitted
drm/xe: Fix build bug for GCC 11
Building drivers/gpu/drm/xe/xe_gt_pagefault.c with GCC 11 results in the following build errors: ./include/linux/fortify-string.h:57:33: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=] 57 | #define __underlying_memcpy __builtin_memcpy | ^ ./include/linux/fortify-string.h:644:9: note: in expansion of macro ‘__underlying_memcpy’ 644 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:689:26: note: in expansion of macro ‘__fortify_memcpy_chk’ 689 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/xe/xe_gt_pagefault.c:340:17: note: in expansion of macro ‘memcpy’ 340 | memcpy(pf_queue->data + pf_queue->tail, msg, len * sizeof(u32)); | ^~~~~~ In file included from drivers/gpu/drm/xe/xe_device_types.h:17, from drivers/gpu/drm/xe/xe_vm_types.h:16, from drivers/gpu/drm/xe/xe_bo.h:13, from drivers/gpu/drm/xe/xe_gt_pagefault.c:16: drivers/gpu/drm/xe/xe_gt_types.h:102:25: note: at offset [1144, 265324] into destination object ‘tile’ of size 8 102 | struct xe_tile *tile; | ^~~~ Fix these by removing -Wstringop-overflow from drm/xe builds. Closes: https://lore.kernel.org/all/45ad1d0f-a10f-483e-848a-76a30252edbe@paulmck-laptop/ Fixes: 7a8bc11 ("drm/xe: Enable W=1 warnings by default") Suggested-by: Stephen Rothwell <sfr@rothwell.id.au> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> [ This particular warning is broken on GCC11. In future changes it will be moved to the normal C flags in the top level Makefile (out of Makefile.extrawarn), but accounting for the compiler support. Just remove it out of xe's forced extra warnings for now ] Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> (cherry picked from commit a109d19) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 23ca3d2 commit 190db3b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/gpu/drm/xe/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
1717
subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
1818
subdir-ccflags-y += $(call cc-option, -Wformat-overflow)
1919
subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
20-
subdir-ccflags-y += $(call cc-option, -Wstringop-overflow)
2120
subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
2221
# The following turn off the warnings enabled by -Wextra
2322
ifeq ($(findstring 2, $(KBUILD_EXTRA_WARN)),)

0 commit comments

Comments
 (0)