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

From: Paul Eggert <[email-masked]>
Date: Mon, 15 Feb 2016 00:17:16 -0800

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:

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?

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?