From nobody Sun Nov 27 10:10:12 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 4NKkqm5VC8z4hSTQ; Sun, 27 Nov 2022 10:10:12 +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 4NKkqm4lwnz4JF5; Sun, 27 Nov 2022 10:10:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669543812; 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=MpDMLJnEwmi496e7ILbdFCj27QuAX30bCOq06B89sfo=; b=oBsdZKWo0Z85hKf6NkJLpnaHrmIehs10EARfPW8U3qYoYeFWptIbBx48f0r3kQLqNAGrnz HTAXOJa3H69Is+gMJ0RT2SSQ5NyXrCKlsfVS+FdjzM/Zh90AgTqVco7hBwtYjv2D9cbZaH zxZXgvFMni4gOZVM/F3qVCKWDoLfcRV+qUvrYbb0BlFxPfI8OErSkeXrwZ1shHPSFTCXqD NLGgbjySl9dQrDhRclAqtJRH92I8lWZssvmpHhtW/n5FJaJjF5lwfORjP+eAKU8JQ3Rs3g WvYX9xX8/xzVm1FtsiuJxl//00LYuUTUD0HsCXccj1hRLnVxyzyNqdu7cf8FrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669543812; 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=MpDMLJnEwmi496e7ILbdFCj27QuAX30bCOq06B89sfo=; b=x3oC+zLceiq3ZnbBwcprqSd6OWj4SOwahjeAoRRQ6wYybIYX1lM6icar0iVpDVV0FnNgfB K9dt2W5fqLgnU84L0t5j7jo86B4+A+klU8xse6+Y95K9KF2pi8B3YU8T6jZXM14elcK+yy mRmeBMYLk7Y3X9xgzEpMZmcmingEjKBMqz8yoTlHthB9ONLLvDZto6FxjKnTgbOQfdcnin +AAvWVxnuifp5ag0iOW6poWcZI4DQ/bGA2jY4HQ2pU/lDMKAFeYnAq/tc6jvKqJxbHYpTz TX0C+Mg3ONMTX7EOM/NsRQdwUpR6pKpRb/hA1MXzKQjHfjaf1wqKc2F8Gys9HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669543812; a=rsa-sha256; cv=none; b=NSl29aU7VE5gjJgVgI6TS5vCjJNqITyLTX85QPxUivz6dZGhwlybPmXx7ewhBwDc2ckBw9 ajWIBizz7QPwAqnu4KWosYWvSROfGWItwXCQTvSQb2RoqeIh3xSFouTDMMCmnagkXN69Ql soZGd60fAnGuTY9DThDMsZKHiHJcTjJKStEDg124UkJOqvq1QBYPSRYNZfcjB5Px3bVfiy VE93B7A/x0Vi6D54Vyd57Abx2ndXp3bckDJ45h/bJbycpPQP5P6WRQAxElq4DJfDmQMoCg f0ks62PQny+2yX3kx2irekxVKPfApgFWKTYR3WUdrlYqsCel7qvPyJr7+DaIKA== 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 4NKkqm3hlsztTZ; Sun, 27 Nov 2022 10:10:12 +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 2ARAACxW019252; Sun, 27 Nov 2022 10:10:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ARAACrB019245; Sun, 27 Nov 2022 10:10:12 GMT (envelope-from git) Date: Sun, 27 Nov 2022 10:10:12 GMT Message-Id: <202211271010.2ARAACrB019245@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: b185b74b28f8 - main - lang/gcc12-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: b185b74b28f80aa7fbeb4122a326741211af404d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/ports/commit/?id=b185b74b28f80aa7fbeb4122a326741211af404d commit b185b74b28f80aa7fbeb4122a326741211af404d Author: Lorenzo Salvadore AuthorDate: 2022-11-26 20:51:57 +0000 Commit: Lorenzo Salvadore CommitDate: 2022-11-27 10:09:05 +0000 lang/gcc12-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/gcc12-devel/Makefile | 1 + .../files/patch-libsanitizer_asan_asan__linux.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lang/gcc12-devel/Makefile b/lang/gcc12-devel/Makefile index ca72e92e3b87..16e5be795d0f 100644 --- a/lang/gcc12-devel/Makefile +++ b/lang/gcc12-devel/Makefile @@ -1,5 +1,6 @@ PORTNAME= gcc PORTVERSION= 12.2.1.s20221119 +PORTREVISION= 1 CATEGORIES= lang MASTER_SITES= GCC/snapshots/${DIST_VERSION} PKGNAMESUFFIX= ${SUFFIX}-devel diff --git a/lang/gcc12-devel/files/patch-libsanitizer_asan_asan__linux.cpp b/lang/gcc12-devel/files/patch-libsanitizer_asan_asan__linux.cpp new file mode 100644 index 000000000000..22630767b114 --- /dev/null +++ b/lang/gcc12-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