From 2a7d541658ec7f9984f5af9b0b8c1c0670bbba6d Mon Sep 17 00:00:00 2001 From: Chris Manchester Date: Thu, 2 Nov 2017 11:47:48 -0700 Subject: [PATCH] Bug 1411712 - Move ldflags munging by the clang-plugin to moz.build r=mshal MozReview-Commit-ID: JTZlXscUvlX --HG-- extra : rebase_source : 96d7963429a362ac246b5ff93c828709168ef3cf --- build/clang-plugin/Makefile.in | 6 ------ build/clang-plugin/moz.build | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build/clang-plugin/Makefile.in b/build/clang-plugin/Makefile.in index 99f2f0217b64..9e031d7765ca 100644 --- a/build/clang-plugin/Makefile.in +++ b/build/clang-plugin/Makefile.in @@ -2,9 +2,6 @@ # 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 @@ -12,7 +9,6 @@ include $(topsrcdir)/config/config.mk 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. @@ -21,8 +17,6 @@ CXX := $(HOST_CXX) # 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 diff --git a/build/clang-plugin/moz.build b/build/clang-plugin/moz.build index f0ebf15a7e4a..c7a8b8f1b7ab 100644 --- a/build/clang-plugin/moz.build +++ b/build/clang-plugin/moz.build @@ -75,3 +75,12 @@ 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'] = []