Subzero: Build with function/data sections and -gc-sections.
This is consistent with how LLVM is built, and makes it easier to analyze the potential size of a translator build and what may be inappropriately brought into the build.
BUG= none
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/783023002
diff --git a/Makefile.standalone b/Makefile.standalone
index 6e8edf7..d86aeaf 100644
--- a/Makefile.standalone
+++ b/Makefile.standalone
@@ -42,7 +42,7 @@
OPTLEVEL = -O0
else
OBJDIR = build/Release
- OPTLEVEL = -O2
+ OPTLEVEL = -O2 -ffunction-sections -fdata-sections
endif
# The list of CXX defines that are dependent on build parameters.
@@ -86,7 +86,7 @@
-fno-exceptions $(OPTLEVEL) $(ASSERTIONS) $(CXX_DEFINES) -g \
$(HOST_FLAGS) -Wno-error=unused-parameter \
-I$(LIBCXX_INSTALL_PATH)/include/c++/v1
-LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib
+LDFLAGS := $(HOST_FLAGS) -L$(LIBCXX_INSTALL_PATH)/lib -Wl,--gc-sections
SRCS = \
assembler.cpp \