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.
87 '<(_sanitizer_type)-freetype',
88 '<(_sanitizer_type)-libcairo2',
89 '<(_sanitizer_type)-libexpat1',
90 '<(_sanitizer_type)-libffi6',
91 '<(_sanitizer_type)-libgcrypt11',
92 '<(_sanitizer_type)-libgpg-error0',
93 '<(_sanitizer_type)-libnspr4',
94 '<(_sanitizer_type)-libp11-kit0',
95 '<(_sanitizer_type)-libpcre3',
96 '<(_sanitizer_type)-libpng12-0',
97 '<(_sanitizer_type)-libx11-6',
98 '<(_sanitizer_type)-libxau6',
99 '<(_sanitizer_type)-libxcb1',
100 '<(_sanitizer_type)-libxcomposite1',
101 '<(_sanitizer_type)-libxcursor1',
102 '<(_sanitizer_type)-libxdamage1',
103 '<(_sanitizer_type)-libxdmcp6',
104 '<(_sanitizer_type)-libxext6',
105 '<(_sanitizer_type)-libxfixes3',
106 '<(_sanitizer_type)-libxi6',
107 '<(_sanitizer_type)-libxinerama1',
108 '<(_sanitizer_type)-libxrandr2',
109 '<(_sanitizer_type)-libxrender1',
110 '<(_sanitizer_type)-libxss1',
111 '<(_sanitizer_type)-libxtst6',
112 '<(_sanitizer_type)-zlib1g',
113 '<(_sanitizer_type)-libglib2.0-0',
114 '<(_sanitizer_type)-libdbus-1-3',
115 '<(_sanitizer_type)-libdbus-glib-1-2',
116 '<(_sanitizer_type)-nss',
117 '<(_sanitizer_type)-libfontconfig1',
118 '<(_sanitizer_type)-pulseaudio',
119 '<(_sanitizer_type)-libasound2',
120 '<(_sanitizer_type)-pango1.0',
121 '<(_sanitizer_type)-libcap2',
122 '<(_sanitizer_type)-udev',
123 '<(_sanitizer_type)-libtasn1-3',
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',
140 '<(_sanitizer_type)-libpixman-1-0',
145 '<(_sanitizer_type)-libcups2',
150 '<(_sanitizer_type)-libpng12-0',
156 'action_name': 'fix_rpaths',
161 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',
165 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'
169 'direct_dependent_settings': {
170 'target_conditions': [
171 ['_toolset=="target"', {
173 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
174 '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/:\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/usr/lib/x86_64-linux-gnu/',
182 'package_name': 'freetype',
184 'run_before_build': 'scripts/freetype.sh',
185 'includes': ['standard_instrumented_package_target.gypi'],
188 'package_name': 'libcairo2',
190 'extra_configure_flags': ['--disable-gtk-doc'],
191 'includes': ['standard_instrumented_package_target.gypi'],
194 'package_name': 'libdbus-1-3',
196 'includes': ['standard_instrumented_package_target.gypi'],
199 'package_name': 'libdbus-glib-1-2',
201 # Use system dbus-binding-tool. The just-built one is instrumented but
202 # doesn't have the correct RPATH, and will crash.
203 'extra_configure_flags': ['--with-dbus-binding-tool=dbus-binding-tool'],
204 'includes': ['standard_instrumented_package_target.gypi'],
207 'package_name': 'libexpat1',
209 'includes': ['standard_instrumented_package_target.gypi'],
212 'package_name': 'libffi6',
214 'includes': ['standard_instrumented_package_target.gypi'],
217 'package_name': 'libfontconfig1',
219 'extra_configure_flags': [
221 '--sysconfdir=/etc/',
223 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
226 ['"<(_ubuntu_release)"=="precise"', {
227 'patch': 'patches/libfontconfig.precise.diff',
229 'patch': 'patches/libfontconfig.trusty.diff',
232 'includes': ['standard_instrumented_package_target.gypi'],
235 'package_name': 'libgcrypt11',
237 'package_ldflags': ['-Wl,-z,muldefs'],
238 'extra_configure_flags': [
240 '--enable-noexecstack',
241 '--enable-ld-version-script',
243 # http://crbug.com/344505
246 'includes': ['standard_instrumented_package_target.gypi'],
249 'package_name': 'libglib2.0-0',
251 'extra_configure_flags': [
253 '--disable-gtk-doc-html',
254 '--disable-gtk-doc-pdf',
256 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
257 'run_before_build': 'scripts/autogen.sh',
258 'includes': ['standard_instrumented_package_target.gypi'],
261 'package_name': 'libgpg-error0',
263 'includes': ['standard_instrumented_package_target.gypi'],
266 'package_name': 'libnspr4',
268 'extra_configure_flags': [
270 # TSan reports data races on debug variables.
273 'run_before_build': 'scripts/libnspr4.sh',
274 'includes': ['standard_instrumented_package_target.gypi'],
277 'package_name': 'libp11-kit0',
279 # Required on Trusty due to autoconf version mismatch.
280 'run_before_build': 'scripts/autoreconf.sh',
281 'includes': ['standard_instrumented_package_target.gypi'],
284 'package_name': 'libpcre3',
286 'extra_configure_flags': [
288 '--enable-unicode-properties',
290 'includes': ['standard_instrumented_package_target.gypi'],
293 'package_name': 'libpixman-1-0',
295 'patch': 'patches/libpixman-1-0.diff',
296 'includes': ['standard_instrumented_package_target.gypi'],
299 'package_name': 'libpng12-0',
301 'includes': ['standard_instrumented_package_target.gypi'],
304 'package_name': 'libx11-6',
306 'extra_configure_flags': ['--disable-specs'],
307 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
308 # Required on Trusty due to autoconf version mismatch.
309 'run_before_build': 'scripts/autoreconf.sh',
310 'includes': ['standard_instrumented_package_target.gypi'],
313 'package_name': 'libxau6',
315 'includes': ['standard_instrumented_package_target.gypi'],
318 'package_name': 'libxcb1',
320 'extra_configure_flags': ['--disable-build-docs'],
321 # Required on Trusty due to autoconf version mismatch.
322 'run_before_build': 'scripts/autoreconf.sh',
323 'includes': ['standard_instrumented_package_target.gypi'],
326 'package_name': 'libxcomposite1',
328 'includes': ['standard_instrumented_package_target.gypi'],
331 'package_name': 'libxcursor1',
333 'includes': ['standard_instrumented_package_target.gypi'],
336 'package_name': 'libxdamage1',
338 'includes': ['standard_instrumented_package_target.gypi'],
341 'package_name': 'libxdmcp6',
343 'extra_configure_flags': ['--disable-docs'],
344 'includes': ['standard_instrumented_package_target.gypi'],
347 'package_name': 'libxext6',
349 'extra_configure_flags': ['--disable-specs'],
350 'includes': ['standard_instrumented_package_target.gypi'],
353 'package_name': 'libxfixes3',
355 'includes': ['standard_instrumented_package_target.gypi'],
358 'package_name': 'libxi6',
360 'extra_configure_flags': [
364 'includes': ['standard_instrumented_package_target.gypi'],
367 'package_name': 'libxinerama1',
369 'includes': ['standard_instrumented_package_target.gypi'],
372 'package_name': 'libxrandr2',
374 'includes': ['standard_instrumented_package_target.gypi'],
377 'package_name': 'libxrender1',
379 'includes': ['standard_instrumented_package_target.gypi'],
382 'package_name': 'libxss1',
384 'includes': ['standard_instrumented_package_target.gypi'],
387 'package_name': 'libxtst6',
389 'extra_configure_flags': ['--disable-specs'],
390 'includes': ['standard_instrumented_package_target.gypi'],
393 'package_name': 'zlib1g',
395 'patch': 'patches/zlib1g.diff',
396 'includes': ['standard_instrumented_package_target.gypi'],
399 'package_name': 'nss',
401 # TODO(earthdok): get rid of this dependency
402 '<(_sanitizer_type)-libnspr4',
404 'patch': 'patches/nss.diff',
405 'build_method': 'custom_nss',
406 'includes': ['standard_instrumented_package_target.gypi'],
409 'package_name': 'pulseaudio',
411 'patch': 'patches/pulseaudio.diff',
412 'run_before_build': 'scripts/pulseaudio.sh',
414 'includes': ['standard_instrumented_package_target.gypi'],
417 'package_name': 'libasound2',
419 'run_before_build': 'scripts/libasound2.sh',
420 'includes': ['standard_instrumented_package_target.gypi'],
423 'package_name': 'libcups2',
425 'patch': 'patches/libcups2.diff',
427 'extra_configure_flags': [
428 # All from debian/rules.
429 '--localedir=/usr/share/cups/locale',
439 '--with-dbusdir=/etc/dbus-1',
442 '--with-pdftops=/usr/bin/gs',
444 '--with-cups-group=lp',
445 '--with-system-groups=lpadmin',
446 '--with-printcap=/var/run/cups/printcap',
447 '--with-log-file-perm=0640',
448 '--with-local_protocols="CUPS dnssd"',
449 '--with-remote_protocols="CUPS dnssd"',
452 'includes': ['standard_instrumented_package_target.gypi'],
455 'package_name': 'pango1.0',
457 'extra_configure_flags': [
458 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
459 '--enable-introspection=no',
460 # Pango is normally used with dynamically loaded modules. However,
461 # ensuring pango is able to find instrumented versions of those modules
462 # is a huge pain in the neck. Let's link them statically instead, and
464 '--with-included-modules=yes'
466 'includes': ['standard_instrumented_package_target.gypi'],
469 'package_name': 'libcap2',
471 'build_method': 'custom_libcap',
472 'includes': ['standard_instrumented_package_target.gypi'],
475 'package_name': 'udev',
477 'extra_configure_flags': [
478 # Without this flag there's a linking step that doesn't honor LDFLAGS
480 # TODO(earthdok): find a better fix.
483 # Required on Trusty due to autoconf version mismatch.
484 'run_before_build': 'scripts/autoreconf.sh',
485 'includes': ['standard_instrumented_package_target.gypi'],
488 'package_name': 'libtasn1-3',
490 'includes': ['standard_instrumented_package_target.gypi'],
493 'package_name': 'libgnome-keyring0',
494 'extra_configure_flags': [
495 # Build static libs (from debian/rules).
498 # Make the build less problematic.
499 '--disable-introspection',
501 'package_ldflags': ['-Wl,--as-needed'],
503 'includes': ['standard_instrumented_package_target.gypi'],
506 'package_name': 'libgtk2.0-0',
507 'package_cflags': ['-Wno-return-type'],
508 'extra_configure_flags': [
512 '--enable-test-print-backend',
513 '--enable-introspection=no',
518 ['"<(_ubuntu_release)"=="precise"', {
519 'patch': 'patches/libgtk2.0-0.precise.diff',
521 'patch': 'patches/libgtk2.0-0.trusty.diff',
524 'run_before_build': 'scripts/libgtk2.0-0.sh',
525 'includes': ['standard_instrumented_package_target.gypi'],
528 'package_name': 'libgdk-pixbuf2.0-0',
529 'extra_configure_flags': [
533 # Make the build less problematic.
534 '--disable-introspection',
537 'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
538 'includes': ['standard_instrumented_package_target.gypi'],
541 'package_name': 'libpci3',
543 'build_method': 'custom_libpci3',
545 'includes': ['standard_instrumented_package_target.gypi'],
548 'package_name': 'libdbusmenu-glib4',
549 'extra_configure_flags': [
551 '--disable-scrollkeeper',
553 # --enable-introspection introduces a build step that attempts to run
554 # a just-built binary and crashes. Vala requires introspection.
555 # TODO(earthdok): find a better fix.
556 '--disable-introspection',
560 'run_before_build': 'scripts/autogen.sh',
561 'includes': ['standard_instrumented_package_target.gypi'],
564 'package_name': 'overlay-scrollbar',
565 'extra_configure_flags': [
569 'run_before_build': 'scripts/autogen.sh',
570 'includes': ['standard_instrumented_package_target.gypi'],
573 'package_name': 'libgconf-2-4',
574 'extra_configure_flags': [
575 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
579 '--disable-introspection',
582 'includes': ['standard_instrumented_package_target.gypi'],
585 'package_name': 'libappindicator1',
586 'extra_configure_flags': [
588 '--disable-introspection',
592 'run_before_build': 'scripts/autogen.sh',
593 'includes': ['standard_instrumented_package_target.gypi'],
596 'package_name': 'libdbusmenu',
597 'extra_configure_flags': [
599 '--disable-scrollkeeper',
602 '--disable-introspection',
606 'run_before_build': 'scripts/autogen.sh',
607 'includes': ['standard_instrumented_package_target.gypi'],
610 'package_name': 'atk1.0',
611 'extra_configure_flags': [
613 '--disable-introspection',
616 'includes': ['standard_instrumented_package_target.gypi'],
619 'package_name': 'libunity9',
621 'run_before_build': 'scripts/autogen.sh',
622 'includes': ['standard_instrumented_package_target.gypi'],
625 'package_name': 'dee',
626 'extra_configure_flags': [
628 '--disable-introspection',
631 'run_before_build': 'scripts/autogen.sh',
632 'includes': ['standard_instrumented_package_target.gypi'],