Compiling emacs on Mac OS X

Hi all!

I’m trying to compile emacs on Mac OS X using clang but I may have hit a bug…

clang on linux compiles it well (not exactly the same config, though).

clang on Mac OS X, compiling the console or the Cocoa version always creates a defective temacs (something akin to a “stage 1 emacs”), which always blows up with a Bus Error.

Any clues on how to approach this to find out what the bug is? One ideia (from IRC) was to try compiling only one .c filewith clang… Anyone knows a tool which tests the files one at the time? There are lots of .c linked in temacs…



I suspect track these sorts of problems down by having two build trees, one with clang and one with gcc. You can then copy *.o from gcc into the clang tree, finish building temacs, and then verify it works, if it works, you can then start binary stepping half of the .o files over and so on, until you whittle it down to a single (or a group) of .o files, that must be replaced by the files from gcc, inorder for temacs to work. Usually, this process results in a single file. That .ii is then the testcase. Harder is to describe what about the file is bad. To do that, I'd normally split the file into two bits, one compiled with clang and one compiled with gcc. Again, binary search that code for the code that much be compiled by gcc for temacs to work, then, that cut down bit is the final testcase.


I finally found the file: src/fns.c

I'll try reducing it with delta until I don't have a segfault and ping you back again.

Many thanks :wink: