#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)
Change History (9)
by , 15 years ago
Attachment: | make_bug_tools_workaround.patch added |
---|
comment:1 by , 15 years ago
comment:2 by , 15 years ago
(And out of curiosity, which system are you trying to compile on that still has GNU Make 3.80?)
comment:4 by , 15 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 , 11 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 , 9 years ago
Owner: | set to |
---|---|
Resolution: | → outdated |
Status: | new → closed |
comment:8 by , 6 years ago
Component: | → Tools |
---|
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.