Opened 14 years ago

Closed 8 years ago

Last modified 5 years ago

#9133 closed patch (outdated)

Tools: workaround for make 3.80 bug

Reported by: criezy Owned by: sev-
Priority: normal Component: Tools
Version: Keywords:
Cc: Game:

Description

The tools fail to build with make 3.80 because it triggers a "virtual memory exhausted" error. This is a known bug triggered by $(eval $foo) when $foo is too long.

In that case the bug is triggered by the code on line 240 of Makefile.common: $(foreach prog,$(PROGRAMS),$(eval $(call PROGRAM_template,$(prog))))

It creates the build and clean rules for each executable using the PROGRAM_template template.

The attached patch work around the make 3.80 bug by explicitly defining the rules for several executable instead of using the template. These executables have a lot of object files and this triggers the bug.

I am not sure this patch should be committed as it seems a bad hack that makes the Makefile.common file heavier and less easy to maintain. But in case somebody wants to compile the tools with make 3.80, the patch is at least in the tracker now.

Ticket imported from: #2929000. Ticket imported from: patches/1238.

Attachments (1)

make_bug_tools_workaround.patch (1.8 KB ) - added by criezy 14 years ago.

Download all attachments as: .zip

Change History (9)

by criezy, 14 years ago

comment:1 by fingolfin, 14 years ago

I don't want to commit this, for exactly the reasons Thierry stated, but also for the same reasons, I guess we can leave this open for now.

It might be best to add a comment to the Makefile pointing to this tracker item. Hm, and can one check for the Make version in a Makefile? Then we could even print an error when GNU Make 3.80 is being used, indicating that it won't work.

comment:2 by fingolfin, 14 years ago

(And out of curiosity, which system are you trying to compile on that still has GNU Make 3.80?)

comment:3 by criezy, 14 years ago

By default MacOS X 10.4.11 is shipped with that version of make.

comment:4 by sev-, 14 years ago

I would try to detect make version in our configure and provide some info on how to workaround the bug or update the tool.

comment:5 by digitall, 10 years ago

I think others had issues here as I found the following code in a makefile to switch behaviour based on the make version for v3.81 or higher: https://lists.gnu.org/archive/html/help-make/2006-04/msg00065.html

ifeq (3.81,$(firstword $(sort $(MAKE_VERSION) 3.81)))
    # stuff that requires make-3.81 or higher
endif

comment:6 by sev-, 8 years ago

Owner: set to sev-
Resolution: outdated
Status: newclosed

comment:7 by sev-, 8 years ago

3.80 is very old now. So closing this.

comment:8 by digitall, 5 years ago

Component: Tools
Note: See TracTickets for help on using tickets.