Bug 1621552 - Don't pass clang PGO runtime explicitly on Windows. r=dmajor
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 11 Mar 2020 21:58:45 +0000
changeset 518275 1ff07d90ee593c86565372db539506a4875785ed
parent 518274 0dfbd1b0d2df7001eafbd4f1a8fa8d37d4f719d5
child 518276 f792d895cdf8f3819b987389301e98b5873123d8
push id37206
push useraciure@mozilla.com
push dateThu, 12 Mar 2020 03:57:49 +0000
treeherdermozilla-central@4fd5c458be4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1621552
milestone76.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 1621552 - Don't pass clang PGO runtime explicitly on Windows. r=dmajor It turns out clang-cl adds an explicit /DEFAULTLIB:/full/path/to/runtime to all the .obj it creates, which makes the linker add it on its own. Differential Revision: https://phabricator.services.mozilla.com/D66368
build/moz.configure/lto-pgo.configure
build/mozconfig.clang-cl
--- a/build/moz.configure/lto-pgo.configure
+++ b/build/moz.configure/lto-pgo.configure
@@ -59,39 +59,34 @@ def pgo_profile_path(path, pgo_use, prof
         die('Argument to --with-pgo-profile-path must be a file.')
     if not os.path.isabs(path[0]):
         die('Argument to --with-pgo-profile-path must be an absolute path.')
     return path[0]
 
 
 set_config('PGO_PROFILE_PATH', pgo_profile_path)
 
-@depends(c_compiler, target, pgo_profile_path)
+@depends(c_compiler, pgo_profile_path)
 @imports('multiprocessing')
 @imports(_from='__builtin__', _import='min')
-def pgo_flags(compiler, target, profdata):
+def pgo_flags(compiler, profdata):
     if compiler.type == 'gcc':
         return namespace(
             gen_cflags=['-fprofile-generate'],
             gen_ldflags=['-fprofile-generate'],
             use_cflags=['-fprofile-use', '-fprofile-correction',
                         '-Wcoverage-mismatch'],
             use_ldflags=['-fprofile-use'],
         )
 
     if compiler.type in ('clang-cl', 'clang'):
         prefix = ''
         if compiler.type == 'clang-cl':
             prefix = '/clang:'
-            if target.cpu == 'x86_64':
-                gen_ldflags = ['clang_rt.profile-x86_64.lib']
-            elif target.cpu == 'x86':
-                gen_ldflags = ['clang_rt.profile-i386.lib']
-            else:
-                gen_ldflags = None
+            gen_ldflags = None
         else:
             gen_ldflags = ['-fprofile-generate']
 
         return namespace(
             gen_cflags=[prefix + '-fprofile-generate'],
             gen_ldflags=gen_ldflags,
             use_cflags=[prefix + '-fprofile-use=%s' % profdata,
                         # Some error messages about mismatched profile data
--- a/build/mozconfig.clang-cl
+++ b/build/mozconfig.clang-cl
@@ -1,16 +1,11 @@
 if test -d "$MOZ_FETCHES_DIR/clang/bin"; then
     CLANG_DIR=`cd "$MOZ_FETCHES_DIR/clang/bin" ; pwd`
     export PATH="${CLANG_DIR}:${PATH}"
-
-    if $(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && test -d lib/windows); then
-        CLANG_LIB_DIR="$(cd $MOZ_FETCHES_DIR/clang/lib/clang/* && cd lib/windows && pwd)"
-        export LIB=$LIB:$CLANG_LIB_DIR
-    fi
 fi
 
 export CC=clang-cl
 export CXX=clang-cl
 export ENABLE_CLANG_PLUGIN=1
 
 if [ -n "$UPLOAD_PATH" ]; then
     case "$(uname -s)" in