From owner-svn-src-projects@freebsd.org Thu Aug 6 19:06:00 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09B833A86D2 for ; Thu, 6 Aug 2020 19:06:00 +0000 (UTC) (envelope-from dim@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMyd36SPBz4T7T; Thu, 6 Aug 2020 19:05:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD20BBB2F; Thu, 6 Aug 2020 19:05:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 076J5xb9052401; Thu, 6 Aug 2020 19:05:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 076J5xSt052399; Thu, 6 Aug 2020 19:05:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202008061905.076J5xSt052399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 6 Aug 2020 19:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r363975 - in projects/clang1100-import/contrib/llvm-project: compiler-rt/lib/builtins libunwind/include X-SVN-Group: projects X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in projects/clang1100-import/contrib/llvm-project: compiler-rt/lib/builtins libunwind/include X-SVN-Commit-Revision: 363975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2020 19:06:00 -0000 Author: dim Date: Thu Aug 6 19:05:59 2020 New Revision: 363975 URL: https://svnweb.freebsd.org/changeset/base/363975 Log: 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). Modified: projects/clang1100-import/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c projects/clang1100-import/contrib/llvm-project/libunwind/include/unwind.h Modified: projects/clang1100-import/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c ============================================================================== --- projects/clang1100-import/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c Thu Aug 6 18:17:19 2020 (r363974) +++ projects/clang1100-import/contrib/llvm-project/compiler-rt/lib/builtins/gcc_personality_v0.c Thu Aug 6 19:05:59 2020 (r363975) @@ -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 Modified: projects/clang1100-import/contrib/llvm-project/libunwind/include/unwind.h ============================================================================== --- projects/clang1100-import/contrib/llvm-project/libunwind/include/unwind.h Thu Aug 6 18:17:19 2020 (r363974) +++ projects/clang1100-import/contrib/llvm-project/libunwind/include/unwind.h Thu Aug 6 19:05:59 2020 (r363975) @@ -66,12 +66,16 @@ static const _Unwind_State _US_ACTION_MASK 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*);