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,
11 'ubuntu_release': '<!(lsb_release -cs)',
15 'sanitizer_type': 'asan',
18 'sanitizer_type': 'msan',
21 'sanitizer_type': 'tsan',
24 'cc': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
25 'cxx': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
27 'cc': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
28 'cxx': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
33 'build_method': 'destdir',
34 'extra_configure_flags': [],
35 'jobs': '<(instrumented_libraries_jobs)',
42 '-fno-omit-frame-pointer'
46 # We set RPATH=XORIGIN when building the package and replace it with
47 # $ORIGIN later. The reason is that this flag goes through configure/make
48 # differently for different packages. Because of this, we can't escape the
49 # $ character in a way that would work for every package.
53 'run_before_build': '',
60 'package_cflags': ['-fsanitize=address'],
61 'package_ldflags': ['-fsanitize=address'],
66 '-fsanitize-memory-track-origins=<(msan_track_origins)'
68 'package_ldflags': ['-fsanitize=memory'],
71 'package_cflags': ['-fsanitize=thread'],
72 'package_ldflags': ['-fsanitize=thread'],
79 'target_name': 'instrumented_libraries',
82 'prune_self_dependency': 1,
83 # Don't add this target to the dependencies of targets with type=none.
86 # NOTE: Please keep install-build-deps.sh in sync with this list.
88 '<(_sanitizer_type)-freetype',
89 '<(_sanitizer_type)-libcairo2',
90 '<(_sanitizer_type)-libexpat1',
91 '<(_sanitizer_type)-libffi6',
92 '<(_sanitizer_type)-libgcrypt11',
93 '<(_sanitizer_type)-libgpg-error0',
94 '<(_sanitizer_type)-libnspr4',
95 '<(_sanitizer_type)-libp11-kit0',
96 '<(_sanitizer_type)-libpcre3',
97 '<(_sanitizer_type)-libpng12-0',
98 '<(_sanitizer_type)-libx11-6',
99 '<(_sanitizer_type)-libxau6',
100 '<(_sanitizer_type)-libxcb1',
101 '<(_sanitizer_type)-libxcomposite1',
102 '<(_sanitizer_type)-libxcursor1',
103 '<(_sanitizer_type)-libxdamage1',
104 '<(_sanitizer_type)-libxdmcp6',
105 '<(_sanitizer_type)-libxext6',
106 '<(_sanitizer_type)-libxfixes3',
107 '<(_sanitizer_type)-libxi6',
108 '<(_sanitizer_type)-libxinerama1',
109 '<(_sanitizer_type)-libxrandr2',
110 '<(_sanitizer_type)-libxrender1',
111 '<(_sanitizer_type)-libxss1',
112 '<(_sanitizer_type)-libxtst6',
113 '<(_sanitizer_type)-zlib1g',
114 '<(_sanitizer_type)-libglib2.0-0',
115 '<(_sanitizer_type)-libdbus-1-3',
116 '<(_sanitizer_type)-libdbus-glib-1-2',
117 '<(_sanitizer_type)-nss',
118 '<(_sanitizer_type)-libfontconfig1',
119 '<(_sanitizer_type)-pulseaudio',
120 '<(_sanitizer_type)-libasound2',
121 '<(_sanitizer_type)-pango1.0',
122 '<(_sanitizer_type)-libcap2',
123 '<(_sanitizer_type)-udev',
124 '<(_sanitizer_type)-libgnome-keyring0',
125 '<(_sanitizer_type)-libgtk2.0-0',
126 '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
127 '<(_sanitizer_type)-libpci3',
128 '<(_sanitizer_type)-libdbusmenu-glib4',
129 '<(_sanitizer_type)-overlay-scrollbar',
130 '<(_sanitizer_type)-libgconf-2-4',
131 '<(_sanitizer_type)-libappindicator1',
132 '<(_sanitizer_type)-libdbusmenu',
133 '<(_sanitizer_type)-atk1.0',
134 '<(_sanitizer_type)-libunity9',
135 '<(_sanitizer_type)-dee',
136 '<(_sanitizer_type)-libpixman-1-0',
139 ['"<(_ubuntu_release)"=="precise"', {
141 '<(_sanitizer_type)-libtasn1-3',
145 '<(_sanitizer_type)-libtasn1-6',
146 '<(_sanitizer_type)-harfbuzz',
151 '<(_sanitizer_type)-libcups2',
156 '<(_sanitizer_type)-libpng12-0',
161 '<(_sanitizer_type)-brltty',
162 '<(_sanitizer_type)-libva1',
166 'direct_dependent_settings': {
167 'target_conditions': [
168 ['_toolset=="target"', {
170 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
171 '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/',
179 'package_name': 'freetype',
181 'run_before_build': 'scripts/freetype.sh',
182 'includes': ['standard_instrumented_package_target.gypi'],
185 'package_name': 'libcairo2',
187 'extra_configure_flags': ['--disable-gtk-doc'],
188 'includes': ['standard_instrumented_package_target.gypi'],
191 'package_name': 'libdbus-1-3',
193 'includes': ['standard_instrumented_package_target.gypi'],
196 'package_name': 'libdbus-glib-1-2',
198 # Use system dbus-binding-tool. The just-built one is instrumented but
199 # doesn't have the correct RPATH, and will crash.
200 'extra_configure_flags': ['--with-dbus-binding-tool=dbus-binding-tool'],
201 'includes': ['standard_instrumented_package_target.gypi'],
204 'package_name': 'libexpat1',
206 'includes': ['standard_instrumented_package_target.gypi'],
209 'package_name': 'libffi6',
211 'includes': ['standard_instrumented_package_target.gypi'],
214 'package_name': 'libfontconfig1',
216 'extra_configure_flags': [
218 '--sysconfdir=/etc/',
220 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
223 ['"<(_ubuntu_release)"=="precise"', {
224 'patch': 'patches/libfontconfig.precise.diff',
226 'patch': 'patches/libfontconfig.trusty.diff',
229 'includes': ['standard_instrumented_package_target.gypi'],
232 'package_name': 'libgcrypt11',
234 'package_ldflags': ['-Wl,-z,muldefs'],
235 'extra_configure_flags': [
237 '--enable-noexecstack',
238 '--enable-ld-version-script',
240 # http://crbug.com/344505
243 'includes': ['standard_instrumented_package_target.gypi'],
246 'package_name': 'libglib2.0-0',
248 'extra_configure_flags': [
250 '--disable-gtk-doc-html',
251 '--disable-gtk-doc-pdf',
253 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
254 'msan_blacklist': 'blacklists/msan/libglib2.0-0.txt',
255 'run_before_build': 'scripts/autogen.sh',
256 'includes': ['standard_instrumented_package_target.gypi'],
259 'package_name': 'libgpg-error0',
261 'includes': ['standard_instrumented_package_target.gypi'],
264 'package_name': 'libnspr4',
266 'extra_configure_flags': [
268 # TSan reports data races on debug variables.
271 'run_before_build': 'scripts/libnspr4.sh',
272 'includes': ['standard_instrumented_package_target.gypi'],
275 'package_name': 'libp11-kit0',
277 # Required on Trusty due to autoconf version mismatch.
278 'run_before_build': 'scripts/autoreconf.sh',
279 'includes': ['standard_instrumented_package_target.gypi'],
282 'package_name': 'libpcre3',
284 'extra_configure_flags': [
286 '--enable-unicode-properties',
288 'includes': ['standard_instrumented_package_target.gypi'],
291 'package_name': 'libpixman-1-0',
293 'extra_configure_flags': [
296 '--disable-silent-rules',
298 'patch': 'patches/libpixman-1-0.diff',
299 'includes': ['standard_instrumented_package_target.gypi'],
302 'package_name': 'libpng12-0',
304 'includes': ['standard_instrumented_package_target.gypi'],
307 'package_name': 'libx11-6',
309 'extra_configure_flags': ['--disable-specs'],
310 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
311 # Required on Trusty due to autoconf version mismatch.
312 'run_before_build': 'scripts/autoreconf.sh',
313 'includes': ['standard_instrumented_package_target.gypi'],
316 'package_name': 'libxau6',
318 'includes': ['standard_instrumented_package_target.gypi'],
321 'package_name': 'libxcb1',
323 'extra_configure_flags': ['--disable-build-docs'],
324 # Required on Trusty due to autoconf version mismatch.
325 'run_before_build': 'scripts/autoreconf.sh',
326 'includes': ['standard_instrumented_package_target.gypi'],
329 'package_name': 'libxcomposite1',
331 'includes': ['standard_instrumented_package_target.gypi'],
334 'package_name': 'libxcursor1',
336 'includes': ['standard_instrumented_package_target.gypi'],
339 'package_name': 'libxdamage1',
341 'includes': ['standard_instrumented_package_target.gypi'],
344 'package_name': 'libxdmcp6',
346 'extra_configure_flags': ['--disable-docs'],
347 'includes': ['standard_instrumented_package_target.gypi'],
350 'package_name': 'libxext6',
352 'extra_configure_flags': ['--disable-specs'],
353 'includes': ['standard_instrumented_package_target.gypi'],
356 'package_name': 'libxfixes3',
358 'includes': ['standard_instrumented_package_target.gypi'],
361 'package_name': 'libxi6',
363 'extra_configure_flags': [
367 'includes': ['standard_instrumented_package_target.gypi'],
370 'package_name': 'libxinerama1',
372 'includes': ['standard_instrumented_package_target.gypi'],
375 'package_name': 'libxrandr2',
377 'includes': ['standard_instrumented_package_target.gypi'],
380 'package_name': 'libxrender1',
382 'includes': ['standard_instrumented_package_target.gypi'],
385 'package_name': 'libxss1',
387 'includes': ['standard_instrumented_package_target.gypi'],
390 'package_name': 'libxtst6',
392 'extra_configure_flags': ['--disable-specs'],
393 'includes': ['standard_instrumented_package_target.gypi'],
396 'package_name': 'zlib1g',
398 'patch': 'patches/zlib1g.diff',
399 'includes': ['standard_instrumented_package_target.gypi'],
402 'package_name': 'nss',
404 # TODO(earthdok): get rid of this dependency
405 '<(_sanitizer_type)-libnspr4',
407 'patch': 'patches/nss.diff',
408 'build_method': 'custom_nss',
409 'includes': ['standard_instrumented_package_target.gypi'],
412 'package_name': 'pulseaudio',
415 ['"<(_ubuntu_release)"=="precise"', {
416 'patch': 'patches/pulseaudio.precise.diff',
419 # New location of libpulsecommon.
420 'package_ldflags': [ '-Wl,-R,XORIGIN/pulseaudio/.' ],
423 'extra_configure_flags': [
426 '--disable-hal-compat',
427 # Disable some ARM-related code that fails compilation. No idea why
428 # this even impacts x86-64 builds.
431 'run_before_build': 'scripts/pulseaudio.sh',
432 'includes': ['standard_instrumented_package_target.gypi'],
435 'package_name': 'libasound2',
437 'run_before_build': 'scripts/libasound2.sh',
438 'includes': ['standard_instrumented_package_target.gypi'],
441 'package_name': 'libcups2',
443 'patch': 'patches/libcups2.diff',
445 'extra_configure_flags': [
446 # All from debian/rules.
447 '--localedir=/usr/share/cups/locale',
457 '--with-dbusdir=/etc/dbus-1',
460 '--with-pdftops=/usr/bin/gs',
462 '--with-cups-group=lp',
463 '--with-system-groups=lpadmin',
464 '--with-printcap=/var/run/cups/printcap',
465 '--with-log-file-perm=0640',
466 '--with-local_protocols="CUPS dnssd"',
467 '--with-remote_protocols="CUPS dnssd"',
470 'includes': ['standard_instrumented_package_target.gypi'],
473 'package_name': 'pango1.0',
475 'extra_configure_flags': [
476 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
477 '--enable-introspection=no',
478 # Pango is normally used with dynamically loaded modules. However,
479 # ensuring pango is able to find instrumented versions of those modules
480 # is a huge pain in the neck. Let's link them statically instead, and
482 '--with-included-modules=yes'
484 'includes': ['standard_instrumented_package_target.gypi'],
487 'package_name': 'libcap2',
489 'build_method': 'custom_libcap',
490 'includes': ['standard_instrumented_package_target.gypi'],
493 'package_name': 'udev',
495 'extra_configure_flags': [
496 # Without this flag there's a linking step that doesn't honor LDFLAGS
498 # TODO(earthdok): find a better fix.
501 'run_before_build': 'scripts/udev.sh',
502 'includes': ['standard_instrumented_package_target.gypi'],
505 'package_name': 'libtasn1-3',
507 'extra_configure_flags': [
509 '--enable-ld-version-script',
511 'includes': ['standard_instrumented_package_target.gypi'],
514 'package_name': 'libtasn1-6',
516 'extra_configure_flags': [
518 '--enable-ld-version-script',
520 'includes': ['standard_instrumented_package_target.gypi'],
523 'package_name': 'libgnome-keyring0',
524 'extra_configure_flags': [
525 # Build static libs (from debian/rules).
528 # Make the build less problematic.
529 '--disable-introspection',
531 'package_ldflags': ['-Wl,--as-needed'],
533 'includes': ['standard_instrumented_package_target.gypi'],
536 'package_name': 'libgtk2.0-0',
537 'package_cflags': ['-Wno-return-type'],
538 'extra_configure_flags': [
542 '--enable-test-print-backend',
543 '--enable-introspection=no',
548 ['"<(_ubuntu_release)"=="precise"', {
549 'patch': 'patches/libgtk2.0-0.precise.diff',
551 'patch': 'patches/libgtk2.0-0.trusty.diff',
554 'run_before_build': 'scripts/libgtk2.0-0.sh',
555 'includes': ['standard_instrumented_package_target.gypi'],
558 'package_name': 'libgdk-pixbuf2.0-0',
559 'extra_configure_flags': [
563 # Make the build less problematic.
564 '--disable-introspection',
567 'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
568 'includes': ['standard_instrumented_package_target.gypi'],
571 'package_name': 'libpci3',
573 'build_method': 'custom_libpci3',
575 'includes': ['standard_instrumented_package_target.gypi'],
578 'package_name': 'libdbusmenu-glib4',
579 'extra_configure_flags': [
581 '--disable-scrollkeeper',
583 # --enable-introspection introduces a build step that attempts to run
584 # a just-built binary and crashes. Vala requires introspection.
585 # TODO(earthdok): find a better fix.
586 '--disable-introspection',
590 'run_before_build': 'scripts/autogen.sh',
591 'includes': ['standard_instrumented_package_target.gypi'],
594 'package_name': 'overlay-scrollbar',
595 'extra_configure_flags': [
599 'run_before_build': 'scripts/autogen.sh',
600 'includes': ['standard_instrumented_package_target.gypi'],
603 'package_name': 'libgconf-2-4',
604 'extra_configure_flags': [
605 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
609 '--disable-introspection',
612 'includes': ['standard_instrumented_package_target.gypi'],
615 'package_name': 'libappindicator1',
616 'extra_configure_flags': [
618 '--disable-introspection',
622 'run_before_build': 'scripts/autogen.sh',
623 'includes': ['standard_instrumented_package_target.gypi'],
626 'package_name': 'libdbusmenu',
627 'extra_configure_flags': [
629 '--disable-scrollkeeper',
632 '--disable-introspection',
636 'run_before_build': 'scripts/autogen.sh',
637 'includes': ['standard_instrumented_package_target.gypi'],
640 'package_name': 'atk1.0',
641 'extra_configure_flags': [
643 '--disable-introspection',
646 'includes': ['standard_instrumented_package_target.gypi'],
649 'package_name': 'libunity9',
651 'run_before_build': 'scripts/autogen.sh',
652 'includes': ['standard_instrumented_package_target.gypi'],
655 'package_name': 'dee',
656 'extra_configure_flags': [
658 '--disable-introspection',
661 'run_before_build': 'scripts/autogen.sh',
662 'includes': ['standard_instrumented_package_target.gypi'],
665 'package_name': 'harfbuzz',
666 'package_cflags': ['-Wno-c++11-narrowing'],
667 'extra_configure_flags': [
669 '--with-graphite2=yes',
672 '--disable-introspection',
675 'includes': ['standard_instrumented_package_target.gypi'],
678 'package_name': 'brltty',
679 'extra_configure_flags': [
681 '--without-viavoice',
685 '--with-curses=ncursesw',
686 '--disable-stripping',
687 # We don't need any of those.
688 '--disable-java-bindings',
689 '--disable-lisp-bindings',
690 '--disable-ocaml-bindings',
691 '--disable-python-bindings',
692 '--disable-tcl-bindings'
695 'includes': ['standard_instrumented_package_target.gypi'],
698 'package_name': 'libva1',
700 # Backport a use-after-free fix:
701 # http://cgit.freedesktop.org/libva/diff/va/va.c?h=staging&id=d4988142a3f2256e38c5c5cdcdfc1b4f5f3c1ea9
702 'patch': 'patches/libva1.diff',
703 'run_before_build': 'scripts/libva1.sh',
704 'includes': ['standard_instrumented_package_target.gypi'],