Skip to content

Commit

Permalink
enable jemalloc debugging in unoptimized builds
Browse files Browse the repository at this point in the history
The performance hit from these checks is significant, but unoptimized
builds are already incredibly slow. Enabling these checks results in
better test coverage since there are bots doing unoptimized builds, and
the cost is relatively small in the context of an unoptimized build.
This also allows using `JEMALLOC_FLAGS` to override the default
configure flags.
  • Loading branch information
thestinger committed Sep 7, 2014
1 parent 4067252 commit 1ee099d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile.in
Expand Up @@ -65,6 +65,7 @@
#
# * `VERBOSE=1` - Print all commands. Use this to see what's going on.
# * `RUSTFLAGS=...` - Add compiler flags to all `rustc` invocations
# * `JEMALLOC_FLAGS=...` - Pass flags to jemalloc's configure script
#
# * `TESTNAME=...` - Specify the name of tests to run
# * `CHECK_IGNORED=1` - Run normally-ignored tests
Expand Down
4 changes: 4 additions & 0 deletions mk/main.mk
Expand Up @@ -90,15 +90,19 @@ endif
CFG_RUSTC_FLAGS := $(RUSTFLAGS)
CFG_GCCISH_CFLAGS :=
CFG_GCCISH_LINK_FLAGS :=
CFG_JEMALLOC_FLAGS :=

ifdef CFG_DISABLE_OPTIMIZE
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
CFG_RUSTC_FLAGS +=
CFG_JEMALLOC_FLAGS += --enable-debug
else
# The rtopt cfg turns off runtime sanity checks
CFG_RUSTC_FLAGS += -O --cfg rtopt
endif

CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)

ifdef CFG_DISABLE_DEBUG
CFG_RUSTC_FLAGS += --cfg ndebug
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
Expand Down
2 changes: 1 addition & 1 deletion mk/rt.mk
Expand Up @@ -301,7 +301,7 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
@$$(call E, make: jemalloc)
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ \
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ $(CFG_JEMALLOC_FLAGS) \
--build=$(CFG_BUILD) --host=$(1) \
CC="$$(CC_$(1))" \
AR="$$(AR_$(1))" \
Expand Down

13 comments on commit 1ee099d

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/jemalloc = 1ee099d into auto

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/jemalloc = 1ee099d merged ok, testing candidate = 9969e8a5

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/jemalloc = 1ee099d into auto

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/jemalloc = 1ee099d merged ok, testing candidate = 0bbc6cee

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/jemalloc = 1ee099d into auto

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/jemalloc = 1ee099d merged ok, testing candidate = 7ab58f6

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 1ee099d Sep 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 7ab58f6

Please sign in to comment.