[Mesa-dev] [PATCH v4 0/2] build system: Unify c++11 detection and used [was: configure+mesa/st:check -std=c++11 support and enable tests accordingly]
Gert Wollny
gw.fossdev at gmail.com
Sat Oct 14 10:12:56 UTC 2017
Hi Emil,
regarding this patch, I now think we can indeed drop the second part
(the one that adds the g++4.4 test), because it would only check
whether one sets the -std=c++11 flag somewhere accidently. Checking
that no c++11 code makes it into core mesa is already happening as long
as travis uses a pre g++6 compiler.
Considerig the choice between checking for support of the flag
-std=c++11 and checking whether the compiler supports c++11 features by
default the discussion on debian-devel started by this mail
https://lists.debian.org/debian-devel/2017/10/msg00174.html
might be of interest. In short it is preferred that the code is
compiled with the standard the compiler sets by default. From that
point of view the version of the patch that checks for the features
would be better, or I could rework the patch to check whether g++ is
>= 6.0, but that is, of course, not as generic.
Another consideration is that with g++ >= 6 with the current approach
of setting the flags we end up with the somewhat paradox situation
where the "more modern" code requiring -std=c++11 is compiled like
this, but the "older" code is compiled with the default, newer, c++14,
so no setting flags unless it is really needed would IMHO be more
consistent.
Best,
Gert
Am Dienstag, den 03.10.2017, 16:47 +0200 schrieb Gert Wollny:
>
> Following Emils comments I've updated the patches.
>
> Compiling was tested on travis on top of 677edff5cf (wayland-egl:
> rework ...)
> plus the patch "wayland-egl: redistribute wayland.egl.h include"
> proposed by
> Tobias Klausmann: https://travis-ci.org/gerddie/mesa/builds/282591233
> to fix
> some build configurations.
>
> Changes versus v3:
>
> patch 1:
> - use AX_CHECK_COMPILE_FLAG to test for support of -std=c++11, this
> avoids adding a new custom m4 file
> - use if-then tests instead of calling the macro various times
> - remove undocumented changes to .travis.yml
>
> patch 2:
> - use llvm-3.3 when building with g++-4.4 since llvm-3.6 actually
> sets the -std=c++11 flag resulting in build failure with g++4.4 that
> doesn't support this flag.
>
> Regarding adding yet anouther build configuration to travis:
> I propose to add this test, because mesa is supposed to support
> compilers gcc/g++ 4.2, and -std=c++11 was not supported before g++-
> 4.7. Given that g++ >= 6 is now the standard in Debian stable and
> derivatives, and defaults to c++14, developers using these distros
> might not be aware when they add c++11 (or c++14) code.
>
> Changes w.r.t. v2:
> - complete rewrite
>
> best regards,
> Gert
>
> Gert Wollny (2):
> configure+mesa/st: unify check for -std=c++11 support and enable
> accordingly
> travis: Add test for gcc-4.4 compiler tool chain
>
> .travis.yml | 31
> +++++++++++++++++++++++++++
> configure.ac | 18 ++++++++++------
> src/gallium/drivers/swr/Makefile.am | 4 ++--
> src/gallium/state_trackers/clover/Makefile.am | 6 +++---
> src/mesa/state_tracker/tests/Makefile.am | 7 +++++-
> 5 files changed, 54 insertions(+), 12 deletions(-)
>
More information about the mesa-dev
mailing list