Bug 1564538: Set -ffreestanding on DllBlocklistWin.cpp; r=dmajor
authorAaron Klotz <aklotz@mozilla.com>
Tue, 16 Jul 2019 18:24:37 +0000
changeset 543487 fb3217bef0ecf64076980aeef763d386d680ccb4
parent 543486 a0b40816521ed1d3cc9f25f22496f8358e51b4ea
child 543488 70e6db69c88f316792e5276bb60d502a6a39c047
push id11848
push userffxbld-merge
push dateMon, 26 Aug 2019 19:26:25 +0000
treeherdermozilla-beta@9b31bfdfac10 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1564538
milestone70.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 1564538: Set -ffreestanding on DllBlocklistWin.cpp; r=dmajor Differential Revision: https://phabricator.services.mozilla.com/D37599
browser/app/winlauncher/moz.build
--- a/browser/app/winlauncher/moz.build
+++ b/browser/app/winlauncher/moz.build
@@ -19,16 +19,24 @@ UNIFIED_SOURCES += [
 SOURCES += [
     'DllBlocklistWin.cpp',
 ]
 # Our patched NtMapViewOfSection can be called before the process's import
 # table is populated.  Don't let the compiler insert any instrumentation
 # that might call an import.
 SOURCES['DllBlocklistWin.cpp'].no_pgo = True
 
+# DllBlocklistWin.cpp should be compiled in a freestanding environment, as
+# our patched NtMapViewOfSection must not assume that it has access to any
+# runtime libraries.
+if CONFIG['CC_TYPE'] == 'clang-cl':
+    SOURCES['DllBlocklistWin.cpp'].flags += ['-Xclang', '-ffreestanding']
+else:
+    SOURCES['DllBlocklistWin.cpp'].flags += ['-ffreestanding']
+
 OS_LIBS += [
     'ntdll',
     'oleaut32',
     'ole32',
     'rpcrt4',
     'version',
 ]