Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Dec 2016 23:31:38 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        Ed Maste <emaste@freebsd.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, Dimitry Andric <dim@freebsd.org>
Subject:   Re: WITH_LLVM_LIBUNWIND vs. WITHOUT_LLVM_LIBUNWIND [ WITH_LLVM_LIBUNWIND= based buildworld fails on powerpc64 for TARGET_ARCH=powerpc64 ]
Message-ID:  <09B0D6F7-F2F3-4AA3-9EE6-5D51655549BE@dsl-only.net>
In-Reply-To: <CAPyFy2ArXUYsyTC9LY_CqbU3FLVV0TeV%2BSandqd-SpPGMBL6Cg@mail.gmail.com>
References:  <750FCE4D-F25B-46E1-9383-B8A94AAA8792@dsl-only.net> <CAPyFy2ArXUYsyTC9LY_CqbU3FLVV0TeV%2BSandqd-SpPGMBL6Cg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2016-Nov-29, at 2:56 PM, Ed Maste <emaste at freebsd.org> wrote:

> On 29 November 2016 at 16:46, Mark Millard <markmi at dsl-only.net> wrote:
>> 
>> 
>> Summary: Does using clang 3.9.0 as the system compiler imply one should or
>> must (eventually?) use WITH_LLVM_LIBUNWIND to have C++ exceptions work?
>> 
>> Do WITH_LLVM_LIBUNWIND and WITHOUT_LLVM_LIBUNWIND have the same criteria
>> for what dwarfdump should show for the exception information (if the
>> information to be shown is to be correct/sufficient for libunwind)?
> 
> It does not. It should be possible to build a functional system both
> WITH_ and WITHOUT_LLVM_LIBUNWIND. The compiler is unaware of the
> _LLVM_LIBUNWIND setting. Both unwind libraries use the same unwind
> data.
> 
> Eventually new features may show up in Clang and LLVM's libunwind (and
> new versions of GNU's unwinder) that won't work with the old unwinder.
> 
>> Your answer's detail might indicate that I've misdirected the llvm folks
>> in submittals like  https://llvm.org/bugs/show_bug.cgi?id=26844 .
>> 
>> There is also the question of if/when llvm's libunwind is ready to be used
>> for powerpc64 or powerpc (or . . .) if there are architecture specifics
>> involved. That answer might determine when C++ exceptions work (and so
>> when devel/kyua might have a chance to work) and is sort of separate from
>> the main question here but is still of interest overall.
>> 
>> Should powerpc64 and powerpc clang 3.9.0 testing be using
>> WITH_LLVM_LIBUNWIND ? WITHOUT_LLVM_LIBUNWIND ? Both?
> 
> For testing I think WITH_LLVM_LIBUNWIND is the interesting case. My
> eventual goal is to have a functioning Clang, LLD, LLDB, libunwind,
> and ELF Tool Chain on all of our supported architectures.

I tried adding WITH_LLVM_LIBUNWIND= to the SRC_CONF_ENV file that I
use on powerpc64 for TARGET_ARCH=powerpc64 for (a minor variation of)
head -r309179 based on clang 3.9.0. It failed to complete buildworld:

A) An assert failed in libunwind/src/UnwindCursor.hpp .

B) Two .S files got massive numbers of error messages
   ( libgcc_eh/UnwindRegisterRestore.S and
     libgcc_eh/UnwindRegisterSave.S )

And those points stopped the build.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215039


Note: using WITHOUT_LLVM_LIBUNWIND= (implicit) I've done 
buildworld using WITH_LIB32= just fine and rebooted with
it installed and then did more buildworld experiments. The
above started from a working environment for such things.

Unfortunately for gcc's libunwind clang's code generation
is broken (counting .eh dwarf information as code). C++
exceptions are one area that does not even do simple
things correctly for powerpc64 (or for powerpc): I have
to avoid using programs that depend on C++ exceptions
happening.

===
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09B0D6F7-F2F3-4AA3-9EE6-5D51655549BE>