Subject: Re: bug#22065: core dumped during compilation (emacs-25 branch on FreeBSD 9)

From: Joseph Mingrone <[email-masked]>
Date: Mon, 15 Feb 2016 14:51:01 -0400

Paul Eggert <[email-masked]> writes:

> Joseph Mingrone wrote:
>> I'll submit a patch for the FreeBSD port to use clang.

> Hold on a minute. Please don't do that, as Emacs is far more tested on GCC and
> (among other things) GCC has better compile-time checking on Emacs. Instead of
> papering over the bug (if there is a bug), let's fix it.  Here are some points:

Sure.  I'm willing to test further.  I just thought that since 1) clang is the
default compiler in FreeBSD 10+ and 2) if the problem was with the default,
ancient compiler in FreeBSD 9.x, I might be abusing everyone's valuable time.

> 1. I just now booted FreeBSD-9.3-RELEASE-i386 under VirtualBox and verified that
> Emacs dumped core without my recent patch
> <http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=1834ac7d24c60ecabb4fc2469d350a03db1798ab>. I
> also verified that Emacs build and runs fine with the patch. So, if Emacs is
> dumping core for you on FreeBSD 9 i386, there's something different about your
> configuration that is causing the problem. Are you sure you installed the patch
> correctly in your build?

I set the FreeBSD emacs-devel port (FreeBSD package building system) to pull
from commit 44b16f6 and I still see the problem on amd64 (with X), but not on
i386.

> 2. My fix assumes Emacs is built with GCC 4.2.1, the standard GCC on FreeBSD 9
> i386. However, your recent email <http://bugs.gnu.org/22065#22> indicates that
> you're building with GCC 4.8.5. Possibly the problem is due to this compiler or
> its installation. Can you please try building with the standard GCC 4.2.1
> instead?

> 3. Your most recent email says this:

> Message from gcc-4.8.5_2:
> To ensure binaries built with this toolchain find appropriate versions
> of the necessary run-time libraries, you may want to link using

>   -Wl,-rpath=/usr/local/lib/gcc48

> And yet the same email's log says that Emacs was not linked with that
> flag. Perhaps this configuration glitch explains your problem?

The newer GCC was referenced because a dependency required it, however Emacs
itself was built with the default compiler (cc) which is a patched GCC 4.2.1 (as
Wolfgang stated).

Joseph