From nobody Wed Dec 22 10:05:42 2021 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 0B63219053AE; Wed, 22 Dec 2021 10:05:49 +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 4JJpqW6byYz4YQ7; Wed, 22 Dec 2021 10:05:43 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3C4731B459; Wed, 22 Dec 2021 10:05:42 +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 1BMA5gJv091706; Wed, 22 Dec 2021 10:05:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BMA5g5g091705; Wed, 22 Dec 2021 10:05:42 GMT (envelope-from git) Date: Wed, 22 Dec 2021 10:05:42 GMT Message-Id: <202112221005.1BMA5g5g091705@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: 26055f17590e - stable/12 - Reapply r354347 (by cem): 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: Sender: owner-dev-commits-src-all@freebsd.org 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 26055f17590e78db47d51bab9798cd7bdeba3b3b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640167546; 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=JigJhrP7M+K56w5kqbhEcSHp+cxElblz1mvkKvZDFF0=; b=W41F4FQVJt1MrvLeWvGtfBh0CRu4/e6FQ2hIxkAEAW/7CCmLkFqQa0C1QP428krsayDuFt QuNYRtQqkCuDLzliSgiqgneiaYpL0yumdmIkpBVfYMNElj27BMVmain9p72JsjxZERXPaa tUbaOLgmYo3RCikU5VU0Pc/TUlPTw8xEWhSpYRJ/haJt6/XPMQ3uU4K/uLLXE9Q7/GHvLg DxfasYpzqW0OWMRtxUJ5eg6yhnNnJ6SwMhPqRWTAqiPBiql7mcEQBBLhEU5s+nWg8IRZPP zhGMvCh5MZQAHCm2rzQGmhOJrp3hFvBmKPBf6iYF3f8w7ZFkhwTMBzBv7clndg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640167546; a=rsa-sha256; cv=none; b=IWpduj5OnHUf78TmIbzKA5k2Vi/4U4qA8FofO84nNLyI1Gw55il2BWDLZQuSQy3smux47J uOmlRiEZfX3yhPwDnrCCjuL6nHfUorXCWJ5HTqD19LO9KuhhJZlbcUtP0OPBEbJrIYfvd0 C/vo4CvfF8M2h5T2G3WmRMDae5UzP8V3rFXITEzBa05pE++InUtTWY2U6Ehcgtf4/2TTvK dLy/jaIyS8/s26pmfPkTzsFcjFhH5NYbRuC6qZ0+wDnNcpVgar0z4DWWi34KVaNCYtrHLa 0yOtvbBNem56KCsMNLTZdHt7urq6O/1Z9BYfPDEH9zDUTkFhlqgLNIKXIgsyzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=26055f17590e78db47d51bab9798cd7bdeba3b3b commit 26055f17590e78db47d51bab9798cd7bdeba3b3b Author: Dimitry Andric AuthorDate: 2020-08-06 19:05:59 +0000 Commit: Dimitry Andric CommitDate: 2021-12-22 09:58:20 +0000 Reapply r354347 (by cem): Fix llvm-libunwind userspace build on ARM GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or EHABI or whatever it's called. Export the same ones from LLVM-libunwind's libgcc_s, on ARM. As part of this, convert libgcc_s from a direct Version.map to one constructed from component Symbol.map files. This allows the ARM-specific Symbol.map to be included only on ARM. Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match non-ARM definitions and ARM-specific expectations in libcxxrt / libcompiler_rt. No functional change intended for non-ARM architectures. This commit does not actually flip the switch for ARM defaults from libgcc to llvm-libunwind, but makes it possible (to compile, anyway). (cherry picked from commit 998a72c55d958bcc1869628318477532dc6e1ffa) --- .../compiler-rt/lib/builtins/gcc_personality_v0.c | 17 ++++++++++++++++- contrib/llvm-project/libunwind/include/unwind.h | 14 +++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c b/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c index d12ee03c49fe..b986bd56943e 100644 --- a/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c +++ b/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c @@ -9,8 +9,23 @@ #include "int_lib.h" #include +/* + * XXX On FreeBSD, this file is compiled into three libraries: + * - libcompiler_rt + * - libgcc_eh + * - libgcc_s + * + * In the former, the include path points to the contrib/libcxxrt/unwind-arm.h + * copy of unwind.h. In the latter, the include path points to the + * contrib/libunwind/include/unwind.h header (LLVM libunwind). + * + * Neither (seemingly redundant) variant of unwind.h needs the redefinitions + * provided in the "helpful" header below, and libcxxrt's unwind-arm.h provides + * *no* useful distinguishing macros, so just forcibly disable the helper + * header on FreeBSD. + */ #if defined(__arm__) && !defined(__ARM_DWARF_EH__) && \ - !defined(__USING_SJLJ_EXCEPTIONS__) + !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__FreeBSD__) // When building with older compilers (e.g. clang <3.9), it is possible that we // have a version of unwind.h which does not provide the EHABI declarations // which are quired for the C personality to conform to the specification. In diff --git a/contrib/llvm-project/libunwind/include/unwind.h b/contrib/llvm-project/libunwind/include/unwind.h index 1d3444cd83b4..3a6cd116d33c 100644 --- a/contrib/llvm-project/libunwind/include/unwind.h +++ b/contrib/llvm-project/libunwind/include/unwind.h @@ -66,12 +66,16 @@ static const _Unwind_State _US_ACTION_MASK = 3; static const _Unwind_State _US_FORCE_UNWIND = 8; typedef uint32_t _Unwind_EHT_Header; +/* + * gcc_personality_v0 references 'struct _Unwind_Exception' all over the place. + * Nothing in libunwind cares about 'struct _Unwind_Control_Block,' so make it + * the alias of struct _Unwind_Exception, instead of the other way around. + */ +struct _Unwind_Exception; +typedef struct _Unwind_Exception _Unwind_Exception; +typedef struct _Unwind_Exception _Unwind_Control_Block; /* Alias */ -struct _Unwind_Control_Block; -typedef struct _Unwind_Control_Block _Unwind_Control_Block; -typedef struct _Unwind_Control_Block _Unwind_Exception; /* Alias */ - -struct _Unwind_Control_Block { +struct _Unwind_Exception { uint64_t exception_class; void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*);