From nobody Sat Apr 20 10:32:50 2024 X-Original-To: dev-commits-src-branches@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 4VM7BW0tXGz5HW5f; Sat, 20 Apr 2024 10:32:51 +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 4VM7BV69vcz4QK3; Sat, 20 Apr 2024 10:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713609170; 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=Bx64wnSkWwcfFC7v+TO6ghl19jqWg7B2DC8ygvxEb/M=; b=AURd4PGjNHuFTelp+e4Er/u10/1TLbVZyZasNCl/xTGKmBTFROHAz/sfLu9O/S7IjEBN22 OhH2Q3WHUCvHGFOv8QBz62w5WoKzeKZx0rF4T6AbxlJ8xze0sn6xIqMY+BYpHzrsiK6iID YETqMPUi1fM9kkdvuoFLmdeH7gtpaWviQ5SXth3o3SD3Ddob1ldZXuRkg2SC/wfUD32p/r SpU4CpyN1qGkhYNsDHLda2+cUCictFqf730559thiyzs9DFeS9+nQn4rsliVH3xQ6azuT8 CYMpdIOzs8agh+Sxqd/SKSemNnZfjTjqqeqtQc5NpWIag1dGcGSTQtbLszX+lg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713609170; a=rsa-sha256; cv=none; b=sqqYzg80NmaaI2QWHcNC4ukCNIpVGw6EhePP9TSVCMthpeNnTeVwGHVovDvq4LyG0jDidM VQwlFQPobKRPp279VPsIGbxfPky1xPOCLPaWa0LURW3/VFJM7Oo9aW5FKAYFJR7cHKsKo1 8cjVQT8EHxJwFXIpTgrj/oeL/Ui7e1suFBhKIErqYD9OOdslZQVvQXe8CADHJdriVrnbdb Yr5ZDC0Nrg+mt5OtOfU1GT9QsS6M6+P6rElR5Orad9yPfxWPJlTzUxy9M1zdNzO2k7xjlj QsG18XUbwWhs8JedWfIQ+Sn0nx9B2thkBZcsShCycU0RViqutS/UMWDTyaUNhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713609170; 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=Bx64wnSkWwcfFC7v+TO6ghl19jqWg7B2DC8ygvxEb/M=; b=X5JRKna7Onoe3qo9rVt1gFMfkIcMFnUwgAFQe4YyKxW4BZySXOPMPaM9ksqeBhG+0njImd VgOL9ljmNhNfcW0PfjB8SaCgSvck9AbpL2FsJm06uX/Sv8xaux0nDngO9TVj/BZT5FG2wa leqTcsnPtZOGNJpfq3IsDRoW9bMTXqni6k5mAhGXR28p0EOHdFqqXXs2Sv4cFkY1bqrz5T UZ3ZKlb4LDNmBujizo8cvHPPde1jReZOJOxe0fLok6nia2PLdh4bh4YhDdmGnAccU0ayWa m4C4pkWUOOWQI6hRjBg49WgxA9TmJeF6uHA5ho39xkYRRM3A+Hp9edb+BMp6fg== 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 4VM7BV4S8CzYkJ; Sat, 20 Apr 2024 10:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43KAWo2f012058; Sat, 20 Apr 2024 10:32:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43KAWoFL012055; Sat, 20 Apr 2024 10:32:50 GMT (envelope-from git) Date: Sat, 20 Apr 2024 10:32:50 GMT Message-Id: <202404201032.43KAWoFL012055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 18590ac4f035 - stable/14 - sanitizers: mark __elf_aux_vector as weak, to allow linking without libsys List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18590ac4f0355175003baefa711fcb47f041f24e Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=18590ac4f0355175003baefa711fcb47f041f24e commit 18590ac4f0355175003baefa711fcb47f041f24e Author: Dimitry Andric AuthorDate: 2024-04-14 17:38:42 +0000 Commit: Dimitry Andric CommitDate: 2024-04-20 10:03:26 +0000 sanitizers: mark __elf_aux_vector as weak, to allow linking without libsys After libsys was introduced, linking sanitized programs started failing with: # c++ -fsanitize=address main.cc ld: error: undefined symbol: __elf_aux_vector >>> referenced by sanitizer_linux_libcdep.cpp:950 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:950) >>> sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a c++: error: linker command failed with exit code 1 (use -v to see invocation) Mark __elf_aux_vector as weak in the internal sanitizer declaration, so the linker will accept it at link time. The dynamic linker will then take care of the symbol at run time. Suggestion by: brooks PR: 276104, 277393 MFC after: 1 month (cherry picked from commit 8b181c2fbaa8c6b32e5510ef6e3a6d364ff4710e) --- .../compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp index cccbb4d256df..962fff53e447 100644 --- a/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp +++ b/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp @@ -53,7 +53,7 @@ // that, it was never implemented. So just define it to zero. # undef MAP_NORESERVE # define MAP_NORESERVE 0 -extern const Elf_Auxinfo *__elf_aux_vector; +extern const Elf_Auxinfo *__elf_aux_vector __attribute__ ((weak)); # endif # if SANITIZER_NETBSD