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 # Every package must have --disable-static in configure flags to avoid
35 # building unnecessary static libs. Ideally we should add it here.
36 # Unfortunately, zlib1g doesn't support that flag and for some reason it
37 # can't be removed with a GYP exclusion list. So instead we add that flag
38 # manually to every package but zlib1g.
39 'extra_configure_flags': [],
40 'jobs': '<(instrumented_libraries_jobs)',
47 '-fno-omit-frame-pointer'
51 # We set RPATH=XORIGIN when building the package and replace it with
52 # $ORIGIN later. The reason is that this flag goes through configure/make
53 # differently for different packages. Because of this, we can't escape the
54 # $ character in a way that would work for every package.
58 'run_before_build': '',
65 'package_cflags': ['-fsanitize=address'],
66 'package_ldflags': ['-fsanitize=address'],
71 '-fsanitize-memory-track-origins=<(msan_track_origins)'
73 'package_ldflags': ['-fsanitize=memory'],
76 'package_cflags': ['-fsanitize=thread'],
77 'package_ldflags': ['-fsanitize=thread'],
84 'target_name': 'instrumented_libraries',
87 'prune_self_dependency': 1,
88 # Don't add this target to the dependencies of targets with type=none.
91 # NOTE: Please keep install-build-deps.sh in sync with this list.
93 '<(_sanitizer_type)-freetype',
94 '<(_sanitizer_type)-libcairo2',
95 '<(_sanitizer_type)-libexpat1',
96 '<(_sanitizer_type)-libffi6',
97 '<(_sanitizer_type)-libgcrypt11',
98 '<(_sanitizer_type)-libgpg-error0',
99 '<(_sanitizer_type)-libnspr4',
100 '<(_sanitizer_type)-libp11-kit0',
101 '<(_sanitizer_type)-libpcre3',
102 '<(_sanitizer_type)-libpng12-0',
103 '<(_sanitizer_type)-libx11-6',
104 '<(_sanitizer_type)-libxau6',
105 '<(_sanitizer_type)-libxcb1',
106 '<(_sanitizer_type)-libxcomposite1',
107 '<(_sanitizer_type)-libxcursor1',
108 '<(_sanitizer_type)-libxdamage1',
109 '<(_sanitizer_type)-libxdmcp6',
110 '<(_sanitizer_type)-libxext6',
111 '<(_sanitizer_type)-libxfixes3',
112 '<(_sanitizer_type)-libxi6',
113 '<(_sanitizer_type)-libxinerama1',
114 '<(_sanitizer_type)-libxrandr2',
115 '<(_sanitizer_type)-libxrender1',
116 '<(_sanitizer_type)-libxss1',
117 '<(_sanitizer_type)-libxtst6',
118 '<(_sanitizer_type)-zlib1g',
119 '<(_sanitizer_type)-libglib2.0-0',
120 '<(_sanitizer_type)-libdbus-1-3',
121 '<(_sanitizer_type)-libdbus-glib-1-2',
122 '<(_sanitizer_type)-nss',
123 '<(_sanitizer_type)-libfontconfig1',
124 '<(_sanitizer_type)-pulseaudio',
125 '<(_sanitizer_type)-libasound2',
126 '<(_sanitizer_type)-pango1.0',
127 '<(_sanitizer_type)-libcap2',
128 '<(_sanitizer_type)-udev',
129 '<(_sanitizer_type)-libgnome-keyring0',
130 '<(_sanitizer_type)-libgtk2.0-0',
131 '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
132 '<(_sanitizer_type)-libpci3',
133 '<(_sanitizer_type)-libdbusmenu-glib4',
134 '<(_sanitizer_type)-libgconf-2-4',
135 '<(_sanitizer_type)-libappindicator1',
136 '<(_sanitizer_type)-libdbusmenu',
137 '<(_sanitizer_type)-atk1.0',
138 '<(_sanitizer_type)-libunity9',
139 '<(_sanitizer_type)-dee',
140 '<(_sanitizer_type)-libpixman-1-0',
143 ['"<(_ubuntu_release)"=="precise"', {
145 '<(_sanitizer_type)-libtasn1-3',
150 '<(_sanitizer_type)-libtasn1-6',
151 '<(_sanitizer_type)-harfbuzz',
152 '<(_sanitizer_type)-libsecret',
157 '<(_sanitizer_type)-libcups2',
162 '<(_sanitizer_type)-libpng12-0',
167 '<(_sanitizer_type)-brltty',
168 '<(_sanitizer_type)-libva1',
172 'direct_dependent_settings': {
173 'target_conditions': [
174 ['_toolset=="target"', {
176 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
177 '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/',
185 'package_name': 'freetype',
187 'extra_configure_flags': ['--disable-static'],
188 'run_before_build': 'scripts/freetype.sh',
189 'includes': ['standard_instrumented_package_target.gypi'],
192 'package_name': 'libcairo2',
194 'extra_configure_flags': [
198 'includes': ['standard_instrumented_package_target.gypi'],
201 'package_name': 'libdbus-1-3',
203 'extra_configure_flags': ['--disable-static'],
204 'includes': ['standard_instrumented_package_target.gypi'],
207 'package_name': 'libdbus-glib-1-2',
209 'extra_configure_flags': [
210 # Use system dbus-binding-tool. The just-built one is instrumented but
211 # doesn't have the correct RPATH, and will crash.
212 '--with-dbus-binding-tool=dbus-binding-tool',
215 'includes': ['standard_instrumented_package_target.gypi'],
218 'package_name': 'libexpat1',
220 'extra_configure_flags': ['--disable-static'],
221 'includes': ['standard_instrumented_package_target.gypi'],
224 'package_name': 'libffi6',
226 'extra_configure_flags': ['--disable-static'],
227 'includes': ['standard_instrumented_package_target.gypi'],
230 'package_name': 'libfontconfig1',
232 'extra_configure_flags': [
234 '--sysconfdir=/etc/',
237 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
240 ['"<(_ubuntu_release)"=="precise"', {
241 'patch': 'patches/libfontconfig.precise.diff',
243 'patch': 'patches/libfontconfig.trusty.diff',
246 'includes': ['standard_instrumented_package_target.gypi'],
249 'package_name': 'libgcrypt11',
251 'package_ldflags': ['-Wl,-z,muldefs'],
252 'extra_configure_flags': [
254 '--enable-noexecstack',
255 '--enable-ld-version-script',
257 # http://crbug.com/344505
260 'includes': ['standard_instrumented_package_target.gypi'],
263 'package_name': 'libglib2.0-0',
265 'extra_configure_flags': [
267 '--disable-gtk-doc-html',
268 '--disable-gtk-doc-pdf',
271 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
272 'msan_blacklist': 'blacklists/msan/libglib2.0-0.txt',
273 'run_before_build': 'scripts/autogen.sh',
274 'includes': ['standard_instrumented_package_target.gypi'],
277 'package_name': 'libgpg-error0',
279 'extra_configure_flags': ['--disable-static'],
280 'includes': ['standard_instrumented_package_target.gypi'],
283 'package_name': 'libnspr4',
285 'extra_configure_flags': [
288 # TSan reports data races on debug variables.
291 'run_before_build': 'scripts/libnspr4.sh',
292 'includes': ['standard_instrumented_package_target.gypi'],
295 'package_name': 'libp11-kit0',
297 'extra_configure_flags': ['--disable-static'],
298 # Required on Trusty due to autoconf version mismatch.
299 'run_before_build': 'scripts/autoreconf.sh',
300 'includes': ['standard_instrumented_package_target.gypi'],
303 'package_name': 'libpcre3',
305 'extra_configure_flags': [
307 '--enable-unicode-properties',
310 'includes': ['standard_instrumented_package_target.gypi'],
313 'package_name': 'libpixman-1-0',
315 'extra_configure_flags': [
319 '--disable-silent-rules',
320 # Avoid a clang issue. http://crbug.com/449183
323 'patch': 'patches/libpixman-1-0.diff',
324 'includes': ['standard_instrumented_package_target.gypi'],
327 'package_name': 'libpng12-0',
329 'extra_configure_flags': ['--disable-static'],
330 'includes': ['standard_instrumented_package_target.gypi'],
333 'package_name': 'libx11-6',
335 'extra_configure_flags': [
339 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
340 # Required on Trusty due to autoconf version mismatch.
341 'run_before_build': 'scripts/autoreconf.sh',
342 'includes': ['standard_instrumented_package_target.gypi'],
345 'package_name': 'libxau6',
347 'extra_configure_flags': ['--disable-static'],
348 'includes': ['standard_instrumented_package_target.gypi'],
351 'package_name': 'libxcb1',
353 'extra_configure_flags': [
354 '--disable-build-docs',
358 ['"<(_ubuntu_release)"=="precise"', {
359 # Backport fix for https://bugs.freedesktop.org/show_bug.cgi?id=54671
360 'patch': 'patches/libxcb1.precise.diff',
363 # Required on Trusty due to autoconf version mismatch.
364 'run_before_build': 'scripts/autoreconf.sh',
365 'includes': ['standard_instrumented_package_target.gypi'],
368 'package_name': 'libxcomposite1',
370 'extra_configure_flags': ['--disable-static'],
371 'includes': ['standard_instrumented_package_target.gypi'],
374 'package_name': 'libxcursor1',
376 'extra_configure_flags': ['--disable-static'],
377 'includes': ['standard_instrumented_package_target.gypi'],
380 'package_name': 'libxdamage1',
382 'extra_configure_flags': ['--disable-static'],
383 'includes': ['standard_instrumented_package_target.gypi'],
386 'package_name': 'libxdmcp6',
388 'extra_configure_flags': [
392 'includes': ['standard_instrumented_package_target.gypi'],
395 'package_name': 'libxext6',
397 'extra_configure_flags': [
401 'includes': ['standard_instrumented_package_target.gypi'],
404 'package_name': 'libxfixes3',
406 'extra_configure_flags': ['--disable-static'],
407 'includes': ['standard_instrumented_package_target.gypi'],
410 'package_name': 'libxi6',
412 'extra_configure_flags': [
417 'includes': ['standard_instrumented_package_target.gypi'],
420 'package_name': 'libxinerama1',
422 'extra_configure_flags': ['--disable-static'],
423 'includes': ['standard_instrumented_package_target.gypi'],
426 'package_name': 'libxrandr2',
428 'extra_configure_flags': ['--disable-static'],
429 'includes': ['standard_instrumented_package_target.gypi'],
432 'package_name': 'libxrender1',
434 'extra_configure_flags': ['--disable-static'],
435 'includes': ['standard_instrumented_package_target.gypi'],
438 'package_name': 'libxss1',
440 'extra_configure_flags': ['--disable-static'],
441 'includes': ['standard_instrumented_package_target.gypi'],
444 'package_name': 'libxtst6',
446 'extra_configure_flags': [
450 'includes': ['standard_instrumented_package_target.gypi'],
453 'package_name': 'zlib1g',
455 # --disable-static is not supported
456 'patch': 'patches/zlib1g.diff',
457 'includes': ['standard_instrumented_package_target.gypi'],
460 'package_name': 'nss',
462 # TODO(earthdok): get rid of this dependency
463 '<(_sanitizer_type)-libnspr4',
465 'patch': 'patches/nss.diff',
466 'build_method': 'custom_nss',
467 'includes': ['standard_instrumented_package_target.gypi'],
470 'package_name': 'pulseaudio',
473 ['"<(_ubuntu_release)"=="precise"', {
474 'patch': 'patches/pulseaudio.precise.diff',
477 # New location of libpulsecommon.
478 'package_ldflags': [ '-Wl,-R,XORIGIN/pulseaudio/.' ],
481 'extra_configure_flags': [
485 '--disable-hal-compat',
486 # Disable some ARM-related code that fails compilation. No idea why
487 # this even impacts x86-64 builds.
490 'run_before_build': 'scripts/pulseaudio.sh',
491 'includes': ['standard_instrumented_package_target.gypi'],
494 'package_name': 'libasound2',
496 'extra_configure_flags': ['--disable-static'],
497 'run_before_build': 'scripts/libasound2.sh',
498 'includes': ['standard_instrumented_package_target.gypi'],
501 'package_name': 'libcups2',
503 'patch': 'patches/libcups2.diff',
505 'extra_configure_flags': [
507 # All from debian/rules.
508 '--localedir=/usr/share/cups/locale',
517 '--with-dbusdir=/etc/dbus-1',
520 '--with-pdftops=/usr/bin/gs',
522 '--with-cups-group=lp',
523 '--with-system-groups=lpadmin',
524 '--with-printcap=/var/run/cups/printcap',
525 '--with-log-file-perm=0640',
526 '--with-local_protocols="CUPS dnssd"',
527 '--with-remote_protocols="CUPS dnssd"',
530 'includes': ['standard_instrumented_package_target.gypi'],
533 'package_name': 'pango1.0',
535 'extra_configure_flags': [
537 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
538 '--enable-introspection=no',
539 # Pango is normally used with dynamically loaded modules. However,
540 # ensuring pango is able to find instrumented versions of those modules
541 # is a huge pain in the neck. Let's link them statically instead, and
543 '--with-included-modules=yes'
545 'includes': ['standard_instrumented_package_target.gypi'],
548 'package_name': 'libcap2',
550 'extra_configure_flags': ['--disable-static'],
551 'build_method': 'custom_libcap',
552 'includes': ['standard_instrumented_package_target.gypi'],
555 'package_name': 'udev',
557 'extra_configure_flags': [
559 # Without this flag there's a linking step that doesn't honor LDFLAGS
561 # TODO(earthdok): find a better fix.
564 'run_before_build': 'scripts/udev.sh',
565 'includes': ['standard_instrumented_package_target.gypi'],
568 'package_name': 'libtasn1-3',
570 'extra_configure_flags': [
573 '--enable-ld-version-script',
575 'includes': ['standard_instrumented_package_target.gypi'],
578 'package_name': 'libtasn1-6',
580 'extra_configure_flags': [
583 '--enable-ld-version-script',
585 'includes': ['standard_instrumented_package_target.gypi'],
588 'package_name': 'libgnome-keyring0',
589 'extra_configure_flags': [
592 # Make the build less problematic.
593 '--disable-introspection',
595 'package_ldflags': ['-Wl,--as-needed'],
597 'includes': ['standard_instrumented_package_target.gypi'],
600 'package_name': 'libgtk2.0-0',
601 'package_cflags': ['-Wno-return-type'],
602 'extra_configure_flags': [
607 '--enable-test-print-backend',
608 '--enable-introspection=no',
613 ['"<(_ubuntu_release)"=="precise"', {
614 'patch': 'patches/libgtk2.0-0.precise.diff',
616 'patch': 'patches/libgtk2.0-0.trusty.diff',
619 'run_before_build': 'scripts/libgtk2.0-0.sh',
620 'includes': ['standard_instrumented_package_target.gypi'],
623 'package_name': 'libgdk-pixbuf2.0-0',
624 'extra_configure_flags': [
629 # Make the build less problematic.
630 '--disable-introspection',
631 # Do not use loadable modules. Same as with Pango, there's no easy way
632 # to make gdk-pixbuf pick instrumented versions over system-installed
637 'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
638 'includes': ['standard_instrumented_package_target.gypi'],
641 'package_name': 'libpci3',
643 'extra_configure_flags': ['--disable-static'],
644 'build_method': 'custom_libpci3',
646 'includes': ['standard_instrumented_package_target.gypi'],
649 'package_name': 'libdbusmenu-glib4',
650 'extra_configure_flags': [
653 '--disable-scrollkeeper',
655 # --enable-introspection introduces a build step that attempts to run
656 # a just-built binary and crashes. Vala requires introspection.
657 # TODO(earthdok): find a better fix.
658 '--disable-introspection',
662 'run_before_build': 'scripts/autogen.sh',
663 'includes': ['standard_instrumented_package_target.gypi'],
666 'package_name': 'libgconf-2-4',
667 'extra_configure_flags': [
669 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
673 '--disable-introspection',
676 'includes': ['standard_instrumented_package_target.gypi'],
679 'package_name': 'libappindicator1',
680 'extra_configure_flags': [
683 '--disable-introspection',
687 'run_before_build': 'scripts/autogen.sh',
688 'includes': ['standard_instrumented_package_target.gypi'],
691 'package_name': 'libdbusmenu',
692 'extra_configure_flags': [
695 '--disable-scrollkeeper',
698 '--disable-introspection',
702 'run_before_build': 'scripts/autogen.sh',
703 'includes': ['standard_instrumented_package_target.gypi'],
706 'package_name': 'atk1.0',
707 'extra_configure_flags': [
710 '--disable-introspection',
713 'includes': ['standard_instrumented_package_target.gypi'],
716 'package_name': 'libunity9',
718 'extra_configure_flags': ['--disable-static'],
719 'run_before_build': 'scripts/autogen.sh',
720 'includes': ['standard_instrumented_package_target.gypi'],
723 'package_name': 'dee',
724 'extra_configure_flags': [
727 '--disable-introspection',
730 'run_before_build': 'scripts/autogen.sh',
731 'includes': ['standard_instrumented_package_target.gypi'],
734 'package_name': 'harfbuzz',
735 'package_cflags': ['-Wno-c++11-narrowing'],
736 'extra_configure_flags': [
739 '--with-graphite2=yes',
742 '--disable-introspection',
745 'includes': ['standard_instrumented_package_target.gypi'],
748 'package_name': 'brltty',
749 'extra_configure_flags': [
752 '--without-viavoice',
756 '--with-curses=ncursesw',
757 '--disable-stripping',
758 # We don't need any of those.
759 '--disable-java-bindings',
760 '--disable-lisp-bindings',
761 '--disable-ocaml-bindings',
762 '--disable-python-bindings',
763 '--disable-tcl-bindings'
766 'includes': ['standard_instrumented_package_target.gypi'],
769 'package_name': 'libva1',
771 'extra_configure_flags': ['--disable-static'],
772 # Backport a use-after-free fix:
773 # http://cgit.freedesktop.org/libva/diff/va/va.c?h=staging&id=d4988142a3f2256e38c5c5cdcdfc1b4f5f3c1ea9
774 'patch': 'patches/libva1.diff',
775 'run_before_build': 'scripts/libva1.sh',
776 'includes': ['standard_instrumented_package_target.gypi'],
779 'package_name': 'libsecret',
781 'extra_configure_flags': [
784 '--disable-introspection',
786 'run_before_build': 'scripts/autoreconf.sh',
787 'includes': ['standard_instrumented_package_target.gypi'],