diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 12:57:50 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 12:57:50 +0000 |
commit | def451e3a6164e43e21014619933aab386f2ed44 (patch) | |
tree | 27663345fa0406118b0d1c5263934f534e76d561 /third_party/instrumented_libraries/instrumented_libraries.gyp | |
parent | 916748e373646c3f626e06af7d75ef0185a7cb92 (diff) | |
download | chromium_src-def451e3a6164e43e21014619933aab386f2ed44.zip chromium_src-def451e3a6164e43e21014619933aab386f2ed44.tar.gz chromium_src-def451e3a6164e43e21014619933aab386f2ed44.tar.bz2 |
Instrumented libraries: move build-flags-related logic to the GYP file.
- Keep both the general and package-specific CFLAGS/LDFLAGS in the GYP file, and
pass only the final flags to the script. This allows us to simplify things
somewhat, as well as easily change the build flags based on GYP defines.
- Consequently, the global msan_track_origins GYP flag now also affects
instrumented libraries.
- I also threw in a mass renaming "library" -> "package".
BUG=313751
R=glider@chromium.org
NOTRY=true
TEST=MSan
Review URL: https://codereview.chromium.org/337613008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279699 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/instrumented_libraries/instrumented_libraries.gyp')
-rw-r--r-- | third_party/instrumented_libraries/instrumented_libraries.gyp | 281 |
1 files changed, 156 insertions, 125 deletions
diff --git a/third_party/instrumented_libraries/instrumented_libraries.gyp b/third_party/instrumented_libraries/instrumented_libraries.gyp index 919f8fe..479d7db 100644 --- a/third_party/instrumented_libraries/instrumented_libraries.gyp +++ b/third_party/instrumented_libraries/instrumented_libraries.gyp @@ -3,33 +3,20 @@ # found in the LICENSE file. { - # Default value for all libraries. - 'extra_configure_flags': '', - 'extra_cflags': '', - 'extra_cxxflags': '', - 'extra_ldflags': '', - 'run_before_build': '', - 'build_method': 'destdir', - 'variables': { 'verbose_libraries_build%': 0, 'instrumented_libraries_jobs%': 1, }, - 'jobs': '<(instrumented_libraries_jobs)', - 'conditions': [ ['asan==1', { 'sanitizer_type': 'asan', - 'sanitizer_blacklist': '', }], ['msan==1', { 'sanitizer_type': 'msan', - 'sanitizer_blacklist': '<(msan_blacklist)', }], ['tsan==1', { 'sanitizer_type': 'tsan', - 'sanitizer_blacklist': '<(tsan_blacklist)', }], ['use_goma==1', { 'cc': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang', @@ -39,6 +26,50 @@ 'cxx': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++', }], ], + + 'target_defaults': { + 'build_method': 'destdir', + 'extra_configure_flags': [], + 'jobs': '<(instrumented_libraries_jobs)', + 'package_cflags': [ + '-O2', + '-gline-tables-only', + '-fPIC', + '-w', + '-U_FORITFY_SOURCE' + ], + 'package_ldflags': [ + '-Wl,-z,origin', + # We set RPATH=XORIGIN when building the package and replace it with + # $ORIGIN later. The reason is that this flag goes through configure/make + # differently for different packages. Because of this, we can't escape the + # $ character in a way that would work for every package. + '-Wl,-R,XORIGIN/.' + ], + 'run_before_build': '', + + 'conditions': [ + ['asan==1', { + 'sanitizer_blacklist': '', + 'package_cflags': ['-fsanitize=address'], + 'package_ldflags': ['-fsanitize=address'], + }], + ['msan==1', { + 'sanitizer_blacklist': '<(msan_blacklist)', + 'package_cflags': [ + '-fsanitize=memory', + '-fsanitize-memory-track-origins=<(msan_track_origins)' + ], + 'package_ldflags': ['-fsanitize=memory'], + }], + ['tsan==1', { + 'sanitizer_blacklist': '<(tsan_blacklist)', + 'package_cflags': ['-fsanitize=thread'], + 'package_ldflags': ['-fsanitize=thread'], + }], + ], + }, + 'targets': [ { 'target_name': 'instrumented_libraries', @@ -143,46 +174,46 @@ }, }, { - 'library_name': 'freetype', + 'package_name': 'freetype', 'dependencies=': [], 'run_before_build': 'freetype.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libcairo2', + 'package_name': 'libcairo2', 'dependencies=': [], - 'extra_configure_flags': '--disable-gtk-doc', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--disable-gtk-doc'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libdbus-1-3', + 'package_name': 'libdbus-1-3', 'dependencies=': [ '<(_sanitizer_type)-libglib2.0-0', ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libdbus-glib-1-2', + 'package_name': 'libdbus-glib-1-2', 'dependencies=': [ '<(_sanitizer_type)-libglib2.0-0', ], # Use system dbus-binding-tool. The just-built one is instrumented but # doesn't have the correct RPATH, and will crash. - 'extra_configure_flags': '--with-dbus-binding-tool=dbus-binding-tool', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--with-dbus-binding-tool=dbus-binding-tool'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libexpat1', + 'package_name': 'libexpat1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libffi6', + 'package_name': 'libffi6', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libfontconfig1', + 'package_name': 'libfontconfig1', 'dependencies=': [ '<(_sanitizer_type)-freetype', ], @@ -193,31 +224,31 @@ '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts', ], 'run_before_build': 'libfontconfig.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libgcrypt11', + 'package_name': 'libgcrypt11', 'dependencies=': [], - 'extra_ldflags': '-Wl,-z,muldefs', - 'includes': ['standard_instrumented_library_target.gypi'], + 'package_ldflags': ['-Wl,-z,muldefs'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libglib2.0-0', + 'package_name': 'libglib2.0-0', 'dependencies=': [], 'extra_configure_flags': [ '--disable-gtk-doc', '--disable-gtk-doc-html', '--disable-gtk-doc-pdf', ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libgpg-error0', + 'package_name': 'libgpg-error0', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libnspr4', + 'package_name': 'libnspr4', 'dependencies=': [], 'extra_configure_flags': [ '--enable-64bit', @@ -225,150 +256,150 @@ '--disable-debug', ], 'run_before_build': 'libnspr4.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libp11-kit0', + 'package_name': 'libp11-kit0', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libpcre3', + 'package_name': 'libpcre3', 'dependencies=': [], 'extra_configure_flags': [ '--enable-utf8', '--enable-unicode-properties', ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libpixman-1-0', + 'package_name': 'libpixman-1-0', 'dependencies=': [ '<(_sanitizer_type)-libglib2.0-0', ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libpng12-0', + 'package_name': 'libpng12-0', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libx11-6', + 'package_name': 'libx11-6', 'dependencies=': [], - 'extra_configure_flags': '--disable-specs', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--disable-specs'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxau6', + 'package_name': 'libxau6', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxcb1', + 'package_name': 'libxcb1', 'dependencies=': [], - 'extra_configure_flags': '--disable-build-docs', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--disable-build-docs'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxcomposite1', + 'package_name': 'libxcomposite1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxcursor1', + 'package_name': 'libxcursor1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxdamage1', + 'package_name': 'libxdamage1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxdmcp6', + 'package_name': 'libxdmcp6', 'dependencies=': [], - 'extra_configure_flags': '--disable-docs', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--disable-docs'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxext6', + 'package_name': 'libxext6', 'dependencies=': [], - 'extra_configure_flags': '--disable-specs', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--disable-specs'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxfixes3', + 'package_name': 'libxfixes3', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxi6', + 'package_name': 'libxi6', 'dependencies=': [], 'extra_configure_flags': [ '--disable-specs', '--disable-docs', ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxinerama1', + 'package_name': 'libxinerama1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxrandr2', + 'package_name': 'libxrandr2', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxrender1', + 'package_name': 'libxrender1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxss1', + 'package_name': 'libxss1', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libxtst6', + 'package_name': 'libxtst6', 'dependencies=': [], - 'extra_configure_flags': '--disable-specs', - 'includes': ['standard_instrumented_library_target.gypi'], + 'extra_configure_flags': ['--disable-specs'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'zlib1g', + 'package_name': 'zlib1g', 'dependencies=': [], 'run_before_build': 'zlib1g.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'nss', + 'package_name': 'nss', 'dependencies=': [ '<(_sanitizer_type)-libnspr4', ], 'run_before_build': 'nss.sh', 'build_method': 'custom_nss', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'pulseaudio', + 'package_name': 'pulseaudio', 'dependencies=': [ '<(_sanitizer_type)-libdbus-1-3', ], 'run_before_build': 'pulseaudio.sh', 'jobs': 1, - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libasound2', + 'package_name': 'libasound2', 'dependencies=': [], 'run_before_build': 'libasound2.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libcups2', + 'package_name': 'libcups2', 'dependencies=': [], 'run_before_build': 'libcups2.sh', 'jobs': 1, @@ -397,10 +428,10 @@ '--with-remote_protocols="CUPS dnssd"', '--enable-libusb', ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'pango1.0', + 'package_name': 'pango1.0', 'dependencies=': [ '<(_sanitizer_type)-libglib2.0-0', ], @@ -409,16 +440,16 @@ '--enable-introspection=no', ], 'build_method': 'custom_pango', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libcap2', + 'package_name': 'libcap2', 'dependencies=': [], 'build_method': 'custom_libcap', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libudev0', + 'package_name': 'libudev0', 'dependencies=': [], 'extra_configure_flags': [ # Without this flag there's a linking step that doesn't honor LDFLAGS @@ -426,27 +457,27 @@ # TODO(earthdok): find a better fix. '--disable-gudev' ], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libtasn1-3', + 'package_name': 'libtasn1-3', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libgnome-keyring0', + 'package_name': 'libgnome-keyring0', 'extra_configure_flags': [ # Build static libs (from debian/rules). '--enable-static', '--enable-tests=no', ], - 'extra_ldflags': '-Wl,--as-needed', + 'package_ldflags': ['-Wl,--as-needed'], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libgtk2.0-0', - 'extra_cflags': '-Wno-return-type', + 'package_name': 'libgtk2.0-0', + 'package_cflags': ['-Wno-return-type'], 'extra_configure_flags': [ # From debian/rules. '--prefix=/usr', @@ -457,10 +488,10 @@ ], 'dependencies=': [], 'run_before_build': 'libgtk2.0-0.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libgdk-pixbuf2.0-0', + 'package_name': 'libgdk-pixbuf2.0-0', 'extra_configure_flags': [ # From debian/rules. '--with-libjasper', @@ -470,17 +501,17 @@ ], 'dependencies=': [], 'run_before_build': 'libgdk-pixbuf2.0-0.sh', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libpci3', + 'package_name': 'libpci3', 'dependencies=': [], 'build_method': 'custom_libpci3', 'jobs': 1, - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libdbusmenu-glib4', + 'package_name': 'libdbusmenu-glib4', 'extra_configure_flags': [ # From debian/rules. '--disable-scrollkeeper', @@ -492,18 +523,18 @@ '--disable-vala', ], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'liboverlay-scrollbar-0.2-0', + 'package_name': 'liboverlay-scrollbar-0.2-0', 'extra_configure_flags': [ '--with-gtk=2', ], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libgconf-2-4', + 'package_name': 'libgconf-2-4', 'extra_configure_flags': [ # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.) '--with-gtk=3.0', @@ -512,20 +543,20 @@ '--disable-introspection', ], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libappindicator1', + 'package_name': 'libappindicator1', 'extra_configure_flags': [ # See above. '--disable-introspection', ], 'dependencies=': [], 'build_method': 'custom_libappindicator1', - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libdbusmenu', + 'package_name': 'libdbusmenu', 'extra_configure_flags': [ # From debian/rules. '--disable-scrollkeeper', @@ -535,30 +566,30 @@ '--disable-vala', ], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'atk1.0', + 'package_name': 'atk1.0', 'extra_configure_flags': [ # See above. '--disable-introspection', ], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'libunity9', + 'package_name': 'libunity9', 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, { - 'library_name': 'dee', + 'package_name': 'dee', 'extra_configure_flags': [ # See above. '--disable-introspection', ], 'dependencies=': [], - 'includes': ['standard_instrumented_library_target.gypi'], + 'includes': ['standard_instrumented_package_target.gypi'], }, ], } |