From owner-svn-src-head@freebsd.org Fri Nov 29 07:16:38 2019 Return-Path: Delivered-To: svn-src-head@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 0CC221C666A; Fri, 29 Nov 2019 07:16:38 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PQmP0SRdz4ZGP; Fri, 29 Nov 2019 07:16:36 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-wr1-x433.google.com with SMTP id z3so33716439wru.3; Thu, 28 Nov 2019 23:16:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XxeM5OPYxgpxW10XRqN0eO1gnyk/ejyjBsVnCDkSgBU=; b=cwDlKCH6E2f2LD28gaNTvUpmIupfU7AOcMQ2JeHWbVk3UQuKBjFJJujoj8iUg0wPb6 z148HiRNvj+v+fGJ18O6LyrJAX5dv3fyB3bllv4zQmZXBOSOYAv5/YX9HBk5XFAEA++5 oubw28Oxe8SVKNWYSeG9m++6vK4qeOFu51LD8ER3kSc+B9l3DqFtm03AqVnFr8sIqzfQ J8fMZK6sbZ4aD1jIlBq/fulPtR0XGenuuvKiF5n8zqkYRUgollE5uWIUhZgmy0BUqiYu Z2N5tjyfAhRqdbdCsXmxqLUYn49rgJQUvKa3jKybvqduOXadj2u/IsfyGHtgT7Mlzgu2 DosA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=XxeM5OPYxgpxW10XRqN0eO1gnyk/ejyjBsVnCDkSgBU=; b=F32qTB9hNQPf+5dxe3gJzJN2Rbs0Dal5Y3dFy0g2hZn9O47uE3L+s89cJdI0ZFTCu2 MykurCGNlBuhUD+0GM5kmBb5y107BIlmcKvGe8RhyLndVl9x2JYdHtkJHAwSGPI/f7yi hhxdW5FDOu+ArZkEzXc5Ytea8DJVe/bNrwop4112UNEpxUheGV+STl/mjao28JtSIQNc rkgiEd5+PBuKhJ8qc2Qe+hRLr8OiAOUyQiDxnG4loJUQEOQW+BVGD/lWP2wk++Uus8oF 76UInI+8IROk+USAmqSWss/gXpJXGvkn1r95//taSyq29KVVJUXi0IGaS7UVh49d6gJv 10tw== X-Gm-Message-State: APjAAAXQbMDfJi+ku+VsYwYqox8Mcf7Niexutj75ga6ULJFXqWo0R8FD ZkOgWUQCgZ6F2YUceCiBjuLQstlisHo= X-Google-Smtp-Source: APXvYqxB/KaZI3yo6mmeWD65Xdb0v8UpAlopU4kL/l6cuOZ54AwIAp1kV77K37KWITiv1OVYrSUIxg== X-Received: by 2002:a5d:6b4d:: with SMTP id x13mr49788595wrw.96.1575011794915; Thu, 28 Nov 2019 23:16:34 -0800 (PST) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id s8sm25921807wrt.57.2019.11.28.23.16.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Nov 2019 23:16:34 -0800 (PST) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r354347 - in head: contrib/compiler-rt/lib/builtins contrib/libunwind/include lib/libcompiler_rt lib/libgcc_s lib/libgcc_s/arm To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201911050320.xA53Keqi072895@repo.freebsd.org> From: Michal Meloun Message-ID: <398883fa-121e-9637-77a2-ee34e2b62609@gmail.com> Date: Fri, 29 Nov 2019 08:16:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <201911050320.xA53Keqi072895@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47PQmP0SRdz4ZGP X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=cwDlKCH6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::433 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[meloun.michal@gmail.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-9.13), ipnet: 2a00:1450::/32(-2.69), asn: 15169(-1.94), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[3.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2019 07:16:38 -0000 On 05.11.2019 4:20, Conrad Meyer wrote: > Author: cem > Date: Tue Nov 5 03:20:40 2019 > New Revision: 354347 > URL: https://svnweb.freebsd.org/changeset/base/354347 > > Log: > 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). This broke ABI for arm. Unlike of all other platforms, _Unwind_Backtrace should be exported with GCC_4.3.0 version. More over we should also hold GCC_3.3 version for compatibility with FBSD11. Please, see r318024 for more details. Thanks, Michal > > Added: > head/lib/libgcc_s/Symbol.map > - copied, changed from r354346, head/lib/libgcc_s/Version.map > head/lib/libgcc_s/Versions.def (contents, props changed) > head/lib/libgcc_s/arm/ > head/lib/libgcc_s/arm/Symbol.map (contents, props changed) > Deleted: > head/lib/libgcc_s/Version.map > Modified: > head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c > head/contrib/libunwind/include/unwind.h > head/lib/libcompiler_rt/Makefile > head/lib/libgcc_s/Makefile > > Modified: head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c > ============================================================================== > --- head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c Tue Nov 5 02:30:41 2019 (r354346) > +++ head/contrib/compiler-rt/lib/builtins/gcc_personality_v0.c Tue Nov 5 03:20:40 2019 (r354347) > @@ -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: head/contrib/libunwind/include/unwind.h > ============================================================================== > --- head/contrib/libunwind/include/unwind.h Tue Nov 5 02:30:41 2019 (r354346) > +++ head/contrib/libunwind/include/unwind.h Tue Nov 5 03:20:40 2019 (r354347) > @@ -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*); > > > Modified: head/lib/libcompiler_rt/Makefile > ============================================================================== > --- head/lib/libcompiler_rt/Makefile Tue Nov 5 02:30:41 2019 (r354346) > +++ head/lib/libcompiler_rt/Makefile Tue Nov 5 03:20:40 2019 (r354347) > @@ -12,10 +12,6 @@ CFLAGS+= -fvisibility=hidden > CFLAGS+= -DVISIBILITY_HIDDEN > CFLAGS+= -I${SRCTOP}/contrib/libcxxrt > > -.if ${COMPILER_TYPE} == "clang" > -CWARNFLAGS.gcc_personality_v0.c+= -Wno-typedef-redefinition > -.endif > - > # gcc has incompatible internal declarations for __divtc3 and __multc3, but has > # no option to silence its warning, so make warnings non-fatal. > NO_WERROR.gcc= > > Modified: head/lib/libgcc_s/Makefile > ============================================================================== > --- head/lib/libgcc_s/Makefile Tue Nov 5 02:30:41 2019 (r354346) > +++ head/lib/libgcc_s/Makefile Tue Nov 5 03:20:40 2019 (r354347) > @@ -4,12 +4,22 @@ PACKAGE= clibs > SHLIB_NAME= libgcc_s.so.1 > SHLIBDIR?= /lib > > +.include > + > MK_SSP= no > WARNS?= 2 > > LDFLAGS+= -nodefaultlibs > LIBADD+= c > -VERSION_MAP= ${.CURDIR}/Version.map > + > +.if ${MK_SYMVER} == "yes" > +VERSION_DEF= ${.CURDIR}/Versions.def > +SYMBOL_MAPS= ${.CURDIR}/Symbol.map > +# Export ARM AEABI unwind routines needed by libc and libthr. > +.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map) > +SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map > +.endif > +.endif > > .include "../libcompiler_rt/Makefile.inc" > .include "../libgcc_eh/Makefile.inc" > > Copied and modified: head/lib/libgcc_s/Symbol.map (from r354346, head/lib/libgcc_s/Version.map) > ============================================================================== > --- head/lib/libgcc_s/Version.map Tue Nov 5 02:30:41 2019 (r354346, copy source) > +++ head/lib/libgcc_s/Symbol.map Tue Nov 5 03:20:40 2019 (r354347) > @@ -3,7 +3,6 @@ > */ > > GCC_3.0 { > -global: > __absvdi2; > __absvsi2; > __addvdi3; > @@ -84,8 +83,6 @@ global: > _Unwind_Resume; > _Unwind_SetGR; > _Unwind_SetIP; > -local: > - *; > }; > > GCC_3.3 { > @@ -93,11 +90,11 @@ GCC_3.3 { > _Unwind_FindEnclosingFunction; > _Unwind_GetCFA; > _Unwind_Resume_or_Rethrow; > -} GCC_3.0; > +}; > > GCC_3.3.1 { > __gcc_personality_v0; > -} GCC_3.3; > +}; > > GCC_3.4 { > __clzdi2; > @@ -112,11 +109,11 @@ GCC_3.4 { > __popcountdi2; > __popcountsi2; > __popcountti2; > -} GCC_3.3.1; > +}; > > GCC_3.4.2 { > __enable_execute_stack; > -} GCC_3.4; > +}; > > GCC_3.4.4 { > __absvti2; > @@ -124,7 +121,7 @@ GCC_3.4.4 { > __mulvti3; > __negvti2; > __subvti3; > -} GCC_3.4.2; > +}; > > GCC_4.0.0 { > __divdc3; > @@ -136,7 +133,7 @@ GCC_4.0.0 { > __powidf2; > __powisf2; > __powixf2; > -} GCC_3.4.4; > +}; > > GCC_4.2.0 { > __floatundidf; > @@ -146,9 +143,9 @@ GCC_4.2.0 { > __floatuntisf; > __floatuntixf; > _Unwind_GetIPInfo; > -} GCC_4.0.0; > +}; > > GCC_4.3.0 { > __bswapdi2; > __bswapsi2; > -} GCC_4.2.0; > +}; > > Added: head/lib/libgcc_s/Versions.def > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libgcc_s/Versions.def Tue Nov 5 03:20:40 2019 (r354347) > @@ -0,0 +1,31 @@ > +# $FreeBSD$ > + > +GCC_3.0 { > +}; > + > +GCC_3.3 { > +} GCC_3.0; > + > +GCC_3.3.1 { > +} GCC_3.3; > + > +GCC_3.4 { > +} GCC_3.3.1; > + > +GCC_3.4.2 { > +} GCC_3.4; > + > +GCC_3.4.4 { > +} GCC_3.4.2; > + > +GCC_3.5 { > +} GCC_3.4.4; > + > +GCC_4.0.0 { > +} GCC_3.5; > + > +GCC_4.2.0 { > +} GCC_4.0.0; > + > +GCC_4.3.0 { > +} GCC_4.2.0; > > Added: head/lib/libgcc_s/arm/Symbol.map > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libgcc_s/arm/Symbol.map Tue Nov 5 03:20:40 2019 (r354347) > @@ -0,0 +1,12 @@ > +/* > + * $FreeBSD$ > + */ > + > +GCC_3.5 { > + _Unwind_VRS_Get; > + _Unwind_VRS_Set; > + __aeabi_unwind_cpp_pr0; > + __aeabi_unwind_cpp_pr1; > + __aeabi_unwind_cpp_pr2; > + __gnu_unwind_frame; > +}; >