From owner-svn-src-head@freebsd.org Thu Apr 20 21:00:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E7DD48D41; Thu, 20 Apr 2017 21:00:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC7C1196E; Thu, 20 Apr 2017 21:00:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KL09ej093346; Thu, 20 Apr 2017 21:00:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KL0938093345; Thu, 20 Apr 2017 21:00:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704202100.v3KL0938093345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Apr 2017 21:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317215 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 21:00:11 -0000 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