Skip to content

Commit

Permalink
Add 'frmptr' emulator type
Browse files Browse the repository at this point in the history
  • Loading branch information
rickard-green committed Apr 21, 2013
1 parent ad7231b commit e550cd4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 5 deletions.
13 changes: 10 additions & 3 deletions erts/emulator/Makefile.in
Expand Up @@ -48,6 +48,7 @@ CREATE_DIRS=

LDFLAGS=@LDFLAGS@
ARFLAGS=rc
OMIT_OMIT_FP=no

ifeq ($(TYPE),debug)
PURIFY =
Expand Down Expand Up @@ -113,6 +114,13 @@ TYPEMARKER = .lcnt
TYPE_FLAGS = @CFLAGS@ -DERTS_ENABLE_LOCK_COUNT
else

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

# If type isn't one of the above, it *is* opt type...
override TYPE=opt
PURIFY =
Expand All @@ -126,6 +134,7 @@ endif
endif
endif
endif
endif

#
# NOTE: When adding a new type update ERL_BUILD_TYPE_MARKER in sys/unix/sys.c
Expand Down Expand Up @@ -219,8 +228,6 @@ LIB_PREFIX=lib
LIB_SUFFIX=.a
endif

OMIT_OMIT_FP=no

ifeq (@EMU_LOCK_CHECKING@,yes)
NO_INLINE_FUNCTIONS=true
endif
Expand All @@ -238,7 +245,7 @@ ifeq ($(NO_INLINE_FUNCTIONS),true)
GEN_OPT_FLGS = $(OPT_LEVEL) -fno-inline-functions
else
ifeq ($(OMIT_OMIT_FP),yes)
GEN_OPT_FLGS = $(OPT_LEVEL)
GEN_OPT_FLGS = $(OPT_LEVEL) -fno-omit-frame-pointer
else
GEN_OPT_FLGS = $(OPT_LEVEL) -fomit-frame-pointer
endif
Expand Down
6 changes: 6 additions & 0 deletions erts/emulator/beam/erl_bif_info.c
Expand Up @@ -114,6 +114,9 @@ static char erts_system_version[] = ("Erlang " ERLANG_OTP_RELEASE
#ifdef VALGRIND
" [valgrind-compiled]"
#endif
#ifdef ERTS_FRMPTR
" [frame-pointer]"
#endif
#ifdef USE_DTRACE
" [dtrace]"
#endif
Expand Down Expand Up @@ -2096,6 +2099,9 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
#elif defined(ERTS_ENABLE_LOCK_COUNT)
ERTS_DECL_AM(lcnt);
BIF_RET(AM_lcnt);
#elif defined(ERTS_FRMPTR)
ERTS_DECL_AM(frmptr);
BIF_RET(AM_frmptr);
#else
BIF_RET(am_opt);
#endif
Expand Down
5 changes: 5 additions & 0 deletions erts/etc/unix/cerl.src
Expand Up @@ -171,6 +171,11 @@ while [ $# -gt 0 ]; do
cargs="$cargs -debug"
TYPE=.debug
;;
"-frmptr")
shift
cargs="$cargs -frmptr"
TYPE=.frmptr
;;
"-gdb")
shift
GDB=gdb
Expand Down
8 changes: 8 additions & 0 deletions erts/lib_src/Makefile.in
Expand Up @@ -86,6 +86,12 @@ CFLAGS += -DERTS_ENABLE_LOCK_COUNT
OMIT_FP=true
PRE_LD=
else
ifeq ($(TYPE),frmptr)
TYPE_SUFFIX = .frmptr
CFLAGS += -DERTS_FRMPTR
OMIT_OMIT_FP=yes
PRE_LD=
else
override TYPE=opt
OMIT_FP=true
TYPE_SUFFIX=
Expand All @@ -98,6 +104,7 @@ endif
endif
endif
endif
endif

OPSYS=@OPSYS@
sol2CFLAGS=
Expand All @@ -110,6 +117,7 @@ ultrasparcCFLAGS=-Wa,-xarch=v8plusa
ARCHCFLAGS=$($(ARCH)CFLAGS)

ifeq ($(OMIT_OMIT_FP),yes)
CFLAGS += -fno-omit-frame-pointer
OMIT_FP=false
endif

Expand Down
Binary file modified erts/preloaded/ebin/erlang.beam
Binary file not shown.
2 changes: 1 addition & 1 deletion erts/preloaded/src/erlang.erl
Expand Up @@ -2086,7 +2086,7 @@ tuple_to_list(_Tuple) ->
({allocator_sizes, Alloc}) -> [_] when %% More or less anything
Alloc :: atom();
(build_type) -> opt | debug | purify | quantify | purecov |
gcov | valgrind | gprof | lcnt;
gcov | valgrind | gprof | lcnt | frmptr;
(c_compiler_used) -> {atom(), term()};
(check_io) -> [_];
(compat_rel) -> integer();
Expand Down
2 changes: 1 addition & 1 deletion make/run_make.mk
Expand Up @@ -30,7 +30,7 @@ include $(ERL_TOP)/make/target.mk

.PHONY: valgrind

opt debug purify quantify purecov valgrind gcov gprof lcnt:
opt debug purify quantify purecov valgrind gcov gprof lcnt frmptr:
$(make_verbose)$(MAKE) -f $(TARGET)/Makefile TYPE=$@

plain smp frag smp_frag:
Expand Down

0 comments on commit e550cd4

Please sign in to comment.