Bug 1411712 - Move ldflags munging by the clang-plugin to moz.build r=mshal
authorChris Manchester <cmanchester@mozilla.com>
Thu, 02 Nov 2017 11:47:48 -0700
changeset 443193 3d9a54a2b527420e5ee121ba9556f5ecc3dcda24
parent 443192 e2910375ccd8a7f64fb30ae30562c5102905309a
child 443194 ab9c6e310379c674d97e0337098a260197f08487
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1411712
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1411712 - Move ldflags munging by the clang-plugin to moz.build r=mshal MozReview-Commit-ID: JTZlXscUvlX
build/clang-plugin/Makefile.in
build/clang-plugin/moz.build
--- a/build/clang-plugin/Makefile.in
+++ b/build/clang-plugin/Makefile.in
@@ -1,33 +1,27 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-# LLVM_CXXFLAGS comes with its own optimization flags.
-MOZ_OPTIMIZE =
-
 include $(topsrcdir)/config/config.mk
 
 # In the current moz.build world, we need to override essentially every
 # variable to limit ourselves to what we need to build the clang plugin.
 ifneq ($(HOST_OS_ARCH),WINNT)
 DSO_LDOPTS := -shared
 endif
-OS_LDFLAGS := $(LLVM_LDFLAGS) $(CLANG_LDFLAGS)
 
 ifeq ($(HOST_OS_ARCH)_$(OS_ARCH),Linux_Darwin)
 # Use the host compiler instead of the target compiler.
 CXX := $(HOST_CXX)
 # expandlibs doesn't know the distinction between host and target toolchains,
 # and on cross linux/darwin builds, the options to give to the linker for file
 # lists differ between both, so don't use file lists.
 EXPAND_MKSHLIB_ARGS :=
-# Don't pass OSX linker arguments.
-MOZ_FIX_LINK_PATHS :=
 endif
 
 # Use the default OS X deployment target to enable using the libc++ headers
 # correctly.  Note that the binary produced here is a host tool and doesn't need
 # to be distributed.
 MACOSX_DEPLOYMENT_TARGET :=
 
 # Temporarily relax the requirements for libstdc++ symbol versions on static
--- a/build/clang-plugin/moz.build
+++ b/build/clang-plugin/moz.build
@@ -70,8 +70,17 @@ else:
 
 if CONFIG['LLVM_CXXFLAGS']:
     COMPILE_FLAGS['OS_CXXFLAGS'] = CONFIG['LLVM_CXXFLAGS'] + extra_cxxflags
 
 COMPILE_FLAGS['CLANG_PLUGIN'] = []
 COMPILE_FLAGS['OPTIMIZE'] = []
 COMPILE_FLAGS['DEBUG'] = []
 COMPILE_FLAGS['OS_COMPILE_CXXFLAGS'] = []
+
+LINK_FLAGS['OS'] = CONFIG['LLVM_LDFLAGS'] + CONFIG['CLANG_LDFLAGS']
+# The ldflags above override most other categories.
+for var in ('LINKER', 'OPTIMIZE'):
+    LINK_FLAGS[var] = []
+
+if CONFIG['HOST_OS_ARCH'] == 'Linux' and CONFIG['OS_ARCH'] == 'Darwin':
+    # Don't pass OSX linker arguments.
+    LINK_FLAGS['FIX_LINK_PATHS'] = []