Bug 1747756 - Move Windows system libraries from LIBS to moz.build. r=firefox-build-system-reviewers,mhentges

While mingw builds don't require user32 and advapi32 explicitly, it doesn't
hurt for them to be there (and they're required for clang-cl build).
Likewise, while clang-builds don't require uuid and userenv explicitly
because they're pulled in via #pragmas in the source code, mingw doesn't
support those #pragmas and needs them explicitly, which doesn't hurt the
clang-cl builds.

Differential Revision: https://phabricator.services.mozilla.com/D134737
This commit is contained in:
Mike Hommey 2021-12-30 20:56:43 +00:00
Родитель 33573e7fbc
Коммит 1acc37c7a6
28 изменённых файлов: 72 добавлений и 6 удалений

Просмотреть файл

@ -92,8 +92,11 @@ USE_LIBS += [
]
OS_LIBS += [
"advapi32",
"uuid",
"rpcrt4",
"oleacc",
"user32",
]
RCINCLUDE = "AccessibleHandler.rc"

Просмотреть файл

@ -78,6 +78,10 @@ if CONFIG["OS_ARCH"] == "WINNT":
LOCAL_INCLUDES += [
"/browser/app/winlauncher",
]
OS_LIBS += [
"advapi32",
"uuid",
]
DELAYLOAD_DLLS += [
"advapi32.dll",
"oleaut32.dll",
@ -115,6 +119,9 @@ if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
"sandbox_s",
]
OS_LIBS += [
"winmm",
]
DELAYLOAD_DLLS += [
"winmm.dll",
"user32.dll",

Просмотреть файл

@ -9,6 +9,7 @@ FINAL_TARGET = "_tests/xpcshell/browser/components/migration/tests/unit"
Program("InsertIEHistory")
OS_LIBS += [
"ole32",
"uuid",
]
SOURCES += [
"InsertIEHistory.cpp",

1
config/external/nspr/pr/moz.build поставляемый
Просмотреть файл

@ -69,6 +69,7 @@ elif CONFIG["OS_TARGET"] == "SunOS":
elif CONFIG["OS_TARGET"] == "WINNT":
OS_LIBS += [
"advapi32",
"wsock32",
"ws2_32",
"mswsock",
"winmm",

Просмотреть файл

@ -23,6 +23,7 @@ SharedLibrary("fake")
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"ole32",
"user32",
]
USE_STATIC_LIBS = True

Просмотреть файл

@ -37,7 +37,10 @@ if CONFIG["OS_ARCH"] == "WINNT":
]
OS_LIBS += [
"advapi32",
"user32",
"version",
"winmm",
]
USE_LIBS += [

Просмотреть файл

@ -509,6 +509,10 @@ if CONFIG["ENABLE_TRACE_LOGGING"]:
]
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"advapi32",
"winmm",
]
UNIFIED_SOURCES += [
"threading/windows/CpuCount.cpp",
"threading/windows/WindowsThread.cpp",

Просмотреть файл

@ -404,8 +404,6 @@ case "$target" in
fi
DSO_LDOPTS='-shared'
# mingw doesn't require kernel32, user32, and advapi32 explicitly
LIBS="$LIBS -lusp10 -lgdi32 -lwinmm -lwsock32"
MOZ_FIX_LINK_PATHS=
# Silence problematic clang warnings
@ -522,7 +520,6 @@ case "$target" in
# warning insists on complaining about the latter case, which
# is annoying, and rather noisy.
CXXFLAGS="$CXXFLAGS -Wno-used-but-marked-unused"
LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
MOZ_DEBUG_LDFLAGS='-DEBUG'
if test "$HOST_OS_ARCH" != "WINNT"; then
# %_PDB% is a special signal to emit only the PDB basename. This

Просмотреть файл

@ -39,7 +39,10 @@ if CONFIG["OS_ARCH"] == "WINNT":
]
OS_LIBS += [
"advapi32",
"user32",
"version",
"winmm",
]
USE_LIBS += [

Просмотреть файл

@ -37,6 +37,7 @@ if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"mfuuid",
"uuid",
]
DEFINES["ENABLE_WMF"] = True

Просмотреть файл

@ -33,6 +33,7 @@ if CONFIG["MOZ_REPLACE_MALLOC_STATIC"] and (CONFIG["MOZ_DMD"] or CONFIG["MOZ_PHC
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"advapi32",
"dbghelp",
]

Просмотреть файл

@ -38,6 +38,12 @@ if CONFIG["MOZ_TSAN"]:
if CONFIG["OS_TARGET"] == "WINNT":
if CONFIG["MOZ_MEMORY"]:
DEFFILE = "mozglue.def"
OS_LIBS += [
"advapi32",
"user32",
"winmm",
"uuid",
]
# We'll break the DLL blocklist if we immediately load user32.dll.
# For the same reason, we delayload these other DLLs to avoid eager
# dependencies on user32.dll.

Просмотреть файл

@ -478,8 +478,6 @@ case "$target" in
fi
DSO_LDOPTS='-shared'
# mingw doesn't require kernel32, user32, and advapi32 explicitly
LIBS="$LIBS -luuid -lusp10 -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32"
MOZ_FIX_LINK_PATHS=
MOZ_OPTIMIZE_FLAGS="-O2"
@ -598,7 +596,6 @@ case "$target" in
CXXFLAGS="$CXXFLAGS -Wno-used-but-marked-unused"
# Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
LIBS="$LIBS user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib"
MOZ_DEBUG_LDFLAGS='-DEBUG'
if test "$HOST_OS_ARCH" != "WINNT"; then
# %_PDB% is a special signal to emit only the PDB basename. This

Просмотреть файл

@ -24,6 +24,7 @@ if CONFIG["OS_TARGET"] == "Android":
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"advapi32",
"userenv",
"ws2_32",
]

Просмотреть файл

@ -12,6 +12,7 @@ UNIFIED_SOURCES += [
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"advapi32",
"crypt32",
"kernel32",
"ncrypt",

Просмотреть файл

@ -23,7 +23,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
WIN32_EXE_LDFLAGS += ["-municode"]
OS_LIBS += [
"advapi32",
"gdi32",
"gdiplus",
"user32",
]
NO_PGO = True

Просмотреть файл

@ -20,6 +20,12 @@ USE_LIBS += [
"mozglue",
]
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"advapi32",
"uuid",
]
if CONFIG["COMPILE_ENVIRONMENT"]:
shared_library = "!%sTestShellEx%s" % (CONFIG["DLL_PREFIX"], CONFIG["DLL_SUFFIX"])
TEST_HARNESS_FILES.testing.mochitest.browser.toolkit.components.aboutthirdparty.tests.browser += [

Просмотреть файл

@ -50,6 +50,9 @@ OS_LIBS += [
"ws2_32",
"shell32",
"shlwapi",
"user32",
"userenv",
"uuid",
]
if CONFIG["ENABLE_TESTS"]:

Просмотреть файл

@ -44,11 +44,14 @@ if CONFIG["OS_ARCH"] == "WINNT":
"nss",
]
OS_LIBS += [
"advapi32",
"comctl32",
"gdi32",
"ole32",
"shell32",
"wininet",
"shlwapi",
"user32",
]
elif CONFIG["OS_ARCH"] == "Darwin":
UNIFIED_SOURCES += [

Просмотреть файл

@ -7,6 +7,7 @@ USE_LIBS += [
]
OS_LIBS += [
"advapi32",
"bcrypt",
]

Просмотреть файл

@ -269,11 +269,14 @@ if CONFIG["OS_ARCH"] == "FreeBSD":
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"crypt32",
"gdi32",
"shell32",
"ntdll",
"ole32",
"version",
"winspool",
"userenv",
"uuid",
]
if CONFIG["OS_ARCH"] == "Linux" and CONFIG["OS_TARGET"] != "Android":

Просмотреть файл

@ -40,6 +40,8 @@ LOCAL_INCLUDES += [
if CONFIG["OS_ARCH"] == "WINNT":
OS_LIBS += [
"shlwapi",
"user32",
"uuid",
]
USE_LIBS += [

Просмотреть файл

@ -38,6 +38,10 @@ if CONFIG["OS_ARCH"] == "WINNT":
"shlwapi",
"crypt32",
"advapi32",
"gdi32",
"user32",
"userenv",
"uuid",
]
USE_LIBS += [

Просмотреть файл

@ -15,3 +15,7 @@ RCFILE = "TestDllBlocklist_NoOpEntryPoint.rc"
if CONFIG["COMPILE_ENVIRONMENT"]:
TEST_HARNESS_FILES.gtest += ["!TestDllBlocklist_NoOpEntryPoint.dll"]
OS_LIBS += [
"uuid",
]

Просмотреть файл

@ -23,10 +23,12 @@ if CONFIG["CPU_ARCH"] in ("x86", "x86_64"):
)
OS_LIBS += [
"advapi32",
"ntdll",
"ole32",
"shlwapi",
"user32",
"uuid",
]
DELAYLOAD_DLLS += [

Просмотреть файл

@ -27,8 +27,10 @@ DisableStlWrapping()
USE_STATIC_LIBS = True
OS_LIBS += [
"advapi32",
"comctl32",
"shell32",
"userenv",
"ws2_32",
]

Просмотреть файл

@ -19,6 +19,7 @@ OS_LIBS += [
"shell32",
"shlwapi",
"urlmon",
"uuid",
]
if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["CC_TYPE"] in ("gcc", "clang"):

Просмотреть файл

@ -5,3 +5,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SimplePrograms(["windbgdlg"])
OS_LIBS += [
"advapi32",
"user32",
]