fredley
fredley

Reputation: 33861

Why is 'make' failing on Lion?

I'm using make to build a large project on OSX Lion. The scripts worked fine on OSX up to Snow Leopard, but now it fails.

What happens is that after building certain modules, I get an error similar to the following:

touch my.app/Contents/Resources
touch my.app
make[2]: write error
make[1]: *** [all] Error 1
make: *** [all] Error 1

If I then type make again it resumes from where it fails and builds successfully (until it hits another such error). It always happens for the same two modules of the project, and I can't for the life of me work out why.

Please let me know if there's any more information I can provide that would be helpful.

1st Update

Here's the output of make -d:

...
     Finished prerequisites of target file `DesktopConn.o'.
     Prerequisite `DesktopConn.cxx' is older than target `DesktopConn.o'.
    No need to remake target `DesktopConn.o'.
    Considering target file `List.o'.
     Looking for an implicit rule for `List.o'.
     Trying pattern rule with stem `List'.
     Trying implicit prerequisite `/bin/sh: line 1:  6733 Segmentation fault: 11  make all
Reaping losing child 0x102d0ae70 PID 6471 
make[1]: *** [all] Error 1
Removing child 0x102d0ae70 PID 6471 from chain.
Reaping losing child 0x10560ee20 PID 6342 
make: *** [all] Error 1
Removing child 0x10560ee20 PID 6342 from chain.

I've put the whole make -d output (extremely verbose) on pastebin.

2nd Update

I've uploaded the Makefile too.

3rd Update

I've downloaded the source for make, built from source on my machine. It still fails at the same point. I've also tried using the make binary from Snow Leopard.

Upvotes: 13

Views: 1955

Answers (2)

Kyle Jones
Kyle Jones

Reputation: 5532

Try taking the SEGV at face value. make is either dereferencing an out-of-bounds pointer, or trying to write memory somewhere out of bounds, or it is trying to extend the stack beyond the process stack size limit. There's nothing you can do about the first two without debugging GNU make, but you can increase the stack limit. Using bash:

ulimit -s hard

raises the soft limit to the hard limit, giving you as much stack space as possible. Try it and see if make can run to completion without crashing.

Upvotes: 1

Rab
Rab

Reputation: 2836

llvm is the default compiler in Lion, I believe, but was not in previous versions you mentioned. Occam's razor says try it using:

CC=gcc make

Edit: Found this, which I think is related. See answer #1, 3 edits: here. It refers to building Ruby, but I think the underlying issue is the same. It's possible you'll need to download a different version of GCC if this is the issue.

Upvotes: 0

Related Questions