From bed0e35451d9637ed8f20b52364a73f328fb376e Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 18 Feb 2016 09:03:01 +0900 Subject: [PATCH] Bug 1249167 - Fix dependencies involving stdc++compat and clang-plugin. r=mshal --- build/templates.mozbuild | 10 ++++++++-- config/moz.build | 5 ++++- config/recurse.mk | 5 ++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/build/templates.mozbuild b/build/templates.mozbuild index 157915f664a..d4fd979c35f 100644 --- a/build/templates.mozbuild +++ b/build/templates.mozbuild @@ -90,11 +90,17 @@ def HostStdCppCompat(): @template -def HostProgram(name): +def HostProgram(name, c_only=False): '''Template for build tools executables.''' HOST_PROGRAM = name - HostStdCppCompat() + # With context-based templates, this won't be needed anymore, and will + # work better than relying on the caller setting it, but at the moment, + # this is the best we have. And it doesn't matter /that/ much, so there's + # really only one place using this, where it does matter to avoid the + # extra dependency (because it creates a circular one). + if not c_only: + HostStdCppCompat() @template diff --git a/config/moz.build b/config/moz.build index 269a6c76a92..f40a7253006 100644 --- a/config/moz.build +++ b/config/moz.build @@ -24,7 +24,10 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT': 'nsinstall.c', 'pathsub.c', ] - HostProgram('nsinstall_real') + # stdc++compat depends on config/export, so avoid a circular + # dependency added by HostProgram depending on stdc++compat, + # while the program here is in C. + HostProgram('nsinstall_real', c_only=True) if CONFIG['MOZ_SHARED_ICU']: DEFINES['MOZ_SHARED_ICU'] = True diff --git a/config/recurse.mk b/config/recurse.mk index 4a59b775cc1..6316f7c27f7 100644 --- a/config/recurse.mk +++ b/config/recurse.mk @@ -152,7 +152,7 @@ widget/android/bindings/export: build/annotationProcessors/export mobile/android/tests/browser/robocop/roboextender/tools: mobile/android/tests/javaaddons/tools ifdef ENABLE_CLANG_PLUGIN -$(filter-out build/clang-plugin/%,$(compile_targets)): build/clang-plugin/target build/clang-plugin/tests/target +$(filter-out config/host build/unix/stdc++compat/% build/clang-plugin/%,$(compile_targets)): build/clang-plugin/target build/clang-plugin/tests/target build/clang-plugin/tests/target: build/clang-plugin/target endif @@ -176,3 +176,6 @@ endif # happen at the same time (bug #1146738) js/src/target: js/src/host endif +# Most things are built during compile (target/host), but some things happen during export +# Those need to depend on config/export for system wrappers. +$(addprefix build/unix/stdc++compat/,target host) build/clang-plugin/target: config/export