Skip to content

Commit

Permalink
Merge branch 'lukas/erts/fix-thp-options/OTP-19137' into maint
Browse files Browse the repository at this point in the history
* lukas/erts/fix-thp-options/OTP-19137:
  Update configure scripts
  erts: Only use THP options for beam executable
  • Loading branch information
garazdawi committed Jun 20, 2024
2 parents a404b35 + 7119b24 commit c8921cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion erts/configure
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ FLAVORS
PRIMARY_FLAVOR
JIT_ARCH
JIT_ENABLED
EMU_LDFLAGS
M4
LIBRT
BITS64
Expand Down Expand Up @@ -25762,6 +25763,7 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$saved_LDFLAGS"
EMU_LDFLAGS=""
for flag in "-Wl,-z,common-page-size=2097152" "-Wl,-z,max-page-size=2097152"
do
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can add $flag to LDFLAGS" >&5
Expand All @@ -25784,7 +25786,8 @@ then :

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
LDFLAGS="$saved_LDFLAGS $flag"
EMU_LDFLAGS="$flag"
LDFLAGS="$saved_LDFLAGS"

else case e in #(
e)
Expand All @@ -25801,6 +25804,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \
fi




JIT_ENABLED=
FLAVORS="emu jit"
# Enable jit
Expand Down
6 changes: 5 additions & 1 deletion erts/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3071,6 +3071,7 @@ AS_IF([test "x$erts_cv_linux_thp" = "xyes"],
]
)
LDFLAGS="$saved_LDFLAGS"
EMU_LDFLAGS=""
for flag in "-Wl,-z,common-page-size=2097152" "-Wl,-z,max-page-size=2097152"
do
AC_MSG_CHECKING([if we can add $flag to LDFLAGS])
Expand All @@ -3079,7 +3080,8 @@ AS_IF([test "x$erts_cv_linux_thp" = "xyes"],
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[return 0;]])],
[
AC_MSG_RESULT([yes])
LDFLAGS="$saved_LDFLAGS $flag"
EMU_LDFLAGS="$flag"
LDFLAGS="$saved_LDFLAGS"
],
[
AC_MSG_RESULT([no])
Expand All @@ -3088,6 +3090,8 @@ AS_IF([test "x$erts_cv_linux_thp" = "xyes"],
done
])

AC_SUBST(EMU_LDFLAGS)

dnl ----------------------------------------------------------------------
dnl Tests related to configurable options given on command line
dnl (using the --disable, --enable and --with switches).
Expand Down
3 changes: 2 additions & 1 deletion erts/emulator/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ M4FLAGS=
CREATE_DIRS=

LDFLAGS=@LDFLAGS@
EMU_LDFLAGS=@EMU_LDFLAGS@
ARFLAGS=rc
TYPE_LIBS=

Expand Down Expand Up @@ -1261,7 +1262,7 @@ EMU_LD=$(CC)
endif
$(BINDIR)/$(FLAVOR_EXECUTABLE): $(INIT_OBJS) $(OBJS) $(DEPLIBS)
$(ld_verbose) $(EMU_LD) -o $@ \
$(PROFILE_LDFLAGS) $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) \
$(PROFILE_LDFLAGS) $(LDFLAGS) $(EMU_LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) \
$(STATIC_NIF_LIBS) $(STATIC_DRIVER_LIBS) $(LIBS)

endif
Expand Down

0 comments on commit c8921cb

Please sign in to comment.