diff options
author | Frej Drejhammar <frej.drejhammar@gmail.com> | 2021-10-07 10:50:28 +0200 |
---|---|---|
committer | Frej Drejhammar <frej.drejhammar@gmail.com> | 2021-10-07 11:37:31 +0200 |
commit | 04f0aa11e9d47736e5425c4d2cc1f3dd77eda630 (patch) | |
tree | cbbd86d5f17b8707f5e64f5985db70e872b16499 | |
parent | d498586ce33424f667d1dfa1a68455ce219c070f (diff) | |
download | erlang-04f0aa11e9d47736e5425c4d2cc1f3dd77eda630.tar.gz |
Fix race related to precompiled header during compilation
Files matching `erts/emulator/beam/jit/$(JIT_ARCH)/%.cpp` are compiled
with the command line flag `-include $(ASMJIT_PCH_SRC)`, but as there
is no dependency on `$(ASMJIT_PCH_OBJ)` the compilation of the C++
module will race with the precompilation of `$(ASMJIT_PCH_SRC)`. The
missing dependency leads to intermittent build failures as g++ will,
when reading an incomplete precompiled header, abort with `cc1plus:
error: while reading precompiled header: No such file or directory`.
Avoid this race by adding a dependency on `$(ASMJIT_PCH_OBJ)` just as
for files matching `erts/emulator/beam/jit/%.cpp` and
`erts/emulator/asmjit/%.cpp`.
-rw-r--r-- | erts/emulator/Makefile.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index 4a973f8ba2..51b81e4d82 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -930,7 +930,8 @@ $(OBJDIR)/%.o: beam/jit/%.cpp $(ASMJIT_PCH_OBJ) $(subst -O2, $(GEN_OPT_FLGS), $(CXXFLAGS)) \ -include $(ASMJIT_PCH_SRC) -c $< -o $@ -$(OBJDIR)/%.o: beam/jit/$(JIT_ARCH)/%.cpp beam/jit/$(JIT_ARCH)/beam_asm.hpp +$(OBJDIR)/%.o: beam/jit/$(JIT_ARCH)/%.cpp beam/jit/$(JIT_ARCH)/beam_asm.hpp \ + $(ASMJIT_PCH_OBJ) $(V_CXX) $(ASMJIT_FLAGS) $(INCLUDES) \ $(subst -O2, $(GEN_OPT_FLGS), $(CXXFLAGS)) \ -include $(ASMJIT_PCH_SRC) -c $< -o $@ |