Bug 1386876 - Replace all uses of NO_VISIBILITY_FLAGS with a template and remove NO_VISIBILITY_FLAGS. draft
authorChris Manchester <cmanchester@mozilla.com>
Mon, 01 May 2017 18:12:35 -0700
changeset 648536 aefcc36bedd221cd5f9df061c8dd90524e1fb9ca
parent 648535 7e96dbd5277364a6284b5df0bdbc5c6c679d40c6
child 648537 6e34771bd709975ba69500cd09e13699dfe75f55
push id74784
push userbmo:cmanchester@mozilla.com
push dateThu, 17 Aug 2017 22:39:21 +0000
bugs1386876
milestone57.0a1
Bug 1386876 - Replace all uses of NO_VISIBILITY_FLAGS with a template and remove NO_VISIBILITY_FLAGS. MozReview-Commit-ID: 194U1WMCAM0
build/clang-plugin/moz.build
build/clang-plugin/tests/moz.build
build/unix/elfhack/inject/moz.build
config/external/ffi/moz.build
config/moz.build
db/sqlite3/src/moz.build
dom/media/gmp-plugin-openh264/moz.build
dom/media/gmp-plugin/moz.build
media/ffvpx/libavcodec/moz.build
media/ffvpx/libavutil/moz.build
memory/mozalloc/moz.build
memory/mozalloc/staticruntime/moz.build
memory/volatile/moz.build
mozglue/build/moz.build
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
security/manager/ssl/tests/unit/pkcs11testmodule/moz.build
security/moz.build
toolkit/library/dummydll/moz.build
--- a/build/clang-plugin/moz.build
+++ b/build/clang-plugin/moz.build
@@ -43,17 +43,17 @@ UNIFIED_SOURCES += [
 GENERATED_FILES += ['ThirdPartyPaths.cpp']
 third_party_paths = GENERATED_FILES['ThirdPartyPaths.cpp']
 third_party_paths.script = "ThirdPartyPaths.py:generate"
 third_party_paths.inputs = [
     '/tools/rewriting/ThirdPartyPaths.txt',
 ]
 
 DisableStlWrapping()
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 # libc++ is required to build plugins against clang on OS X.
 if CONFIG['HOST_OS_ARCH'] == 'Darwin':
     CXXFLAGS += ['-stdlib=libc++']
     LDFLAGS += ['-lc++']
 
 DIRS += [
     'tests',
--- a/build/clang-plugin/tests/moz.build
+++ b/build/clang-plugin/tests/moz.build
@@ -40,9 +40,9 @@ SOURCES += [
     'TestOverrideBaseCallAnnotation.cpp',
     'TestRefCountedCopyConstructor.cpp',
     'TestSprintfLiteral.cpp',
     'TestStackClass.cpp',
     'TestTrivialCtorDtor.cpp',
 ]
 
 DisableStlWrapping()
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
--- a/build/unix/elfhack/inject/moz.build
+++ b/build/unix/elfhack/inject/moz.build
@@ -18,9 +18,9 @@ else:
     cpu = CONFIG['TARGET_CPU']
 
 SOURCES += [
     "!%s.c" % cpu,
 ]
 
 NO_PGO = True
 
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
--- a/config/external/ffi/moz.build
+++ b/config/external/ffi/moz.build
@@ -5,17 +5,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 FINAL_LIBRARY = 'js'
 
 if CONFIG['MOZ_SYSTEM_FFI']:
     OS_LIBS += CONFIG['MOZ_FFI_LIBS']
 else:
     ALLOW_COMPILER_WARNINGS = True
-    NO_VISIBILITY_FLAGS = True
+    NoVisibilityFlags()
 
     CONFIGURE_DEFINE_FILES += [
         '../../../js/src/ctypes/libffi/fficonfig.h',
     ]
     GENERATED_FILES += [
         '../../../js/src/ctypes/libffi/include/ffi.h',
     ]
     ffi_h = GENERATED_FILES['../../../js/src/ctypes/libffi/include/ffi.h']
--- a/config/moz.build
+++ b/config/moz.build
@@ -5,17 +5,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files('**'):
     BUG_COMPONENT = ('Core', 'Build Config')
 
 DIST_INSTALL = False
 # For sanity's sake, we compile nsinstall without the wrapped system
 # headers, so that we can use it to set up the wrapped system headers.
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 CONFIGURE_SUBST_FILES += [
     'doxygen.cfg',
     'makefiles/test/Makefile',
     'tests/src-simple/Makefile',
 ]
 
 if CONFIG['HOST_OS_ARCH'] != 'WINNT':
--- a/db/sqlite3/src/moz.build
+++ b/db/sqlite3/src/moz.build
@@ -1,14 +1,14 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 EXPORTS += [
     'sqlite3.h',
 ]
 
 # We allow warnings for third-party code that can be updated from upstream.
 ALLOW_COMPILER_WARNINGS = True
 
--- a/dom/media/gmp-plugin-openh264/moz.build
+++ b/dom/media/gmp-plugin-openh264/moz.build
@@ -20,11 +20,11 @@ SOURCES += [
 SharedLibrary("fakeopenh264")
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'ole32',
     ]
 
 USE_STATIC_LIBS = True
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 # Don't use STL wrappers; this isn't Gecko code
 DisableStlWrapping()
--- a/dom/media/gmp-plugin/moz.build
+++ b/dom/media/gmp-plugin/moz.build
@@ -22,11 +22,11 @@ DEFINES['GMP_FAKE_SUPPORT_DECRYPT'] = Tr
 SharedLibrary("fake")
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'ole32',
     ]
 
 USE_STATIC_LIBS = True
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 # Don't use STL wrappers; this isn't Gecko code
 DisableStlWrapping()
--- a/media/ffvpx/libavcodec/moz.build
+++ b/media/ffvpx/libavcodec/moz.build
@@ -51,17 +51,17 @@ SOURCES += [
     'vp9dsp.c',
     'vp9dsp_10bpp.c',
     'vp9dsp_12bpp.c',
     'vp9dsp_8bpp.c',
     'xiph.c'
 ]
 
 SYMBOLS_FILE = 'avcodec.symbols'
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 USE_LIBS += [
      'mozavutil'
 ]
 
 if CONFIG['OS_TARGET'] != 'WINNT':
     OS_LIBS += ['m']
 
--- a/media/ffvpx/libavutil/moz.build
+++ b/media/ffvpx/libavutil/moz.build
@@ -46,15 +46,15 @@ SOURCES += [
     'samplefmt.c',
     'threadmessage.c',
     'time.c',
     'timecode.c',
     'utils.c',
 ]
 
 SYMBOLS_FILE =  'avutil.symbols'
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 OS_LIBS += CONFIG['REALTIME_LIBS']
 if CONFIG['OS_TARGET'] != 'WINNT':
     OS_LIBS += ['m']
 
 include("../ffvpxcommon.mozbuild")
--- a/memory/mozalloc/moz.build
+++ b/memory/mozalloc/moz.build
@@ -1,14 +1,14 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 EXPORTS.mozilla += [
     'mozalloc.h',
     'mozalloc_abort.h',
     'mozalloc_oom.h',
 ]
 
 if CONFIG['WRAP_STL_INCLUDES']:
--- a/memory/mozalloc/staticruntime/moz.build
+++ b/memory/mozalloc/staticruntime/moz.build
@@ -1,15 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 if CONFIG['WRAP_STL_INCLUDES']:
     DEFINES['_HAS_EXCEPTIONS'] = 0
     if CONFIG['MOZ_MSVC_STL_WRAP_RAISE']:
         SOURCES += [
             '../msvc_raise_wrappers.cpp',
         ]
 
--- a/memory/volatile/moz.build
+++ b/memory/volatile/moz.build
@@ -1,14 +1,14 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 
 EXPORTS.mozilla += [
     'VolatileBuffer.h',
 ]
 
 if CONFIG['OS_TARGET'] == 'Android':
     UNIFIED_SOURCES += [
         'VolatileBufferAshmem.cpp',
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -30,17 +30,17 @@ if CONFIG['OS_TARGET'] == 'WINNT':
 
 if not CONFIG['JS_STANDALONE']:
 
     if CONFIG['MOZ_MEMORY'] and FORCE_SHARED_LIB:
         pass
         # TODO: SHARED_LIBRARY_LIBS go here
     else:
         # Temporary, until bug 662814 lands
-        NO_VISIBILITY_FLAGS = True
+        NoVisibilityFlags()
         SOURCES += [
             'dummy.cpp',
         ]
 
     if CONFIG['OS_TARGET'] == 'WINNT':
         LOCAL_INCLUDES += [
             '/memory/build',
         ]
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1242,20 +1242,16 @@ VARIABLES = {
     'LOCAL_INCLUDES': (ContextDerivedTypedList(Path, StrictOrderingOnAppendList), list,
         """Additional directories to be searched for include files by the compiler.
         """),
 
     'NO_PGO': (bool, bool,
         """Whether profile-guided optimization is disable in this directory.
         """),
 
-    'NO_VISIBILITY_FLAGS': (bool, bool,
-        """Build sources listed in this file without VISIBILITY_FLAGS.
-        """),
-
     'OS_LIBS': (List, list,
         """System link libraries.
 
         This variable contains a list of system libaries to link against.
         """),
     'RCFILE': (unicode, unicode,
         """The program .rc file.
 
--- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
@@ -1,14 +1,12 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
-NO_VISIBILITY_FLAGS = True
-
 DELAYLOAD_DLLS = ['foo.dll', 'bar.dll']
 
 RCFILE = 'foo.rc'
 RESFILE = 'bar.res'
 RCINCLUDE = 'bar.rc'
 DEFFILE = 'baz.def'
 
 CFLAGS += ['-fno-exceptions', '-w']
--- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
@@ -1,16 +1,14 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # Any copyright is dedicated to the Public Domain.
 # http://creativecommons.org/publicdomain/zero/1.0/
 
 DIST_INSTALL = False
 
-NO_VISIBILITY_FLAGS = True
-
 DELAYLOAD_DLLS = ['foo.dll', 'bar.dll']
 
 RCFILE = 'foo.rc'
 RESFILE = 'bar.res'
 RCINCLUDE = 'bar.rc'
 DEFFILE = 'baz.def'
 
 CFLAGS += ['-fno-exceptions', '-w']
--- a/security/manager/ssl/tests/unit/pkcs11testmodule/moz.build
+++ b/security/manager/ssl/tests/unit/pkcs11testmodule/moz.build
@@ -9,10 +9,10 @@ FINAL_TARGET = '_tests/xpcshell/security
 UNIFIED_SOURCES += [
     'pkcs11testmodule.cpp',
 ]
 
 SharedLibrary('pkcs11testmodule')
 
 # C_GetFunctionList needs to be exported. As it turns out, it's much easier to
 # just export all the symbols.
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()
 SYMBOLS_FILE = 'pkcs11testmodule.symbols'
--- a/security/moz.build
+++ b/security/moz.build
@@ -95,20 +95,23 @@ else:
         gyp_vars['cc_is_clang'] = 1
     if CONFIG['GCC_USE_GNU_LD']:
         gyp_vars['cc_use_gnu_ld'] = 1
 
     GYP_DIRS += ['nss']
     GYP_DIRS['nss'].input = 'nss/nss.gyp'
     GYP_DIRS['nss'].variables = gyp_vars
 
+    COMPILE_FLAGS['VISIBILITY'] = []
+    COMPILE_FLAGS['STL'] = []
+
     sandbox_vars = {
         # NSS explicitly exports its public symbols
         # with linker scripts.
-        'NO_VISIBILITY_FLAGS': True,
+        'COMPILE_FLAGS': COMPILE_FLAGS,
         # XXX: We should fix these warnings.
         'ALLOW_COMPILER_WARNINGS': True,
         # NSS' build system doesn't currently build NSS with PGO.
         # We could probably do so, but not without a lot of
         # careful consideration.
         'NO_PGO': True,
     }
     if CONFIG['OS_TARGET'] == 'WINNT':
--- a/toolkit/library/dummydll/moz.build
+++ b/toolkit/library/dummydll/moz.build
@@ -11,9 +11,9 @@ SOURCES += [
     'dummydll.cpp',
 ]
 
 if CONFIG['CPU_ARCH'] == 'x86_64':
   GeckoSharedLibrary('qipcap64')
 else:
   GeckoSharedLibrary('qipcap')
 
-NO_VISIBILITY_FLAGS = True
+NoVisibilityFlags()