[Mesa-dev] [PATCH 01/13] i965: Add a dependency on libisl

Jonathan Gray jsg at jsg.id.au
Fri Apr 22 17:15:09 UTC 2016


On Fri, Apr 22, 2016 at 05:31:29PM +0100, Emil Velikov wrote:
> On 22 April 2016 at 16:08, Jonathan Gray <jsg at jsg.id.au> wrote:
> > It is worth noting that the isl code extensively requires designated
> > initialisers on anonymous structs.  It isn't clear to me when gcc introduced
> > support for this but it isn't in 4.2.
> >
> I think it should work for GCC 4.2 with -fms-extensions. We used to
> set -std=gnu99 for pre 4.6 which effectively enables it the extension.
> Can you double-check ?

The part that sets gnu99 for < gcc 4.6 is still there, using -fms-extensions
does not help for these.

libtool: compile:  gcc -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"11.3.0-devel\" "-DPACKAGE_STRING=\"Mesa 11.3.0-devel\"" "-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"11.3.0-devel\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_DLADDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_SHA1_IN_LIBC=1 -DHAVE_VALGRIND=1 -I. -I/usr/X11R6/include -I/usr/X11R6/include/libdrm -I/usr/local/include/valgrind -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DDEBUG -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DHAVE_SHA1 -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DHAVE_MINCORE -I../../../include -I../../../src -I../../../src/intel -I../../../src/mapi -I../../../src/mesa -I../../../src/mesa/drivers/dri/common -I../../../src/mesa/drivers/dri/i965 -I../../../src/gallium/auxiliary -I../../../src/gallium/include -I../../../src -I../../../src/intel -g -O2 -Wall -std=gnu99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-builtin-memcmp -Wno-override-init -DGEN_VERSIONx10=70 -g -O2 -Wall -std=gnu99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-builtin-memcmp -MT libisl_gen7_la-isl_gen7.lo -MD -MP -MF .deps/libisl_gen7_la-isl_gen7.Tpo -c isl_gen7.c  -fPIC -DPIC -o .libs/libisl_gen7_la-isl_gen7.o
In file included from isl_gen7.h:26,
                 from isl_gen7.c:24:
isl_priv.h: In function 'isl_extent3d_sa_to_el':
isl_priv.h:119: error: unknown field 'w' specified in initializer
isl_priv.h:119: warning: missing braces around initializer
isl_priv.h:119: warning: (near initialization for '(anonymous).<anonymous>')
isl_priv.h:120: error: unknown field 'h' specified in initializer
isl_priv.h:121: error: unknown field 'd' specified in initializer
isl_priv.h: In function 'isl_extent3d_el_to_sa':
isl_priv.h:131: error: unknown field 'w' specified in initializer
isl_priv.h:131: warning: missing braces around initializer
isl_priv.h:131: warning: (near initialization for '(anonymous).<anonymous>')
isl_priv.h:132: error: unknown field 'h' specified in initializer
isl_priv.h:133: error: unknown field 'd' specified in initializer
isl_gen7.c: In function 'gen7_choose_image_alignment_el':
isl_gen7.c:391: error: unknown field 'w' specified in initializer
isl_gen7.c:391: warning: missing braces around initializer
isl_gen7.c:391: warning: (near initialization for '(anonymous).<anonymous>')
isl_gen7.c:392: error: unknown field 'h' specified in initializer
isl_gen7.c:393: error: unknown field 'd' specified in initializer
*** Error 1 in src/intel/isl (Makefile:744 'libisl_gen7_la-isl_gen7.lo')

> 
> > Would you accept patches to remove them?
> While I cannot comment if they're OK with the idea, there might be
> some confusion on the topic.
> There is anonymous and named. I believe developers were against the
> latter. Examples form [1]
> 
>     struct bar { int i; }; // (1) unnamed, but tagged, ie *not* anonymous
>     struct { int j; };     // (2) unnamed, but anonymous
>     struct { int k; } baz; // (3) named, but not tagged
> 
> Fwiw it would be great to use the more portable solution. Would C11
> buy us anything ?
> 
> 
> Thanks
> Emil
> 
> [1] http://stackoverflow.com/questions/5063548/initialization-of-anonymous-structures-or-unions-in-c1x


More information about the mesa-dev mailing list