Author: dim
Date: Thu Apr 20 21:00:09 2017
New Revision: 317215
URL: https://svnweb.freebsd.org/changeset/base/317215

Log:
  Add function and data sections when building llvm, clang, lld and lldb,
  and allow the linker to garbage collect them.  This shaves off up to a
  few MB from the final executables.
  
  MFC after:    3 days

Modified:
  head/lib/clang/llvm.build.mk

Modified: head/lib/clang/llvm.build.mk
==============================================================================
--- head/lib/clang/llvm.build.mk        Thu Apr 20 21:00:04 2017        
(r317214)
+++ head/lib/clang/llvm.build.mk        Thu Apr 20 21:00:09 2017        
(r317215)
@@ -40,6 +40,10 @@ CFLAGS+=     -DLLVM_DEFAULT_TARGET_TRIPLE=\"
 CFLAGS+=       -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\"
 CFLAGS+=       -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
 
+CFLAGS+=       -ffunction-sections
+CFLAGS+=       -fdata-sections
+LDFLAGS+=      -Wl,--gc-sections
+
 CXXFLAGS+=     -std=c++11
 CXXFLAGS+=     -fno-exceptions
 CXXFLAGS+=     -fno-rtti
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to