[Mesa-dev] swr forces c++11 for whole compilation

Ilia Mirkin imirkin at alum.mit.edu
Wed Apr 13 13:27:51 UTC 2016


On Wed, Apr 13, 2016 at 9:06 AM, Jose Fonseca <jfonseca at vmware.com> wrote:
> On 13/04/16 13:48, Jose Fonseca wrote:
>>
>> On 13/04/16 11:43, Ilia Mirkin wrote:
>>>
>>> Hi Tim,
>>>
>>> It seems like building swr forces c++11 mode for the whole build, even
>>> other drivers being built that aren't necessarily ready for it.
>>> Unfortunately c++11 isn't backwards compatible with c++03, so the switch
>>> can't be made unilaterally. Could you have a look at why this is
>>> happening?
>>>
>>> An example of something that does this properly is clover, which also
>>> requires c++11 to be built.
>>>
>>> Thanks,
>>>
>>>    -ilia
>>>
>>
>> Ilia,
>>
>> Even before SWR was merged and today's isinf fix was commited,
>> nv50_ir_ra.cpp already has code to make it portable for C++11 (see below).
>>
>> I honestly don't understand what you're trying to achieve with this
>> thread...
>>
>> Are you seriously plan to require C++03 to build nouveau?  It would be
>> insane try to do that once GCC 6 is widely available.
>>
>> Rather than see you swimming upstream, I much rather see you helping me
>> helping you to keep nouveau C++11 portable...
>>
>> Jose
>>
>
> FYI, llvm also forces -std=c++11:
>
> $ llvm-config --cxxflags
> -I/usr/lib/llvm-3.6/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
> -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2 -fomit-frame-pointer
> -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC
> -ffunction-sections -fdata-sections -Wcast-qual
>
> and AFAICS configure.ac does not strip it.

$ llvm-config --cxxflags
-I/usr/include  -std=c++11   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

A random (c++) file I picked from a make V=1 compilation:

libtool: compile:  g++ -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_BSWAP32=1
-DHAVE___BUILTIN_BSWAP64=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___BUILTIN_UNREACHABLE=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=1 -DHAVE_SHA1_IN_LIBNETTLE=1 -I.
-I./include -I../../../../src -I../../../../include
-I../../../../src/gallium/include -I../../../../src/gallium/auxiliary
-I../../../../src/gallium/drivers -I../../../../src/gallium/winsys
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE
-DUSE_SSE41 -DDEBUG -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM
-DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP
-DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DHAVE_SHA1
-DGLX_USE_DRM -DHAVE_LIBUDEV -DGLX_INDIRECT_RENDERING
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DHAVE_DRI3 -DHAVE_MINCORE
-DHAVE_ST_VDPAU -DHAVE_LLVM=0x0307 -DMESA_LLVM_VERSION_PATCH=1
-fvisibility=hidden -I/usr/include/libdrm -I/usr/include/libdrm
-I/usr/include/libdrm/nouveau -I/usr/include/libdrm -march=corei7 -O0
-Wall -fno-strict-aliasing -fno-builtin-memcmp -g -MT
codegen/nv50_ir_emit_gk110.lo -MD -MP -MF
codegen/.deps/nv50_ir_emit_gk110.Tpo -c codegen/nv50_ir_emit_gk110.cpp
 -fPIC -DPIC -o codegen/.libs/nv50_ir_emit_gk110.o

Doesn't seem to have -std=c++11 there.

  -ilia


More information about the mesa-dev mailing list