From a33d8b3d5fc38deabd4823eb3aabc0fddca95e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 28 May 2015 12:21:16 +0200 Subject: Makefile: Eliminate crash when building with native libs When building with --enable-native-libs and allowing 'make' to use multiple threads, the compiler would crash because the erl_syntax module was missing. Here is the recipe for making it crash on my computer: git clean -dxfq MAKEFLAGS='-j10' ./otp_build setup -a --enable-native-libs What would happen is that when merl_transform was used to compile itself, it would call 'merl' which in turn would call erl_syntax and erl_syntax_lib. Since those modules were not listed as dependencies, there was no guarantee that they had actually been compiled. In fact, erl_syntax is a large module so a compilation it with +native would usually not finish before it was needed for compiling merl_transform. To ensure that the erl_syntax and erl_syntax_lib modules are available when needed, they must be explicitly listed as dependencies. --- lib/syntax_tools/src/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/syntax_tools') diff --git a/lib/syntax_tools/src/Makefile b/lib/syntax_tools/src/Makefile index 2c565cee7f..2e91adf8af 100644 --- a/lib/syntax_tools/src/Makefile +++ b/lib/syntax_tools/src/Makefile @@ -75,7 +75,8 @@ $(EBIN)/%.$(EMULATOR):%.erl # special rules and dependencies to apply the transform to itself $(EBIN)/merl_transform.beam: $(EBIN)/merl.beam ./merl_transform.beam \ - ../include/merl.hrl + ../include/merl.hrl \ + $(EBIN)/erl_syntax.beam $(EBIN)/erl_syntax_lib.beam ./merl_transform.beam: ./merl_transform.erl $(EBIN)/merl.beam \ ../include/merl.hrl $(V_ERLC) -DMERL_NO_TRANSFORM $(ERL_COMPILE_FLAGS) -o ./ $< -- cgit v1.2.3