From 1eb5d287ee6af7b3738d4b7c9a0b9c789bb6b4b3 Mon Sep 17 00:00:00 2001 From: Kevin Pan Date: Thu, 18 Apr 2024 22:44:00 +0800 Subject: [PATCH] Use erlang halt vs init stop in Makefile In Erlang/OTP 26 a race condition was uncovered when using `-eval` with `-s init stop` (i.e., it was always there, but most of the community lucked out in not running into it). See https://github.com/erlang/otp/issues/6916 for details --- c_src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c_src/Makefile b/c_src/Makefile index f159e48..d28e4c5 100644 --- a/c_src/Makefile +++ b/c_src/Makefile @@ -20,7 +20,7 @@ endif # Project specific C compiler/flags. ifeq ($(ERTS_INCLUDE_DIR),) - ERTS_INCLUDE_DIR := $(shell "$(ERL)" -noshell -s init stop -eval "io:format(\"~ts/erts-~ts/include/\", [code:root_dir(), erlang:system_info(version)]).") + ERTS_INCLUDE_DIR := $(shell "$(ERL)" -noshell -eval "io:format(\"~ts/erts-~ts/include/\", [code:root_dir(), erlang:system_info(version)])." -s erlang halt) endif CFLAGS += -std=c11 -fPIC -I $(ERTS_INCLUDE_DIR) @@ -64,4 +64,4 @@ _build/: mkdir -p "$@" $(BASEDIR)/priv/: - mkdir -p "$@" \ No newline at end of file + mkdir -p "$@"