diff options
author | Björn Gustavsson <[email protected]> | 2015-05-28 12:21:16 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-05-28 15:03:10 +0200 |
commit | a33d8b3d5fc38deabd4823eb3aabc0fddca95e33 (patch) | |
tree | e515a73edf9738a2793c5c357443bc84b3fd5189 | |
parent | 2925fbba49237ff6b6e2691f52c4afb2c0447e46 (diff) | |
download | otp-a33d8b3d5fc38deabd4823eb3aabc0fddca95e33.tar.gz otp-a33d8b3d5fc38deabd4823eb3aabc0fddca95e33.tar.bz2 otp-a33d8b3d5fc38deabd4823eb3aabc0fddca95e33.zip |
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.
-rw-r--r-- | lib/syntax_tools/src/Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
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 ./ $< |