Skip to content

Commit

Permalink
Use erlang halt vs init stop in Makefile
Browse files Browse the repository at this point in the history
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 erlang/otp#6916 for details
  • Loading branch information
feng19 authored Apr 18, 2024
1 parent 224c0f1 commit 1eb5d28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -64,4 +64,4 @@ _build/:
mkdir -p "$@"

$(BASEDIR)/priv/:
mkdir -p "$@"
mkdir -p "$@"

0 comments on commit 1eb5d28

Please sign in to comment.