From nobody Sat Nov 26 15:04:37 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 4NKFPx57sRz4jYvC; Sat, 26 Nov 2022 15:04:37 +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 4NKFPx4bYPz3mlV; Sat, 26 Nov 2022 15:04:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669475077; 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=W/C8+8KPDEFXUahQxyM5CTFZI0cGtoiHgDc5dgYELcQ=; b=fRd/1H2dQBq9zLU1JHDHZ+b+yHFxT4xrkqkxTCcWS8p6QX9oXl7CAnTYpptnZINYCMO8Qv NwXCj8uUZVj81q1L9lSVA6PhFYD50jRbMx6FCXRPM0znqHq+MBIzvvwxIGFbxoHowBaM98 1xOgVtissCblWvxEsthrC0J8ae1+l0/HnsdTkbCeJBpD2YodeZHkLlSJ0TBKYtk2KPRpBN P5ZvjwgeYa8XaVW/Xyue77EenAacw78kmNhdcIFRbF0s7D0SygYkGcHQfPDrc5VFEyZH00 JU6oX5hRodQ+HEIAGgBLEslz6u465sYVH9tFZTxwR50CnvG0sW661TS4MjlUNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669475077; 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=W/C8+8KPDEFXUahQxyM5CTFZI0cGtoiHgDc5dgYELcQ=; b=Ssvc13uHVELvIBr3RxKv9DiU7p3L5POa2+kfgG9fnaEEF4VcXq86PrALt2DUhNY31nLqRt KGNb7Bk2w9gJzOzzfxkieV19NJXmZJHH83IzzkzFrdfuRdXyQr6efWUjSQe0vXvBaMoVO+ 8Wi6xE5EGYVDuw0huVMyNwSnFXUFRkcJr7VBeJlkHrOG3IiYxccNBFziVItn8FF3sufMZQ znoNo5viS1Bb2P9wrXJcxXHQag9gDdaGVjdzMoqA/xpxQYrqwT4iZnY1Yd4auAzFqfikZQ LMRhutxkvNDkO6BxH56vEgoiF8DALwHCjQY9ZFS2FjoQYguoMqeC5ijZBbH+wQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669475077; a=rsa-sha256; cv=none; b=Q4aa1ArXLggWY9nDhMk2Vz8SB+F8WSjJlfKxnjRhri6j6eTUDw//KMP2U1b5Z+L0QohOYP t99jgfKli1ZIvbLvmpC+lOg5XPmQPnWGI3CeCk1hjk9zGBFMC4WBOfIOxiGn06pO/Vd4+M BQCmmUgEtKsRgfrHdIuEJyfRubvvmZtabyTR6nreXctQyyeSdWain9NCiHRI9OGieIGlbF UAcSk1FfbFgXc6+T44XJSnKAPoYn3DI3zE4esWpqV8/Yp0EIEOkdHginsTtOy9Goo0SNuf 8s2zxxrDMwjejorQTdbF4Zn+CNCi7lolkJfCTSuhsjxkc0WBQdNW4NxFqFMdbQ== 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 4NKFPx3cgxzP67; Sat, 26 Nov 2022 15:04:37 +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 2AQF4bdo095758; Sat, 26 Nov 2022 15:04:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AQF4bxI095757; Sat, 26 Nov 2022 15:04:37 GMT (envelope-from git) Date: Sat, 26 Nov 2022 15:04:37 GMT Message-Id: <202211261504.2AQF4bxI095757@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: 7375f3899ae9 - main - lang/gcc11-devel: 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: 7375f3899ae994888d48e099476d4a6aabf310b2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/ports/commit/?id=7375f3899ae994888d48e099476d4a6aabf310b2 commit 7375f3899ae994888d48e099476d4a6aabf310b2 Author: Lorenzo Salvadore AuthorDate: 2022-11-23 22:35:46 +0000 Commit: Lorenzo Salvadore CommitDate: 2022-11-26 15:01:55 +0000 lang/gcc11-devel: 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-devel/Makefile | 1 + .../files/patch-libsanitizer_asan_asan__linux.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lang/gcc11-devel/Makefile b/lang/gcc11-devel/Makefile index 3592ae4d1962..cde3eccb4a71 100644 --- a/lang/gcc11-devel/Makefile +++ b/lang/gcc11-devel/Makefile @@ -1,5 +1,6 @@ PORTNAME= gcc PORTVERSION= 11.3.1.s20221118 +PORTREVISION= 1 CATEGORIES= lang MASTER_SITES= GCC/snapshots/${DIST_VERSION} PKGNAMESUFFIX= ${SUFFIX}-devel diff --git a/lang/gcc11-devel/files/patch-libsanitizer_asan_asan__linux.cpp b/lang/gcc11-devel/files/patch-libsanitizer_asan_asan__linux.cpp new file mode 100644 index 000000000000..22630767b114 --- /dev/null +++ b/lang/gcc11-devel/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