clang: Enable unwind tables on !amd64

There doesn't seem to be much sense in defaulting "on" unwind tables on
amd64 and not on other arches.  It causes surprising differences between
platforms, such as the PR below.

Prior to this change, FreeBSD inherited the default implementation of the
method from the Gnu.h Generic_Elf => Generic_GCC parent class, which
returned true only for amd64 targets.  Override that and opt on always,
similar to, e.g., NetBSD.

PR:		241562
Reported by:	lwhsu
Reviewed by:	dim
Discussed with:	emaste
MFC after:	I'm not going to, but you should feel free
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D22252
This commit is contained in:
Conrad Meyer 2019-11-06 23:44:38 +00:00
parent b0b78eb0f7
commit be8018d788
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=354418
2 changed files with 3 additions and 0 deletions

View File

@ -409,6 +409,8 @@ llvm::ExceptionHandling FreeBSD::GetExceptionModel(const ArgList &Args) const {
bool FreeBSD::HasNativeLLVMSupport() const { return true; }
bool FreeBSD::IsUnwindTablesDefault(const ArgList &Args) const { return true; }
bool FreeBSD::isPIEDefault() const { return getSanitizerArgs().requiresPIE(); }
SanitizerMask FreeBSD::getSupportedSanitizers() const {

View File

@ -67,6 +67,7 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
llvm::ExceptionHandling GetExceptionModel(
const llvm::opt::ArgList &Args) const override;
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
bool isPIEDefault() const override;
SanitizerMask getSupportedSanitizers() const override;
unsigned GetDefaultDwarfVersion() const override;