Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Oct 17, 2024
2 parents f2d1a69 + 93d04aa commit 9087c4a
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 23 deletions.
15 changes: 10 additions & 5 deletions erts/configure
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ ac_func_c_list=
enable_year2038=yes
ac_subst_vars='LTLIBOBJS
LIBOBJS
DEBUG_CXXFLAGS
DEBUG_CFLAGS
ERL_DETERMINISTIC
CFLAGS32
Expand Down Expand Up @@ -26856,11 +26857,6 @@ fi



printf "%s\n" "#define ERTS_EMU_CMDLINE_FLAGS \"$STATIC_CFLAGS $CFLAGS $DEBUG_CFLAGS $EMU_THR_DEFS $DEFS $WERRORFLAGS $WFLAGS\"" >>confdefs.h







Expand Down Expand Up @@ -26934,6 +26930,15 @@ printf "%s\n" "yes" >&6; }
DEBUG_CFLAGS="-g -O0 $no_opt_CFLAGS"


no_opt_CXXFLAGS=$(echo " $CXXFLAGS" | sed 's/ -O[^ ]*/ /g')
DEBUG_CXXFLAGS="-g -O0 $no_opt_CXXFLAGS"




printf "%s\n" "#define ERTS_EMU_CMDLINE_FLAGS \"$STATIC_CFLAGS $CFLAGS $CXXFLAGS $DEBUG_CFLAGS $DEBUG_CXXFLAGS $EMU_THR_DEFS $DEFS $WERRORFLAGS $WFLAGS\"" >>confdefs.h



ac_config_files="$ac_config_files emulator/$host/Makefile:emulator/Makefile.in epmd/src/$host/Makefile:epmd/src/Makefile.in etc/common/$host/Makefile:etc/common/Makefile.in include/internal/$host/ethread.mk:include/internal/ethread.mk.in include/internal/$host/erts_internal.mk:include/internal/erts_internal.mk.in lib_src/$host/Makefile:lib_src/Makefile.in ../make/$host/otp.mk:../make/otp.mk.in"

Expand Down
26 changes: 15 additions & 11 deletions erts/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3556,17 +3556,6 @@ fi
AC_SUBST(CC32)
AC_SUBST(CFLAGS32)

dnl
dnl ERTS_EMU_CMDLINE_FLAGS will force modification of config.h when
dnl the emulator command line flags are modified by configure, which
dnl in turn will make 'make' detect that files depending on config.h
dnl needs to be rebuilt.
dnl

AC_DEFINE_UNQUOTED(ERTS_EMU_CMDLINE_FLAGS,
"$STATIC_CFLAGS $CFLAGS $DEBUG_CFLAGS $EMU_THR_DEFS $DEFS $WERRORFLAGS $WFLAGS",
[The only reason ERTS_EMU_CMDLINE_FLAGS exists is to force modification of config.h when the emulator command line flags are modified by configure])

AC_SUBST(STATIC_CFLAGS)

dnl ---------------------------------------------------------------------
Expand Down Expand Up @@ -3667,6 +3656,21 @@ AC_MSG_RESULT([yes])
DEBUG_CFLAGS="-g -O0 $no_opt_CFLAGS"
AC_SUBST(DEBUG_CFLAGS)

no_opt_CXXFLAGS=$(echo " $CXXFLAGS" | sed 's/ -O[[^ ]]*/ /g')
DEBUG_CXXFLAGS="-g -O0 $no_opt_CXXFLAGS"
AC_SUBST(DEBUG_CXXFLAGS)

dnl
dnl ERTS_EMU_CMDLINE_FLAGS will force modification of config.h when
dnl the emulator command line flags are modified by configure, which
dnl in turn will make 'make' detect that files depending on config.h
dnl needs to be rebuilt.
dnl

AC_DEFINE_UNQUOTED(ERTS_EMU_CMDLINE_FLAGS,
"$STATIC_CFLAGS $CFLAGS $CXXFLAGS $DEBUG_CFLAGS $DEBUG_CXXFLAGS $EMU_THR_DEFS $DEFS $WERRORFLAGS $WFLAGS",
[The only reason ERTS_EMU_CMDLINE_FLAGS exists is to force modification of config.h when the emulator command line flags are modified by configure])

dnl ----------------------------------------------------------------------
dnl Output the result.
dnl ----------------------------------------------------------------------
Expand Down
25 changes: 18 additions & 7 deletions erts/emulator/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ OPCODE_TABLES += \
beam/emu/trace_instrs.tab
endif


DEBUG_CFLAGS = @DEBUG_CFLAGS@
## These are here for ease of debugging purposes, they are not used anywher
CONFIGURE_CFLAGS = @CFLAGS@
CONFIGURE_CXXFLAGS = @CXXFLAGS@
DEBUG_CFLAGS = @DEBUG_CFLAGS@
DEBUG_CXXFLAGS = @DEBUG_CXXFLAGS@

#
# Run this make file with TYPE set to the type of emulator you want.
Expand Down Expand Up @@ -124,7 +126,8 @@ DIRTY_SCHEDULER_TEST=@DIRTY_SCHEDULER_TEST@

ifeq ($(TYPE),debug)
TYPEMARKER = .debug
TYPE_FLAGS = $(DEBUG_CFLAGS) -DDEBUG
TYPE_FLAGS = @DEBUG_CFLAGS@ -DDEBUG
TYPE_CXXFLAGS = @DEBUG_CXXFLAGS@
ENABLE_ALLOC_TYPE_VARS += debug
ifeq ($(TARGET),win32)
TYPE_FLAGS += -DNO_JUMP_TABLE
Expand All @@ -134,7 +137,8 @@ else

ifeq ($(TYPE),gcov)
TYPEMARKER = .gcov
TYPE_FLAGS = $(DEBUG_CFLAGS) -DERTS_GCOV -DNO_JUMP_TABLE -fprofile-arcs -ftest-coverage -O0 -DERTS_CAN_INLINE=0 -DERTS_INLINE=
TYPE_FLAGS = @DEBUG_CFLAGS@ -DERTS_GCOV -DNO_JUMP_TABLE -fprofile-arcs -ftest-coverage -O0 -DERTS_CAN_INLINE=0 -DERTS_INLINE=
TYPE_CXXFLAGS = @DEBUG_CXXFLAGS@
ifneq ($(findstring solaris,$(TARGET)),solaris)
TYPE_LIBS = -lgcov
endif
Expand All @@ -143,21 +147,24 @@ else

ifeq ($(TYPE),valgrind)
TYPEMARKER = .valgrind
TYPE_FLAGS = $(DEBUG_CFLAGS) -DVALGRIND -DNO_JUMP_TABLE
TYPE_FLAGS = @DEBUG_CFLAGS@ -DVALGRIND -DNO_JUMP_TABLE
TYPE_CXXFLAGS = @DEBUG_CXXFLAGS@
ENABLE_ALLOC_TYPE_VARS += valgrind
else

ifeq ($(TYPE),asan)
PURIFY =
TYPEMARKER = .asan
TYPE_FLAGS = $(DEBUG_CFLAGS) -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer -DADDRESS_SANITIZER
TYPE_FLAGS = @DEBUG_CFLAGS@ -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer -DADDRESS_SANITIZER
TYPE_CXXFLAGS = @DEBUG_CXXFLAGS@
LDFLAGS += -fsanitize=address
ENABLE_ALLOC_TYPE_VARS += asan
else

ifeq ($(TYPE),gprof)
TYPEMARKER = .gprof
TYPE_FLAGS = @CFLAGS@ -DGPROF -pg -DERTS_CAN_INLINE=0 -DERTS_INLINE=
TYPE_CXXFLAGS = @CXXFLAGS@
LDFLAGS += -pg
ENABLE_ALLOC_TYPE_VARS += gprof
NO_INLINE_FUNCTIONS=true
Expand All @@ -167,23 +174,27 @@ ifeq ($(TYPE),lcnt)
TYPEMARKER = .lcnt
TYPE_FLAGS = @CFLAGS@ -DERTS_ENABLE_LOCK_COUNT
ENABLE_ALLOC_TYPE_VARS += lcnt
TYPE_CXXFLAGS = @CXXFLAGS@
else

ifeq ($(TYPE),frmptr)
OMIT_OMIT_FP=yes
TYPEMARKER = .frmptr
TYPE_FLAGS = @CFLAGS@ -DERTS_FRMPTR
TYPE_CXXFLAGS = @CXXFLAGS@
else

ifeq ($(TYPE),icount)
TYPEMARKER = .icount
TYPE_FLAGS = @CFLAGS@ -DERTS_OPCODE_COUNTER_SUPPORT
TYPE_CXXFLAGS = @CXXFLAGS@
else

# If type isn't one of the above, it *is* opt type...
override TYPE=opt
TYPEMARKER =
TYPE_FLAGS = @CFLAGS@
TYPE_CXXFLAGS = @CXXFLAGS@
endif
endif
endif
Expand Down Expand Up @@ -276,7 +287,7 @@ ifeq ($(FLAVOR),jit)
CFLAGS += -DBEAMASM=1
ENABLE_ALLOC_TYPE_VARS += beamasm
endif
CXXFLAGS = $(filter-out -Werror=implicit -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement,$(CFLAGS)) @CXXFLAGS@
CXXFLAGS = $(filter-out -Werror=implicit -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement,$(CFLAGS)) $(TYPE_CXXFLAGS)
HCC = @HCC@
LD = @LD@
DEXPORT = @DEXPORT@
Expand Down

0 comments on commit 9087c4a

Please sign in to comment.