From nobody Sun Apr 14 17:41:01 2024 X-Original-To: dev-commits-src-all@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 4VHczK5gdJz5Gkvm; Sun, 14 Apr 2024 17:41:01 +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 4VHczK3jyDz4YC8; Sun, 14 Apr 2024 17:41:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713116461; 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=8XmO9mvvp6J1eBMyHNQmv2SyODYcM/ZHuRhgn0BvLEY=; b=rGk5ovjqNWoVDQnY4dV0UMXV5Jiu7fFVpALRzdf6y4B4UqeaZcJrE9XEEVKVbKQdd1xtUs d6CeHnnic3FKMkhBXvIa0ty3vZhIv3X6iBH81EfKo/NofUzF+kk9RCDkj60Y50ghYjkK0I EoSAHOD3y2ivSp76cvxk4Hnq79HdUhiNGakOuJQ3qkK4c/oHnbE0OYAQxx6SMZWOEZ1OkN 6++VGhvw7n8RbIxlqb097ap5A3QdlH7+iO7s1d9BuUe5UenIJREEIoc1P1cPeDtrByVV8J L8+Hp+/K2k4bQX16lhZbNwW+eHNMoSpnpzkLv5+8Ru5ZgwQAGZEEJp+Mn3pjHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713116461; a=rsa-sha256; cv=none; b=l96YGfIjPE5urObqtBkwhCk8MIc0l/9OoNgStz5Eb5nNyEZTjFrJEDzxSCxTMkDA38vdvb 339ebtQ/YvX42ZTdLEb8Kzzk7TQMhgbex8Bmf8EhRxtoCNqKuUOeSK+vYT6VdI8bzwCoKd M4Mf2pTHO65qzUtXlGd9grwxFgWCeOuoCHKtZFRKSfE4dElQ5GODiIEtdHAsNQPUvS1mcI 7PXFk5n6B+RMQDKS9RrNBBuok8E+fE9/AkcgU1vhRyhxFyDVwYIFtXSqnsSGL7ClM9zScU VZApqYb+hYtndBX0v3kVJoSR2qxrP8+P9WChz0bQyaWrzmzrzaE5IbAms3vFkg== 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=1713116461; 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=8XmO9mvvp6J1eBMyHNQmv2SyODYcM/ZHuRhgn0BvLEY=; b=i6M+pHlfO5CfPZDRFxbF3r3zRBTjq/5xtGPXqOoTgpSTfdWKb8Brjdb2gwTLf3EvGg3RjB x32E9ifIEbPUWGXAas5LRX6YVilfZ/Fe5mMWfv9jeWV1/1lQqg5zH44OaWiVjCxuPs94re C59ZhlVi44Xu0wX7YPHa3S7N61K68EB2mksoox5NzKnpwxF8yGzP1J0+/pX3onT4wAavoI xPKwdTPCr5brTzL80O9b9YLBpB97FZvJuQOBXazuH50CtodYD1/OEjzl44T455mYt0UnRU ZRIqTP0lTNmLN4Je10XWHb5HR9YBoHbTpH6Dog5UVPc9DrQx0jmulW2oME8ohQ== 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 4VHczK3KWNzQg6; Sun, 14 Apr 2024 17:41:01 +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 43EHf1s5095502; Sun, 14 Apr 2024 17:41:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43EHf1EB095499; Sun, 14 Apr 2024 17:41:01 GMT (envelope-from git) Date: Sun, 14 Apr 2024 17:41:01 GMT Message-Id: <202404141741.43EHf1EB095499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 8b181c2fbaa8 - main - sanitizers: mark __elf_aux_vector as weak, to allow linking without libsys List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 8b181c2fbaa8c6b32e5510ef6e3a6d364ff4710e Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8b181c2fbaa8c6b32e5510ef6e3a6d364ff4710e commit 8b181c2fbaa8c6b32e5510ef6e3a6d364ff4710e Author: Dimitry Andric AuthorDate: 2024-04-14 17:38:42 +0000 Commit: Dimitry Andric CommitDate: 2024-04-14 17:40:12 +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 --- .../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