bug 1032055 - prevent lto from reordering static xul component constants r=glandium
authorTrevor Saunders <trev.saunders@gmail.com>
Thu, 28 Aug 2014 16:41:18 -0400
changeset 202271 b9de6514b9940f66ae6b07157216f6222cb91bca
parent 202270 5f61c734e372c438b4660fb1a0ada397ef9d2365
child 202272 a7840102579bb11fa60237349236118d38adb7c2
push id27395
push usercbook@mozilla.com
push dateFri, 29 Aug 2014 12:55:06 +0000
treeherdermozilla-central@5f66dd3d63f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1032055
milestone34.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 1032055 - prevent lto from reordering static xul component constants r=glandium
toolkit/library/StaticXULComponentsEnd/moz.build
toolkit/library/moz.build
--- a/toolkit/library/StaticXULComponentsEnd/moz.build
+++ b/toolkit/library/StaticXULComponentsEnd/moz.build
@@ -1,11 +1,15 @@
 # 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/.
 
 SOURCES += [
     'StaticXULComponentsEnd.cpp',
 ]
 
+# Don't let LTO reorder StaticXULComponentsStart.o.
+if '-flto' in CONFIG['OS_CXXFLAGS']:
+    SOURCES['StaticXULComponentsEnd.cpp'].flags += ['-fno-lto']
+
 LIBRARY_NAME = 'StaticXULComponentsEnd'
 
 DEFINES['MOZILLA_INTERNAL_API'] = True
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -17,16 +17,20 @@ SOURCES += [
 ]
 
 MSVC_ENABLE_PGO = True
 
 # 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']
+
 if CONFIG['OS_ARCH'] == 'WINNT':
     SOURCES += [
         'nsDllMain.cpp',
     ]
 
 LOCAL_INCLUDES += [
     '/config',
     # need widget/windows for resource.h (included from widget.rc)