Bug 1433383 Properly detect -flto flag. r=froydnj
authormarxin <mliska@suse.cz>
Fri, 26 Jan 2018 00:57:00 +0200
changeset 401148 c999baadc2d5a7d8393596ab062576d4018c6b79
parent 401147 e82864a182cebd7ce41a6ebb3521a49f286be976
child 401149 74e11cfb3b5a03b40a1f71a9f6efaf5d8b740a12
push id33332
push userccoroiu@mozilla.com
push dateSun, 28 Jan 2018 10:41:03 +0000
treeherdermozilla-central@094915903938 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1433383
milestone60.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 1433383 Properly detect -flto flag. r=froydnj
toolkit/library/StaticXULComponentsEnd/moz.build
toolkit/library/moz.build
--- a/toolkit/library/StaticXULComponentsEnd/moz.build
+++ b/toolkit/library/StaticXULComponentsEnd/moz.build
@@ -2,14 +2,16 @@
 # 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/.
 
 SOURCES += [
     'StaticXULComponentsEnd.cpp',
 ]
 
 # Don't let LTO reorder StaticXULComponentsStart.o.
-if '-flto' in CONFIG['OS_CXXFLAGS']:
-    SOURCES['StaticXULComponentsEnd.cpp'].flags += ['-fno-lto']
+for f in CONFIG['OS_CXXFLAGS']:
+    if f.startswith('-flto'):
+        SOURCES['StaticXULComponentsEnd.cpp'].flags += ['-fno-lto']
+        break
 
 Library('StaticXULComponentsEnd')
 
 DEFINES['MOZILLA_INTERNAL_API'] = True
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -87,18 +87,20 @@ SOURCES += [
     'StaticXULComponentsStart.cpp',
 ]
 
 # This, combined with the fact the file is first, makes the start pointer
 # it contains first in Windows PGO builds.
 SOURCES['StaticXULComponentsStart.cpp'].no_pgo = True
 
 # Don't let LTO reorder StaticXULComponentsStart.o.
-if '-flto' in CONFIG['OS_CXXFLAGS']:
-    SOURCES['StaticXULComponentsStart.cpp'].flags += ['-fno-lto']
+for f in CONFIG['OS_CXXFLAGS']:
+    if f.startswith('-flto'):
+        SOURCES['StaticXULComponentsStart.cpp'].flags += ['-fno-lto']
+        break
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsDllMain.cpp',
     ]
 
 LOCAL_INCLUDES += [
     '/config',