Skip to content

Commit

Permalink
mk: Don't build jemalloc with -g3
Browse files Browse the repository at this point in the history
By default, jemalloc is building itself with -g3 if the local compiler supports
it. It looks like this is generating a good deal of debug info that windows
isn't optimizing out (on the order of 18MB). Windows gcc/ld is also not
optimizing this data away, causing hello world to be 18MB in size.

There's no current real need for debugging jemalloc to a great extent, so this
commit manually passes -g1 to override -g3 which jemalloc is using. This is
confirmed to drop the size of executables on windows back to a more reasonable
size (2.0MB, as they were before).

Closes #14144
  • Loading branch information
alexcrichton committed May 15, 2014
1 parent ba5f530 commit 161b50a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ $$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
AR="$$(AR_$(1))" \
RANLIB="$$(AR_$(1)) s" \
CPPFLAGS="-I $(S)src/rt/" \
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1))"
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) -g1"
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
$$(Q)cp $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1)) $$(JEMALLOC_LIB_$(1))

Expand Down

5 comments on commit 161b50a

@bors
Copy link
Contributor

@bors bors commented on 161b50a May 16, 2014

Choose a reason for hiding this comment

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

saw approval from cmr
at alexcrichton@161b50a

@bors
Copy link
Contributor

@bors bors commented on 161b50a May 16, 2014

Choose a reason for hiding this comment

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

merging alexcrichton/rust/issue-14144 = 161b50a into auto

@bors
Copy link
Contributor

@bors bors commented on 161b50a May 16, 2014

Choose a reason for hiding this comment

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

alexcrichton/rust/issue-14144 = 161b50a merged ok, testing candidate = bbd034c

@bors
Copy link
Contributor

@bors bors commented on 161b50a May 16, 2014

@bors
Copy link
Contributor

@bors bors commented on 161b50a May 16, 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 = bbd034c

Please sign in to comment.