From nobody Sat Dec 03 17:24:59 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NPcBg5dkhz4hvCl; Sat, 3 Dec 2022 17:24:59 +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 4NPcBg56d6z44t3; Sat, 3 Dec 2022 17:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670088299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=knvLkcWixN9BonkAeTVNB4KcYveUhht0c6IzRm+rnvI=; b=N/GGK15lxVdqzKHhdNId1euWtDIzdV1l3ps/gv6ZVmeJfKNnP5/tOT9d6bWeVc7DStWUj7 JMSAdcIgh5znYhFqHzJUKagWnnztEWj7YwcrKWwhVxBf5eJ/moKLIhJG+bSN/rZQLGUc+1 3+NygfFyOwm8HwCo+1UtJxjyUgTvlDBxm+6pozPxfZDRblVASQHan9g0M01DY7vXrJfKED VLleVFbiod4DOyV7QD9d7fwbwN43n+irkJCJo2KyPDA4Izsct6gtT0dGxO4vv2oTj9b+Z3 rq2Vw/4ApLDvoutXdwSYmxLDIaHAmDS6wm2OekHnuEttQmRdLKfgQ9HklsEmjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670088299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=knvLkcWixN9BonkAeTVNB4KcYveUhht0c6IzRm+rnvI=; b=SgvvYnO7qwXE1O72A2o/9BVbyGG7+lzhL4LstXyZOWh0m7Q89SccyK8hasIBxNsCL1A7EC 5v0pgasvI6n+LcrXPdky2IpPo34RE+jfbHr4cnOGswMJSG8sGPkJh/N3zxdnw3ndNmNlX0 mxf5KG277NTXKDZ3xzzj9fmPYaLGjLsAE54eIVrCf43ryBzG2HvFcKKFaw8IC5cBymfQ7Y ZaeHm/voeDslkm1Hsf9tYGDNlOE5CbaFhblpfbT7tD+s7iB/gOz6UmTllqMYiFAVpBJlpb N8el68GMmB1Keydhkhwv/uWuTjlpcSG2eEiNJTVdUEC2BbyagDwBM+szArCBPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670088299; a=rsa-sha256; cv=none; b=ZCOmDDNmz95G47at93CqVyGMfDx7BC24lhL6FFTfunKm2pkgarqiHvdGl94iiwiCWFfhnv ZkhIv78o/nFZgUHEXmEApeQXHQ1yf+X19mJw+Vyqi1UMyBjYqkvYzuyp/p3tJYq7nkV2Ss +Kb1jODSf6I+a51IazXW4NSN99MGw6NTTUhiViIHykfiUCgf8MlFiJLkDSBMkM55JtR0Pn q1uTKtDyaj1zgJgxKz0Z8fRSYSgBn3G/ELHNALLDc31OE6Gmglb1LqdvzNAAhnMntg/zCK I0cOt9K+zRdfRBwOkhMoEIa/ysRVAI/+wLcTNWV6HK8J7lCCKTs8q+7+vVMEig== 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 4NPcBg4BGqz13Gg; Sat, 3 Dec 2022 17:24:59 +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 2B3HOx9R021210; Sat, 3 Dec 2022 17:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B3HOxBe021209; Sat, 3 Dec 2022 17:24:59 GMT (envelope-from git) Date: Sat, 3 Dec 2022 17:24:59 GMT Message-Id: <202212031724.2B3HOxBe021209@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Lorenzo Salvadore Subject: git: fb398d22e6fa - main - lang/gcc11: Fix Address sanitizer List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb398d22e6faf020957b45b43c9f6b9450c04cc9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/ports/commit/?id=fb398d22e6faf020957b45b43c9f6b9450c04cc9 commit fb398d22e6faf020957b45b43c9f6b9450c04cc9 Author: Lorenzo Salvadore AuthorDate: 2022-11-26 22:12:09 +0000 Commit: Lorenzo Salvadore CommitDate: 2022-12-03 17:24:10 +0000 lang/gcc11: Fix Address sanitizer Software compiled with -fsanitize=address fails to run with the error message "ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD". This commit fixes the issue by ignoring the [vdso] loaded shared library instead of linux-vdso.so. PR: 267751 Reported by: yuri --- lang/gcc11/Makefile | 2 +- .../files/patch-libsanitizer_asan_asan__linux.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lang/gcc11/Makefile b/lang/gcc11/Makefile index ec35a1af488a..2e9c25e83c4f 100644 --- a/lang/gcc11/Makefile +++ b/lang/gcc11/Makefile @@ -1,6 +1,6 @@ PORTNAME= gcc PORTVERSION= 11.3.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= lang MASTER_SITES= GCC PKGNAMESUFFIX= ${SUFFIX} diff --git a/lang/gcc11/files/patch-libsanitizer_asan_asan__linux.cpp b/lang/gcc11/files/patch-libsanitizer_asan_asan__linux.cpp new file mode 100644 index 000000000000..22630767b114 --- /dev/null +++ b/lang/gcc11/files/patch-libsanitizer_asan_asan__linux.cpp @@ -0,0 +1,18 @@ +Since the vDSO shared librares on Linux and FreeBSD are called +differently, the initialization order check fails on FreeBSD. +This patch fixes it by ignoring [vdso] instead of linux-vdso.so. + +GCC gets the original file from the LLVM Project, so this patch should +probably be upstreamed directly to the LLVM Project rather than to GCC. + +--- libsanitizer/asan/asan_linux.cpp.orig 2022-11-23 10:52:45 UTC ++++ libsanitizer/asan/asan_linux.cpp +@@ -135,7 +135,7 @@ static int FindFirstDSOCallback(struct dl_phdr_info *i + return 0; + + // Ignore vDSO +- if (internal_strncmp(info->dlpi_name, "linux-", sizeof("linux-") - 1) == 0) ++ if (internal_strncmp(info->dlpi_name, "[vdso]", sizeof("[vdso]") - 1) == 0) + return 0; + + #if SANITIZER_FREEBSD || SANITIZER_NETBSD