From owner-svn-src-projects@freebsd.org Wed May 15 04:24:30 2019 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D40515A8294 for ; Wed, 15 May 2019 04:24:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03947717F1; Wed, 15 May 2019 04:24:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDEDD484E; Wed, 15 May 2019 04:24:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4F4OTOG025050; Wed, 15 May 2019 04:24:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4F4OS4L025044; Wed, 15 May 2019 04:24:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905150424.x4F4OS4L025044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Wed, 15 May 2019 04:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r347607 - projects/runtime-coverage-v2/share/mk X-SVN-Group: projects X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: projects/runtime-coverage-v2/share/mk X-SVN-Commit-Revision: 347607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03947717F1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2019 04:24:30 -0000 Author: ngie Date: Wed May 15 04:24:28 2019 New Revision: 347607 URL: https://svnweb.freebsd.org/changeset/base/347607 Log: Verify that the linker supports the DWARF v4 spec This change goes one step further in testing for coverage support by ensuring that the linker is LLD and supports DWARF v4. This is a proper fix for the arm/armv6 case not supporting `--coverage` with bfd. As a side effect, this change intentionally blacklists `--coverage` support with binutils, i.e., the raw gcc toolchain. I will need to figure out what versions of binutils support DWARF v4, etc, then add support for them after verifying that they function with `--coverage`, most likely using an xtoolchain. Modified: projects/runtime-coverage-v2/share/mk/bsd.lib.mk projects/runtime-coverage-v2/share/mk/bsd.linker.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.lib.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.lib.mk Wed May 15 03:39:27 2019 (r347606) +++ projects/runtime-coverage-v2/share/mk/bsd.lib.mk Wed May 15 04:24:28 2019 (r347607) @@ -5,9 +5,10 @@ .include .include -# This forces coverage off if the compiler isn't capable, as src.opts.mk is too -# late sometimes. -.if !${COMPILER_FEATURES:Mcoverage} +# This forces coverage off if the compiler/linker isn't capable, as src.opts.mk +# is not always used in time. +.if !${COMPILER_FEATURES:Mcoverage} && \ + (${LINKER_TYPE} == "lld" && !${LINKER_FEATURES:Mdwarfv4}) MK_COVERAGE:= no .endif Modified: projects/runtime-coverage-v2/share/mk/bsd.linker.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.linker.mk Wed May 15 03:39:27 2019 (r347606) +++ projects/runtime-coverage-v2/share/mk/bsd.linker.mk Wed May 15 04:24:28 2019 (r347607) @@ -13,6 +13,7 @@ # linker support for that feature: # # - build-id: support for generating a Build-ID note +# - dwarfv4: support for DWARF v4 format # - retpoline: support for generating PLT with retpoline speculative # execution vulnerability mitigation # @@ -87,6 +88,7 @@ ${X_}LINKER_FEATURES+= build-id ${X_}LINKER_FEATURES+= ifunc .endif .if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 +${X_}LINKER_FEATURES+= dwarfv4 ${X_}LINKER_FEATURES+= retpoline .endif .endif Modified: projects/runtime-coverage-v2/share/mk/bsd.prog.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/bsd.prog.mk Wed May 15 03:39:27 2019 (r347606) +++ projects/runtime-coverage-v2/share/mk/bsd.prog.mk Wed May 15 04:24:28 2019 (r347607) @@ -4,9 +4,10 @@ .include .include -# This forces coverage off if the compiler isn't capable, as src.opts.mk is too -# late sometimes. -.if !${COMPILER_FEATURES:Mcoverage} +# This forces coverage off if the compiler/linker isn't capable, as src.opts.mk +# is not always used in time. +.if !${COMPILER_FEATURES:Mcoverage} && \ + (${LINKER_TYPE} == "lld" && !${LINKER_FEATURES:Mdwarfv4}) MK_COVERAGE:= no .endif Modified: projects/runtime-coverage-v2/share/mk/src.opts.mk ============================================================================== --- projects/runtime-coverage-v2/share/mk/src.opts.mk Wed May 15 03:39:27 2019 (r347606) +++ projects/runtime-coverage-v2/share/mk/src.opts.mk Wed May 15 04:24:28 2019 (r347607) @@ -318,13 +318,6 @@ __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_C .if ${__T} == "aarch64" || ${__T:Mriscv*} != "" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB .endif -# --coverage support does not work on arm/armv6 because LLD/LLVM is disabled on -# these platforms by default, and the binutils in base lacks DWARF v4 support. -# -# Force support off. -.if ${__T} == "arm" || ${__T} == "armv6" -BROKEN_OPTIONS+=COVERAGE COVERAGE_SUPPORT -.endif .if ${__T:Mriscv*} != "" BROKEN_OPTIONS+=OFED .endif