1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 'verbose_libraries_build%': 0,
8 'instrumented_libraries_jobs%': 1,
9 'instrumented_libraries_cc%': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
10 'instrumented_libraries_cxx%': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
14 'ubuntu_release': '<!(lsb_release -cs)',
18 'sanitizer_type': 'asan',
21 'sanitizer_type': 'msan',
24 'sanitizer_type': 'tsan',
27 'cc': '<(gomadir)/gomacc <(instrumented_libraries_cc)',
28 'cxx': '<(gomadir)/gomacc <(instrumented_libraries_cxx)',
30 'cc': '<(instrumented_libraries_cc)',
31 'cxx': '<(instrumented_libraries_cxx)',
36 'build_method': 'destdir',
37 # Every package must have --disable-static in configure flags to avoid
38 # building unnecessary static libs. Ideally we should add it here.
39 # Unfortunately, zlib1g doesn't support that flag and for some reason it
40 # can't be removed with a GYP exclusion list. So instead we add that flag
41 # manually to every package but zlib1g.
42 'extra_configure_flags': [],
43 'jobs': '<(instrumented_libraries_jobs)',
50 '-fno-omit-frame-pointer'
54 # We set RPATH=XORIGIN when building the package and replace it with
55 # $ORIGIN later. The reason is that this flag goes through configure/make
56 # differently for different packages. Because of this, we can't escape the
57 # $ character in a way that would work for every package.
68 'package_cflags': ['-fsanitize=address'],
69 'package_ldflags': ['-fsanitize=address'],
74 '-fsanitize-memory-track-origins=<(msan_track_origins)'
76 'package_ldflags': ['-fsanitize=memory'],
79 'package_cflags': ['-fsanitize=thread'],
80 'package_ldflags': ['-fsanitize=thread'],
87 'target_name': 'prebuilt_instrumented_libraries',
90 'prune_self_dependency': 1,
91 # Don't add this target to the dependencies of targets with type=none.
96 ['msan_track_origins==2', {
97 'archive_prefix': 'msan-chained-origins',
100 ['msan_track_origins==0', {
101 'archive_prefix': 'msan-no-origins',
103 'archive_prefix': 'UNSUPPORTED_CONFIGURATION'
107 'archive_prefix': 'UNSUPPORTED_CONFIGURATION'
113 'action_name': 'unpack_<(archive_prefix)-<(_ubuntu_release).tgz',
115 'binaries/<(archive_prefix)-<(_ubuntu_release).tgz',
118 '<(PRODUCT_DIR)/instrumented_libraries_prebuilt/<(archive_prefix).txt',
121 'scripts/unpack_binaries.py',
124 '<(PRODUCT_DIR)/instrumented_libraries_prebuilt/',
128 'direct_dependent_settings': {
129 'target_conditions': [
130 ['_toolset=="target"', {
132 # Add a relative RPATH entry to Chromium binaries. This puts
133 # instrumented DSOs before system-installed versions in library
135 '-Wl,-R,\$$ORIGIN/instrumented_libraries_prebuilt/<(_sanitizer_type)/<(_libdir)/',
143 'target_name': 'instrumented_libraries',
146 'prune_self_dependency': 1,
147 # Don't add this target to the dependencies of targets with type=none.
148 'link_dependency': 1,
150 # NOTE: Please keep install-build-deps.sh in sync with this list.
152 '<(_sanitizer_type)-freetype',
153 '<(_sanitizer_type)-libcairo2',
154 '<(_sanitizer_type)-libexpat1',
155 '<(_sanitizer_type)-libffi6',
156 '<(_sanitizer_type)-libgcrypt11',
157 '<(_sanitizer_type)-libgpg-error0',
158 '<(_sanitizer_type)-libnspr4',
159 '<(_sanitizer_type)-libp11-kit0',
160 '<(_sanitizer_type)-libpcre3',
161 '<(_sanitizer_type)-libpng12-0',
162 '<(_sanitizer_type)-libx11-6',
163 '<(_sanitizer_type)-libxau6',
164 '<(_sanitizer_type)-libxcb1',
165 '<(_sanitizer_type)-libxcomposite1',
166 '<(_sanitizer_type)-libxcursor1',
167 '<(_sanitizer_type)-libxdamage1',
168 '<(_sanitizer_type)-libxdmcp6',
169 '<(_sanitizer_type)-libxext6',
170 '<(_sanitizer_type)-libxfixes3',
171 '<(_sanitizer_type)-libxi6',
172 '<(_sanitizer_type)-libxinerama1',
173 '<(_sanitizer_type)-libxrandr2',
174 '<(_sanitizer_type)-libxrender1',
175 '<(_sanitizer_type)-libxss1',
176 '<(_sanitizer_type)-libxtst6',
177 '<(_sanitizer_type)-zlib1g',
178 '<(_sanitizer_type)-libglib2.0-0',
179 '<(_sanitizer_type)-libdbus-1-3',
180 '<(_sanitizer_type)-libdbus-glib-1-2',
181 '<(_sanitizer_type)-nss',
182 '<(_sanitizer_type)-libfontconfig1',
183 '<(_sanitizer_type)-pulseaudio',
184 '<(_sanitizer_type)-libasound2',
185 '<(_sanitizer_type)-pango1.0',
186 '<(_sanitizer_type)-libcap2',
187 '<(_sanitizer_type)-udev',
188 '<(_sanitizer_type)-libgnome-keyring0',
189 '<(_sanitizer_type)-libgtk2.0-0',
190 '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
191 '<(_sanitizer_type)-libpci3',
192 '<(_sanitizer_type)-libdbusmenu-glib4',
193 '<(_sanitizer_type)-libgconf-2-4',
194 '<(_sanitizer_type)-libappindicator1',
195 '<(_sanitizer_type)-libdbusmenu',
196 '<(_sanitizer_type)-atk1.0',
197 '<(_sanitizer_type)-libunity9',
198 '<(_sanitizer_type)-dee',
199 '<(_sanitizer_type)-libpixman-1-0',
200 '<(_sanitizer_type)-brltty',
201 '<(_sanitizer_type)-libva1',
204 ['"<(_ubuntu_release)"=="precise"', {
206 '<(_sanitizer_type)-libtasn1-3',
211 '<(_sanitizer_type)-libtasn1-6',
212 '<(_sanitizer_type)-harfbuzz',
213 '<(_sanitizer_type)-libsecret',
218 '<(_sanitizer_type)-libcups2',
223 '<(_sanitizer_type)-libpng12-0',
227 'direct_dependent_settings': {
228 'target_conditions': [
229 ['_toolset=="target"', {
231 # Add a relative RPATH entry to Chromium binaries. This puts
232 # instrumented DSOs before system-installed versions in library
234 '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/<(_libdir)/',
242 'package_name': 'freetype',
244 'extra_configure_flags': ['--disable-static'],
245 'pre_build': 'scripts/pre-build/freetype.sh',
246 'includes': ['standard_instrumented_package_target.gypi'],
249 'package_name': 'libcairo2',
251 'extra_configure_flags': [
255 'includes': ['standard_instrumented_package_target.gypi'],
258 'package_name': 'libdbus-1-3',
260 'extra_configure_flags': [
263 '--disable-libaudit',
266 '--libexecdir=/lib/dbus-1.0',
267 '--with-systemdsystemunitdir=/lib/systemd/system',
270 # From dh_auto_configure.
272 '--localstatedir=/var',
274 'includes': ['standard_instrumented_package_target.gypi'],
277 'package_name': 'libdbus-glib-1-2',
279 'extra_configure_flags': [
280 # Use system dbus-binding-tool. The just-built one is instrumented but
281 # doesn't have the correct RPATH, and will crash.
282 '--with-dbus-binding-tool=dbus-binding-tool',
285 'includes': ['standard_instrumented_package_target.gypi'],
288 'package_name': 'libexpat1',
290 'extra_configure_flags': ['--disable-static'],
291 'includes': ['standard_instrumented_package_target.gypi'],
294 'package_name': 'libffi6',
296 'extra_configure_flags': ['--disable-static'],
297 'includes': ['standard_instrumented_package_target.gypi'],
300 'package_name': 'libfontconfig1',
302 'extra_configure_flags': [
304 '--sysconfdir=/etc/',
307 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
310 ['"<(_ubuntu_release)"=="precise"', {
311 'patch': 'patches/libfontconfig.precise.diff',
313 'patch': 'patches/libfontconfig.trusty.diff',
316 'includes': ['standard_instrumented_package_target.gypi'],
319 'package_name': 'libgcrypt11',
321 'package_ldflags': ['-Wl,-z,muldefs'],
322 'extra_configure_flags': [
324 '--enable-noexecstack',
325 '--enable-ld-version-script',
327 # http://crbug.com/344505
330 'includes': ['standard_instrumented_package_target.gypi'],
333 'package_name': 'libglib2.0-0',
335 'extra_configure_flags': [
337 '--disable-gtk-doc-html',
338 '--disable-gtk-doc-pdf',
341 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
342 'msan_blacklist': 'blacklists/msan/libglib2.0-0.txt',
343 'pre_build': 'scripts/pre-build/autogen.sh',
344 'includes': ['standard_instrumented_package_target.gypi'],
347 'package_name': 'libgpg-error0',
349 'extra_configure_flags': ['--disable-static'],
350 'includes': ['standard_instrumented_package_target.gypi'],
353 'package_name': 'libnspr4',
355 'extra_configure_flags': [
358 # TSan reports data races on debug variables.
361 'pre_build': 'scripts/pre-build/libnspr4.sh',
362 'includes': ['standard_instrumented_package_target.gypi'],
365 'package_name': 'libp11-kit0',
367 'extra_configure_flags': ['--disable-static'],
368 # Required on Trusty due to autoconf version mismatch.
369 'pre_build': 'scripts/pre-build/autoreconf.sh',
370 'includes': ['standard_instrumented_package_target.gypi'],
373 'package_name': 'libpcre3',
375 'extra_configure_flags': [
377 '--enable-unicode-properties',
380 'includes': ['standard_instrumented_package_target.gypi'],
383 'package_name': 'libpixman-1-0',
385 'extra_configure_flags': [
389 '--disable-silent-rules',
390 # Avoid a clang issue. http://crbug.com/449183
393 'patch': 'patches/libpixman-1-0.diff',
394 'includes': ['standard_instrumented_package_target.gypi'],
397 'package_name': 'libpng12-0',
399 'extra_configure_flags': ['--disable-static'],
400 'includes': ['standard_instrumented_package_target.gypi'],
403 'package_name': 'libx11-6',
405 'extra_configure_flags': [
409 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
410 # Required on Trusty due to autoconf version mismatch.
411 'pre_build': 'scripts/pre-build/autoreconf.sh',
412 'includes': ['standard_instrumented_package_target.gypi'],
415 'package_name': 'libxau6',
417 'extra_configure_flags': ['--disable-static'],
418 'includes': ['standard_instrumented_package_target.gypi'],
421 'package_name': 'libxcb1',
423 'extra_configure_flags': [
424 '--disable-build-docs',
428 ['"<(_ubuntu_release)"=="precise"', {
429 # Backport fix for https://bugs.freedesktop.org/show_bug.cgi?id=54671
430 'patch': 'patches/libxcb1.precise.diff',
433 # Required on Trusty due to autoconf version mismatch.
434 'pre_build': 'scripts/pre-build/autoreconf.sh',
435 'includes': ['standard_instrumented_package_target.gypi'],
438 'package_name': 'libxcomposite1',
440 'extra_configure_flags': ['--disable-static'],
441 'includes': ['standard_instrumented_package_target.gypi'],
444 'package_name': 'libxcursor1',
446 'extra_configure_flags': ['--disable-static'],
447 'includes': ['standard_instrumented_package_target.gypi'],
450 'package_name': 'libxdamage1',
452 'extra_configure_flags': ['--disable-static'],
453 'includes': ['standard_instrumented_package_target.gypi'],
456 'package_name': 'libxdmcp6',
458 'extra_configure_flags': [
462 'includes': ['standard_instrumented_package_target.gypi'],
465 'package_name': 'libxext6',
467 'extra_configure_flags': [
471 'includes': ['standard_instrumented_package_target.gypi'],
474 'package_name': 'libxfixes3',
476 'extra_configure_flags': ['--disable-static'],
477 'includes': ['standard_instrumented_package_target.gypi'],
480 'package_name': 'libxi6',
482 'extra_configure_flags': [
487 'includes': ['standard_instrumented_package_target.gypi'],
490 'package_name': 'libxinerama1',
492 'extra_configure_flags': ['--disable-static'],
493 'includes': ['standard_instrumented_package_target.gypi'],
496 'package_name': 'libxrandr2',
498 'extra_configure_flags': ['--disable-static'],
499 'includes': ['standard_instrumented_package_target.gypi'],
502 'package_name': 'libxrender1',
504 'extra_configure_flags': ['--disable-static'],
505 'includes': ['standard_instrumented_package_target.gypi'],
508 'package_name': 'libxss1',
510 'extra_configure_flags': ['--disable-static'],
511 'includes': ['standard_instrumented_package_target.gypi'],
514 'package_name': 'libxtst6',
516 'extra_configure_flags': [
520 'includes': ['standard_instrumented_package_target.gypi'],
523 'package_name': 'zlib1g',
525 # --disable-static is not supported
526 'patch': 'patches/zlib1g.diff',
527 'includes': ['standard_instrumented_package_target.gypi'],
530 'package_name': 'nss',
532 # TODO(earthdok): get rid of this dependency
533 '<(_sanitizer_type)-libnspr4',
535 'patch': 'patches/nss.diff',
536 'build_method': 'custom_nss',
537 'includes': ['standard_instrumented_package_target.gypi'],
540 'package_name': 'pulseaudio',
543 ['"<(_ubuntu_release)"=="precise"', {
544 'patch': 'patches/pulseaudio.precise.diff',
547 # New location of libpulsecommon.
548 'package_ldflags': [ '-Wl,-R,XORIGIN/pulseaudio/.' ],
551 'extra_configure_flags': [
555 '--disable-hal-compat',
556 # Disable some ARM-related code that fails compilation. No idea why
557 # this even impacts x86-64 builds.
560 'pre_build': 'scripts/pre-build/pulseaudio.sh',
561 'includes': ['standard_instrumented_package_target.gypi'],
564 'package_name': 'libasound2',
566 'extra_configure_flags': ['--disable-static'],
567 'pre_build': 'scripts/pre-build/libasound2.sh',
568 'includes': ['standard_instrumented_package_target.gypi'],
571 'package_name': 'libcups2',
573 'patch': 'patches/libcups2.diff',
575 'extra_configure_flags': [
577 # All from debian/rules.
578 '--localedir=/usr/share/cups/locale',
587 '--with-dbusdir=/etc/dbus-1',
590 '--with-pdftops=/usr/bin/gs',
592 '--with-cups-group=lp',
593 '--with-system-groups=lpadmin',
594 '--with-printcap=/var/run/cups/printcap',
595 '--with-log-file-perm=0640',
596 '--with-local_protocols="CUPS dnssd"',
597 '--with-remote_protocols="CUPS dnssd"',
600 'includes': ['standard_instrumented_package_target.gypi'],
603 'package_name': 'pango1.0',
605 'extra_configure_flags': [
607 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
608 '--enable-introspection=no',
609 # Pango is normally used with dynamically loaded modules. However,
610 # ensuring pango is able to find instrumented versions of those modules
611 # is a huge pain in the neck. Let's link them statically instead, and
613 '--with-included-modules=yes'
615 'includes': ['standard_instrumented_package_target.gypi'],
618 'package_name': 'libcap2',
620 'extra_configure_flags': ['--disable-static'],
621 'build_method': 'custom_libcap',
622 'includes': ['standard_instrumented_package_target.gypi'],
625 'package_name': 'udev',
627 'extra_configure_flags': [
629 # Without this flag there's a linking step that doesn't honor LDFLAGS
631 # TODO(earthdok): find a better fix.
634 'pre_build': 'scripts/pre-build/udev.sh',
635 'includes': ['standard_instrumented_package_target.gypi'],
638 'package_name': 'libtasn1-3',
640 'extra_configure_flags': [
643 '--enable-ld-version-script',
645 'includes': ['standard_instrumented_package_target.gypi'],
648 'package_name': 'libtasn1-6',
650 'extra_configure_flags': [
653 '--enable-ld-version-script',
655 'includes': ['standard_instrumented_package_target.gypi'],
658 'package_name': 'libgnome-keyring0',
659 'extra_configure_flags': [
662 # Make the build less problematic.
663 '--disable-introspection',
665 'package_ldflags': ['-Wl,--as-needed'],
667 'includes': ['standard_instrumented_package_target.gypi'],
670 'package_name': 'libgtk2.0-0',
671 'package_cflags': ['-Wno-return-type'],
672 'extra_configure_flags': [
677 '--enable-test-print-backend',
678 '--enable-introspection=no',
683 ['"<(_ubuntu_release)"=="precise"', {
684 'patch': 'patches/libgtk2.0-0.precise.diff',
686 'patch': 'patches/libgtk2.0-0.trusty.diff',
689 'pre_build': 'scripts/pre-build/libgtk2.0-0.sh',
690 'includes': ['standard_instrumented_package_target.gypi'],
693 'package_name': 'libgdk-pixbuf2.0-0',
694 'extra_configure_flags': [
699 # Make the build less problematic.
700 '--disable-introspection',
701 # Do not use loadable modules. Same as with Pango, there's no easy way
702 # to make gdk-pixbuf pick instrumented versions over system-installed
707 'pre_build': 'scripts/pre-build/libgdk-pixbuf2.0-0.sh',
708 'includes': ['standard_instrumented_package_target.gypi'],
711 'package_name': 'libpci3',
713 'extra_configure_flags': ['--disable-static'],
714 'build_method': 'custom_libpci3',
716 'includes': ['standard_instrumented_package_target.gypi'],
719 'package_name': 'libdbusmenu-glib4',
720 'extra_configure_flags': [
723 '--disable-scrollkeeper',
725 # --enable-introspection introduces a build step that attempts to run
726 # a just-built binary and crashes. Vala requires introspection.
727 # TODO(earthdok): find a better fix.
728 '--disable-introspection',
732 'pre_build': 'scripts/pre-build/autogen.sh',
733 'includes': ['standard_instrumented_package_target.gypi'],
736 'package_name': 'libgconf-2-4',
737 'extra_configure_flags': [
739 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
743 '--disable-introspection',
746 'includes': ['standard_instrumented_package_target.gypi'],
749 'package_name': 'libappindicator1',
750 'extra_configure_flags': [
753 '--disable-introspection',
757 'pre_build': 'scripts/pre-build/autogen.sh',
758 'includes': ['standard_instrumented_package_target.gypi'],
761 'package_name': 'libdbusmenu',
762 'extra_configure_flags': [
765 '--disable-scrollkeeper',
768 '--disable-introspection',
772 'pre_build': 'scripts/pre-build/autogen.sh',
773 'includes': ['standard_instrumented_package_target.gypi'],
776 'package_name': 'atk1.0',
777 'extra_configure_flags': [
780 '--disable-introspection',
783 'includes': ['standard_instrumented_package_target.gypi'],
786 'package_name': 'libunity9',
788 'extra_configure_flags': ['--disable-static'],
789 'pre_build': 'scripts/pre-build/autogen.sh',
790 'includes': ['standard_instrumented_package_target.gypi'],
793 'package_name': 'dee',
794 'extra_configure_flags': [
797 '--disable-introspection',
800 'pre_build': 'scripts/pre-build/autogen.sh',
801 'includes': ['standard_instrumented_package_target.gypi'],
804 'package_name': 'harfbuzz',
805 'package_cflags': ['-Wno-c++11-narrowing'],
806 'extra_configure_flags': [
809 '--with-graphite2=yes',
812 '--disable-introspection',
815 'includes': ['standard_instrumented_package_target.gypi'],
818 'package_name': 'brltty',
819 'extra_configure_flags': [
822 '--without-viavoice',
826 '--with-curses=ncursesw',
827 '--disable-stripping',
828 # We don't need any of those.
829 '--disable-java-bindings',
830 '--disable-lisp-bindings',
831 '--disable-ocaml-bindings',
832 '--disable-python-bindings',
833 '--disable-tcl-bindings'
836 'includes': ['standard_instrumented_package_target.gypi'],
839 'package_name': 'libva1',
841 'extra_configure_flags': ['--disable-static'],
842 # Backport a use-after-free fix:
843 # http://cgit.freedesktop.org/libva/diff/va/va.c?h=staging&id=d4988142a3f2256e38c5c5cdcdfc1b4f5f3c1ea9
844 'patch': 'patches/libva1.diff',
845 'pre_build': 'scripts/pre-build/libva1.sh',
846 'includes': ['standard_instrumented_package_target.gypi'],
849 'package_name': 'libsecret',
851 'extra_configure_flags': [
854 '--disable-introspection',
856 'pre_build': 'scripts/pre-build/autoreconf.sh',
857 'includes': ['standard_instrumented_package_target.gypi'],