From eaa724a77018bc19c08a8d87e91940dc35de5c1f Mon Sep 17 00:00:00 2001 From: apb Date: Sun, 18 Nov 2012 08:24:02 +0000 Subject: [PATCH] Use -Wno-array-bounds when building two files that read past the end of an array. It's not clear how to fix the real bug. This hack allows the build to complete with clang. --- .../xorg/server/drivers/xf86-video-xgi/Makefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/external/mit/xorg/server/drivers/xf86-video-xgi/Makefile b/external/mit/xorg/server/drivers/xf86-video-xgi/Makefile index 726989cd4a0f..15274125fbaa 100644 --- a/external/mit/xorg/server/drivers/xf86-video-xgi/Makefile +++ b/external/mit/xorg/server/drivers/xf86-video-xgi/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2012/07/19 19:21:50 macallan Exp $ +# $NetBSD: Makefile,v 1.2 2012/11/18 08:24:02 apb Exp $ DRIVER= xf86-video-xgi DRIVER_NAME= xgi_drv @@ -16,4 +16,19 @@ CPPFLAGS+= -I${DESTDIR}${X11INCDIR}/libdrm # for now, I'd like to see this thing work first CPPFLAGS+= -DHAVE_UNISTD_H -Wno-deprecated-declarations +# vb_struct.h contains this declaration: +# +# typedef struct _XGI_CRT1TableStruct +# { +# UCHAR CR[15]; +# } XGI_CRT1TableStruct; +# +# but code in init.c and vb_setmode.c reads elements beyond the end of +# the array and writes the result into hardware registers. It's not +# clear how to fix this, so just disable the -Warray-bounds warning to +# allow the build to complete. +# +COPTS.init.c= -Wno-array-bounds +COPTS.vb_setmode.c= -Wno-array-bounds + .include "../Makefile.xf86-driver"