From owner-dev-commits-src-all@freebsd.org Mon Aug 2 15:03:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69E69675DEA; Mon, 2 Aug 2021 15:03:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gdh8V2QVTz4YHs; Mon, 2 Aug 2021 15:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3107E21B70; Mon, 2 Aug 2021 15:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 172F3MIl071024; Mon, 2 Aug 2021 15:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 172F3M4S071023; Mon, 2 Aug 2021 15:03:22 GMT (envelope-from git) Date: Mon, 2 Aug 2021 15:03:22 GMT Message-Id: <202108021503.172F3M4S071023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 17d6371e4c85 - main - Fix GCC and -DWITH_CLEAN build after 7bc797e3f3807660cf98e5b1bd63545cafe820f8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17d6371e4c85ca5952118203676cbd764db2b209 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2021 15:03:22 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=17d6371e4c85ca5952118203676cbd764db2b209 commit 17d6371e4c85ca5952118203676cbd764db2b209 Author: Alex Richardson AuthorDate: 2021-08-02 15:01:30 +0000 Commit: Alex Richardson CommitDate: 2021-08-02 15:03:05 +0000 Fix GCC and -DWITH_CLEAN build after 7bc797e3f3807660cf98e5b1bd63545cafe820f8 Reported by: kib --- lib/libclang_rt/compiler-rt-vars.mk | 7 +++++-- share/mk/bsd.sanitizer.mk | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/libclang_rt/compiler-rt-vars.mk b/lib/libclang_rt/compiler-rt-vars.mk index 974a553e379c..c270009e5d50 100644 --- a/lib/libclang_rt/compiler-rt-vars.mk +++ b/lib/libclang_rt/compiler-rt-vars.mk @@ -15,10 +15,13 @@ CRTARCH?= ${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/} # The only way to set the path to the sanitizer libraries with clang is to # override the resource directory. # Note: lib/freebsd is automatically appended to the -resource-dir value. -SANITIZER_LDFLAGS= -resource-dir=${SYSROOT}${CLANGDIR} +SANITIZER_LDFLAGS+= -resource-dir=${SYSROOT}${CLANGDIR} # Also set RPATH to ensure that the dynamically linked runtime libs are found. SANITIZER_LDFLAGS+= -Wl,--enable-new-dtags SANITIZER_LDFLAGS+= -Wl,-rpath,${SANITIZER_LIBDIR} -.else +.elif ${COMPILER_TYPE} != "none" +# This file can be included with COMPILER_TYPE=none during the cleandir phase, +# only emit an error when trying to compile with an unsupported compiler such +# as GCC. .error "Unknown link flags for -fsanitize=... COMPILER_TYPE=${COMPILER_TYPE}" .endif diff --git a/share/mk/bsd.sanitizer.mk b/share/mk/bsd.sanitizer.mk index 56d010767906..567b1da2afde 100644 --- a/share/mk/bsd.sanitizer.mk +++ b/share/mk/bsd.sanitizer.mk @@ -1,6 +1,5 @@ .include -.include "../../lib/libclang_rt/compiler-rt-vars.mk" _use_sanitizers= no # Add the necessary sanitizer flags if requested .if ${MK_ASAN} == "yes" && ${NO_SHARED:Uno:tl} == "no" @@ -23,7 +22,7 @@ SANITIZER_LDFLAGS+= -fsanitize=undefined _use_sanitizers= yes .endif # ${MK_UBSAN} == "yes" -.if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != 0 && \ +.if !defined(BOOTSTRAPPING) && ${_use_sanitizers} != "no" && \ ${COMPILER_TYPE} != "clang" .error "Sanitizer instrumentation currently only supported with clang" .endif @@ -32,6 +31,7 @@ _use_sanitizers= yes # SHARED_CFLAGS instead of CFLAGS. We do this since static executables are not # compatible with the santizers (interceptors do not work). .if ${_use_sanitizers} != "no" +.include "../../lib/libclang_rt/compiler-rt-vars.mk" .if target(____) SHARED_CFLAGS+= ${SANITIZER_CFLAGS} SOLINKOPTS+= ${SANITIZER_LDFLAGS}