[Bug 267751] lang/gcc*: Address sanitizer isn't properly enabled: ASan runtime does not come first in initial library list

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 13 Jan 2024 08:19:32 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267751

--- Comment #28 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/ports/commit/?id=11e18f525a8390fda31c44838bde003e23176b95

commit 11e18f525a8390fda31c44838bde003e23176b95
Author:     Lorenzo Salvadore <salvadore@FreeBSD.org>
AuthorDate: 2024-01-12 14:34:58 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2024-01-13 08:18:34 +0000

    lang/gcc13: 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.

    To successfully run the software compiled with -fsanitize=address it is
    still necessary to disable ASLR.

    PR:             267751
    Reported by:    yuri

    Co-authored-by: Andreas Tobler <andreast@gcc.gnu.org>

 lang/gcc13/Makefile                                |  2 +-
 .../patch-libsanitizer_asan_asan__linux.cpp (new)  | 23 ++++++++++++++++++++++
 .../patch-libsanitizer_asan_asan__thread.cpp (new) | 13 ++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.