mesa: Build with -Wno-error=typedef-redefinition. While here, use CWARNFLAGS.clang instead of an explicit conditional. In file included from 110_blorp_exec.c:33: In file included from /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/blorp/blorp_genX_exec.h:27: In file included from /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/blorp/blorp_priv.h:30: /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/compiler/nir/nir.h:3840:3: error: redefinition of typedef 'nir_shader' is a C11 feature [-Werror,-Wtypedef-redefinition] } nir_shader; ^ /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/compiler/brw_compiler.h:41:27: note: previous definition is here typedef struct nir_shader nir_shader; ^diff -r1.41 -r1.42 src/external/mit/xorg/lib/dri/Makefile
(riastradh)
--- src/external/mit/xorg/lib/dri/Makefile 2024/04/26 17:22:26 1.41
+++ src/external/mit/xorg/lib/dri/Makefile 2024/05/05 15:25:31 1.42
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.41 2024/04/26 17:22:26 rillig Exp $ | 1 | # $NetBSD: Makefile,v 1.42 2024/05/05 15:25:31 riastradh Exp $ | |
2 | 2 | |||
3 | # Link the mesa_dri_drivers mega driver. | 3 | # Link the mesa_dri_drivers mega driver. | |
4 | 4 | |||
5 | NOLINT= # Lots of "Unsupported platform" due to undefined __GNUC__ | 5 | NOLINT= # Lots of "Unsupported platform" due to undefined __GNUC__ | |
6 | 6 | |||
7 | .include <bsd.own.mk> | 7 | .include <bsd.own.mk> | |
8 | 8 | |||
9 | .include "../mesa-which.mk" | 9 | .include "../mesa-which.mk" | |
10 | 10 | |||
11 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \ | 11 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \ | |
12 | ${MACHINE} == "evbarm" | 12 | ${MACHINE} == "evbarm" | |
13 | 13 | |||
14 | LIBISMODULE= yes | 14 | LIBISMODULE= yes | |
@@ -475,27 +475,28 @@ LIBDPLIBS+= drm_intel ${.CURDIR}/../lib | @@ -475,27 +475,28 @@ LIBDPLIBS+= drm_intel ${.CURDIR}/../lib | |||
475 | .endif | 475 | .endif | |
476 | LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon | 476 | LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon | |
477 | 477 | |||
478 | MESA_SRC_MODULES= main math math_xform vbo tnl swrast ss common asm_c program asm_s | 478 | MESA_SRC_MODULES= main math math_xform vbo tnl swrast ss common asm_c program asm_s | |
479 | .include "../libmesa.mk" | 479 | .include "../libmesa.mk" | |
480 | .include "../libglsl.mk" | 480 | .include "../libglsl.mk" | |
481 | 481 | |||
482 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | 482 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | |
483 | SRCS+= streaming-load-memcpy.c | 483 | SRCS+= streaming-load-memcpy.c | |
484 | CPPFLAGS.streaming-load-memcpy.c+= -msse4.1 | 484 | CPPFLAGS.streaming-load-memcpy.c+= -msse4.1 | |
485 | CPPFLAGS.isl_tiled_memcpy_sse41.c+= -msse4.1 | 485 | CPPFLAGS.isl_tiled_memcpy_sse41.c+= -msse4.1 | |
486 | .endif | 486 | .endif | |
487 | 487 | |||
488 | CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-error=atomic-alignment :} | 488 | CWARNFLAGS.clang+= -Wno-error=atomic-alignment | |
489 | CWARNFLAGS.clang+= -Wno-error=typedef-redefinition | |||
489 | 490 | |||
490 | .include "../driver.mk" | 491 | .include "../driver.mk" | |
491 | 492 | |||
492 | .for _d in ${DRIVERS} | 493 | .for _d in ${DRIVERS} | |
493 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} | 494 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} | |
494 | SYMLINKS+= ${_d}_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so | 495 | SYMLINKS+= ${_d}_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so | |
495 | .if ${MKDEBUG} != "no" | 496 | .if ${MKDEBUG} != "no" | |
496 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug | 497 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug | |
497 | .endif | 498 | .endif | |
498 | .endfor | 499 | .endfor | |
499 | 500 | |||
500 | .endif | 501 | .endif | |
501 | 502 |
--- src/external/mit/xorg/lib/dri.old/Makefile 2023/08/08 06:27:31 1.8
+++ src/external/mit/xorg/lib/dri.old/Makefile 2024/05/05 15:25:31 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.8 2023/08/08 06:27:31 mrg Exp $ | 1 | # $NetBSD: Makefile,v 1.9 2024/05/05 15:25:31 riastradh Exp $ | |
2 | 2 | |||
3 | # Link the mesa_dri_drivers mega driver. | 3 | # Link the mesa_dri_drivers mega driver. | |
4 | 4 | |||
5 | # Uses 'assert(cond)' in a comma expression, leading to a syntax error because | 5 | # Uses 'assert(cond)' in a comma expression, leading to a syntax error because | |
6 | # in lint mode, 'assert(cond)' expands to an empty string, and '(, expr)' is | 6 | # in lint mode, 'assert(cond)' expands to an empty string, and '(, expr)' is | |
7 | # not an expression. | 7 | # not an expression. | |
8 | NOLINT= | 8 | NOLINT= | |
9 | 9 | |||
10 | LINTFLAGS+= -X 213 # void function '%s' cannot return value | 10 | LINTFLAGS+= -X 213 # void function '%s' cannot return value | |
11 | LINTFLAGS+= -Ac23 # allow C23, for empty initializer braces | 11 | LINTFLAGS+= -Ac23 # allow C23, for empty initializer braces | |
12 | 12 | |||
13 | # When build_id.c expands the macro invocation 'ElfW(Nhdr)', the result is | 13 | # When build_id.c expands the macro invocation 'ElfW(Nhdr)', the result is | |
14 | # 'Elf64 /* MD native binary size */ _Nhdr'. The comment prevents the two | 14 | # 'Elf64 /* MD native binary size */ _Nhdr'. The comment prevents the two | |
@@ -448,27 +448,28 @@ LIBDPLIBS+= drm_intel ${.CURDIR}/../lib | @@ -448,27 +448,28 @@ LIBDPLIBS+= drm_intel ${.CURDIR}/../lib | |||
448 | .endif | 448 | .endif | |
449 | LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon | 449 | LIBDPLIBS+= drm_radeon ${.CURDIR}/../libdrm_radeon | |
450 | 450 | |||
451 | MESA_SRC_MODULES= main math math_xform vbo tnl swrast ss common asm_c program asm_s | 451 | MESA_SRC_MODULES= main math math_xform vbo tnl swrast ss common asm_c program asm_s | |
452 | .include "../libmesa${OLD_SUFFIX}.mk" | 452 | .include "../libmesa${OLD_SUFFIX}.mk" | |
453 | .include "../libglsl${OLD_SUFFIX}.mk" | 453 | .include "../libglsl${OLD_SUFFIX}.mk" | |
454 | 454 | |||
455 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | 455 | .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" | |
456 | SRCS+= streaming-load-memcpy.c | 456 | SRCS+= streaming-load-memcpy.c | |
457 | CPPFLAGS.streaming-load-memcpy.c+= -msse4.1 | 457 | CPPFLAGS.streaming-load-memcpy.c+= -msse4.1 | |
458 | CPPFLAGS.isl_tiled_memcpy_sse41.c+= -msse4.1 | 458 | CPPFLAGS.isl_tiled_memcpy_sse41.c+= -msse4.1 | |
459 | .endif | 459 | .endif | |
460 | 460 | |||
461 | CFLAGS+= ${${ACTIVE_CC} == "clang":? -Wno-error=atomic-alignment :} | 461 | CWARNFLAGS.clang+= -Wno-error=atomic-alignment | |
462 | CWARNFLAGS.clang+= -Wno-error=typedef-redefinition | |||
462 | 463 | |||
463 | .include "../driver${OLD_SUFFIX}.mk" | 464 | .include "../driver${OLD_SUFFIX}.mk" | |
464 | 465 | |||
465 | .for _d in ${DRIVERS} | 466 | .for _d in ${DRIVERS} | |
466 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} | 467 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so.${SHLIB_MAJOR} | |
467 | SYMLINKS+= ${_d}_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so | 468 | SYMLINKS+= ${_d}_dri.so.${SHLIB_MAJOR} ${DRIDIR}/${_d}_dri.so | |
468 | .if ${MKDEBUG} != "no" | 469 | .if ${MKDEBUG} != "no" | |
469 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug | 470 | SYMLINKS+= mesa_dri_drivers.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHLIB_MAJOR}.debug | |
470 | .endif | 471 | .endif | |
471 | .endfor | 472 | .endfor | |
472 | 473 | |||
473 | .endif | 474 | .endif | |
474 | 475 |