Date: Mon, 22 Apr 2019 21:24:09 +0000 (UTC) From: Enji Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r346583 - projects/runtime-coverage-v2/share/mk Message-ID: <201904222124.x3MLO9EE066101@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Mon Apr 22 21:24:08 2019 New Revision: 346583 URL: https://svnweb.freebsd.org/changeset/base/346583 Log: Add `coverage` to *COMPILER_FEATURES variable to bsd.compiler.mk and test for it Testing for this value is better than testing for a C++11 capable compiler, COMPILER_TYPE == clang, etc. While here, add checks to bsd.lib.mk and bsd.prog.mk to force coverage support off if not using a coverage capable toolchain. Modified: projects/runtime-coverage-v2/share/mk/bsd.compiler.mk projects/runtime-coverage-v2/share/mk/bsd.lib.mk projects/runtime-coverage-v2/share/mk/bsd.prog.mk projects/runtime-coverage-v2/share/mk/src.opts.mk Modified: projects/runtime-coverage-v2/share/mk/bsd.compiler.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.compiler.mk Mon Apr 22 19:55:47 2019 (r346582) +++ projects/runtime-coverage-v2/share/mk/bsd.compiler.mk Mon Apr 22 21:24:08 2019 (r346583) @@ -200,11 +200,15 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif ${X_}COMPILER_FEATURES= -.if ${${X_}COMPILER_TYPE} == "clang" || \ - (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) +.if ${${X_}COMPILER_TYPE} == "clang" ${X_}COMPILER_FEATURES+= c++11 .endif +.if ${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) +${X_}COMPILER_FEATURES+= c++11 +${X_}COMPILER_FEATURES+= coverage +.endif .if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +${X_}COMPILER_FEATURES+= coverage ${X_}COMPILER_FEATURES+= retpoline .endif Modified: projects/runtime-coverage-v2/share/mk/bsd.lib.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.lib.mk Mon Apr 22 19:55:47 2019 (r346582) +++ projects/runtime-coverage-v2/share/mk/bsd.lib.mk Mon Apr 22 21:24:08 2019 (r346583) @@ -5,6 +5,11 @@ .include <bsd.init.mk> .include <bsd.compiler.mk> +# TODO: this shouldn't be here. +.if !${COMPILER_FEATURES:Mcoverage} +MK_COVERAGE:= no +.endif + .if defined(LIB_CXX) || defined(SHLIB_CXX) _LD= ${CXX} .else Modified: projects/runtime-coverage-v2/share/mk/bsd.prog.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.prog.mk Mon Apr 22 19:55:47 2019 (r346582) +++ projects/runtime-coverage-v2/share/mk/bsd.prog.mk Mon Apr 22 21:24:08 2019 (r346583) @@ -4,6 +4,11 @@ .include <bsd.init.mk> .include <bsd.compiler.mk> +# TODO: this shouldn't be here. +.if !${COMPILER_FEATURES:Mcoverage} +MK_COVERAGE:= no +.endif + .SUFFIXES: .out .o .bc .c .cc .cpp .cxx .C .m .y .l .ll .ln .s .S .asm # XXX The use of COPTS in modern makefiles is discouraged. Modified: projects/runtime-coverage-v2/share/mk/src.opts.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/src.opts.mk Mon Apr 22 19:55:47 2019 (r346582) +++ projects/runtime-coverage-v2/share/mk/src.opts.mk Mon Apr 22 21:24:08 2019 (r346583) @@ -407,7 +407,7 @@ __DEFAULT_YES_OPTIONS+=OPENMP __DEFAULT_NO_OPTIONS+=OPENMP .endif -.if ${COMPILER_TYPE} != "clang" +.if !${COMPILER_FEATURES:Mcoverage} BROKEN_OPTIONS+=COVERAGE BROKEN_OPTIONS+=COVERAGE_SUPPORT .endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904222124.x3MLO9EE066101>