From fa7b780cbf179a0d4ca50d0dfbd75e2fc75e53b6 Mon Sep 17 00:00:00 2001 From: Aleksey Vasilenko Date: Fri, 7 Jun 2024 10:48:51 +0300 Subject: [PATCH] erlang: fix mis-detection of transparent hugepages Latest Erlang update incorrectly detects THP as always enabled, which leads to segmentation fault on systems without transparent hugepages. Here we manually override configure flag by checking actual option of target kernel. Signed-off-by: Aleksey Vasilenko --- lang/erlang/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lang/erlang/Makefile b/lang/erlang/Makefile index 80b85df7d4..11f963c2d6 100644 --- a/lang/erlang/Makefile +++ b/lang/erlang/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=erlang PKG_VERSION:=27.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/erlang/otp/releases/download/OTP-$(PKG_VERSION) @@ -23,6 +23,9 @@ PKG_CPE_ID:=cpe:/a:erlang:erlang PKG_BUILD_DEPENDS:=erlang/host openssl PKG_ASLR_PIE:=0 +PKG_CONFIG_DEPENDS:= \ + CONFIG_KERNEL_TRANSPARENT_HUGEPAGE + HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION) @@ -307,9 +310,16 @@ CONFIGURE_ARGS += \ --without-javac \ --enable-dynamic-ssl-lib +## Override incorrect THP detection by configure script +ERTS_THP=no +ifeq ($(CONFIG_KERNEL_TRANSPARENT_HUGEPAGE),y) + ERTS_THP=yes +endif + CONFIGURE_VARS += \ SHLIB_LD="$(TARGET_CC)" \ TARGET_ARCH="$(TARGET_ARCH)" \ + erts_cv_linux_thp=$(ERTS_THP) \ ac_cv_func_mmap_fixed_mapped=yes \ ac_cv_path_WX_CONFIG_PATH=no \ erl_xcomp_getaddrinfo=no \ -- 2.30.2