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,
13 'sanitizer_type': 'asan',
16 'sanitizer_type': 'msan',
19 'sanitizer_type': 'tsan',
22 'cc': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
23 'cxx': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
25 'cc': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
26 'cxx': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
31 'build_method': 'destdir',
32 'extra_configure_flags': [],
33 'jobs': '<(instrumented_libraries_jobs)',
43 # We set RPATH=XORIGIN when building the package and replace it with
44 # $ORIGIN later. The reason is that this flag goes through configure/make
45 # differently for different packages. Because of this, we can't escape the
46 # $ character in a way that would work for every package.
50 'run_before_build': '',
57 'package_cflags': ['-fsanitize=address'],
58 'package_ldflags': ['-fsanitize=address'],
63 '-fsanitize-memory-track-origins=<(msan_track_origins)'
65 'package_ldflags': ['-fsanitize=memory'],
68 'package_cflags': ['-fsanitize=thread'],
69 'package_ldflags': ['-fsanitize=thread'],
76 'target_name': 'instrumented_libraries',
79 'prune_self_dependency': 1,
80 # Don't add this target to the dependencies of targets with type=none.
84 '<(_sanitizer_type)-freetype',
85 '<(_sanitizer_type)-libcairo2',
86 '<(_sanitizer_type)-libexpat1',
87 '<(_sanitizer_type)-libffi6',
88 '<(_sanitizer_type)-libgcrypt11',
89 '<(_sanitizer_type)-libgpg-error0',
90 '<(_sanitizer_type)-libnspr4',
91 '<(_sanitizer_type)-libp11-kit0',
92 '<(_sanitizer_type)-libpcre3',
93 '<(_sanitizer_type)-libpng12-0',
94 '<(_sanitizer_type)-libx11-6',
95 '<(_sanitizer_type)-libxau6',
96 '<(_sanitizer_type)-libxcb1',
97 '<(_sanitizer_type)-libxcomposite1',
98 '<(_sanitizer_type)-libxcursor1',
99 '<(_sanitizer_type)-libxdamage1',
100 '<(_sanitizer_type)-libxdmcp6',
101 '<(_sanitizer_type)-libxext6',
102 '<(_sanitizer_type)-libxfixes3',
103 '<(_sanitizer_type)-libxi6',
104 '<(_sanitizer_type)-libxinerama1',
105 '<(_sanitizer_type)-libxrandr2',
106 '<(_sanitizer_type)-libxrender1',
107 '<(_sanitizer_type)-libxss1',
108 '<(_sanitizer_type)-libxtst6',
109 '<(_sanitizer_type)-zlib1g',
110 '<(_sanitizer_type)-libglib2.0-0',
111 '<(_sanitizer_type)-libdbus-1-3',
112 '<(_sanitizer_type)-libdbus-glib-1-2',
113 '<(_sanitizer_type)-nss',
114 '<(_sanitizer_type)-libfontconfig1',
115 '<(_sanitizer_type)-pulseaudio',
116 '<(_sanitizer_type)-libasound2',
117 '<(_sanitizer_type)-pango1.0',
118 '<(_sanitizer_type)-libcap2',
119 '<(_sanitizer_type)-libudev0',
120 '<(_sanitizer_type)-libtasn1-3',
121 '<(_sanitizer_type)-libgnome-keyring0',
122 '<(_sanitizer_type)-libgtk2.0-0',
123 '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
124 '<(_sanitizer_type)-libpci3',
125 '<(_sanitizer_type)-libdbusmenu-glib4',
126 '<(_sanitizer_type)-liboverlay-scrollbar-0.2-0',
127 '<(_sanitizer_type)-libgconf-2-4',
128 '<(_sanitizer_type)-libappindicator1',
129 '<(_sanitizer_type)-libdbusmenu',
130 '<(_sanitizer_type)-atk1.0',
131 '<(_sanitizer_type)-libunity9',
132 '<(_sanitizer_type)-dee',
137 '<(_sanitizer_type)-libpixman-1-0',
142 '<(_sanitizer_type)-libcups2',
147 '<(_sanitizer_type)-libpng12-0',
153 'action_name': 'fix_rpaths',
158 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',
161 '<(DEPTH)/third_party/instrumented_libraries/fix_rpaths.sh',
162 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'
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/:\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/usr/lib/x86_64-linux-gnu/',
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',
222 'patch': 'patches/libfontconfig.diff',
223 'includes': ['standard_instrumented_package_target.gypi'],
226 'package_name': 'libgcrypt11',
228 'package_ldflags': ['-Wl,-z,muldefs'],
229 'extra_configure_flags': [
231 '--enable-noexecstack',
232 '--enable-ld-version-script',
234 # http://crbug.com/344505
237 'includes': ['standard_instrumented_package_target.gypi'],
240 'package_name': 'libglib2.0-0',
242 'extra_configure_flags': [
244 '--disable-gtk-doc-html',
245 '--disable-gtk-doc-pdf',
247 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
248 'includes': ['standard_instrumented_package_target.gypi'],
251 'package_name': 'libgpg-error0',
253 'includes': ['standard_instrumented_package_target.gypi'],
256 'package_name': 'libnspr4',
258 'extra_configure_flags': [
260 # TSan reports data races on debug variables.
263 'run_before_build': 'scripts/libnspr4.sh',
264 'includes': ['standard_instrumented_package_target.gypi'],
267 'package_name': 'libp11-kit0',
269 'includes': ['standard_instrumented_package_target.gypi'],
272 'package_name': 'libpcre3',
274 'extra_configure_flags': [
276 '--enable-unicode-properties',
278 'includes': ['standard_instrumented_package_target.gypi'],
281 'package_name': 'libpixman-1-0',
283 'patch': 'patches/libpixman-1-0.diff',
284 'includes': ['standard_instrumented_package_target.gypi'],
287 'package_name': 'libpng12-0',
289 'includes': ['standard_instrumented_package_target.gypi'],
292 'package_name': 'libx11-6',
294 'extra_configure_flags': ['--disable-specs'],
295 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
296 'includes': ['standard_instrumented_package_target.gypi'],
299 'package_name': 'libxau6',
301 'includes': ['standard_instrumented_package_target.gypi'],
304 'package_name': 'libxcb1',
306 'extra_configure_flags': ['--disable-build-docs'],
307 'includes': ['standard_instrumented_package_target.gypi'],
310 'package_name': 'libxcomposite1',
312 'includes': ['standard_instrumented_package_target.gypi'],
315 'package_name': 'libxcursor1',
317 'includes': ['standard_instrumented_package_target.gypi'],
320 'package_name': 'libxdamage1',
322 'includes': ['standard_instrumented_package_target.gypi'],
325 'package_name': 'libxdmcp6',
327 'extra_configure_flags': ['--disable-docs'],
328 'includes': ['standard_instrumented_package_target.gypi'],
331 'package_name': 'libxext6',
333 'extra_configure_flags': ['--disable-specs'],
334 'includes': ['standard_instrumented_package_target.gypi'],
337 'package_name': 'libxfixes3',
339 'includes': ['standard_instrumented_package_target.gypi'],
342 'package_name': 'libxi6',
344 'extra_configure_flags': [
348 'includes': ['standard_instrumented_package_target.gypi'],
351 'package_name': 'libxinerama1',
353 'includes': ['standard_instrumented_package_target.gypi'],
356 'package_name': 'libxrandr2',
358 'includes': ['standard_instrumented_package_target.gypi'],
361 'package_name': 'libxrender1',
363 'includes': ['standard_instrumented_package_target.gypi'],
366 'package_name': 'libxss1',
368 'includes': ['standard_instrumented_package_target.gypi'],
371 'package_name': 'libxtst6',
373 'extra_configure_flags': ['--disable-specs'],
374 'includes': ['standard_instrumented_package_target.gypi'],
377 'package_name': 'zlib1g',
379 'patch': 'patches/zlib1g.diff',
380 'includes': ['standard_instrumented_package_target.gypi'],
383 'package_name': 'nss',
385 # TODO(earthdok): get rid of this dependency
386 '<(_sanitizer_type)-libnspr4',
388 'patch': 'patches/nss.diff',
389 'build_method': 'custom_nss',
390 'includes': ['standard_instrumented_package_target.gypi'],
393 'package_name': 'pulseaudio',
395 'patch': 'patches/pulseaudio.diff',
396 'run_before_build': 'scripts/pulseaudio.sh',
398 'includes': ['standard_instrumented_package_target.gypi'],
401 'package_name': 'libasound2',
403 'run_before_build': 'scripts/libasound2.sh',
404 'includes': ['standard_instrumented_package_target.gypi'],
407 'package_name': 'libcups2',
409 'patch': 'patches/libcups2.diff',
411 'extra_configure_flags': [
412 # All from debian/rules.
413 '--localedir=/usr/share/cups/locale',
423 '--with-dbusdir=/etc/dbus-1',
426 '--with-pdftops=/usr/bin/gs',
428 '--with-cups-group=lp',
429 '--with-system-groups=lpadmin',
430 '--with-printcap=/var/run/cups/printcap',
431 '--with-log-file-perm=0640',
432 '--with-local_protocols="CUPS dnssd"',
433 '--with-remote_protocols="CUPS dnssd"',
436 'includes': ['standard_instrumented_package_target.gypi'],
439 'package_name': 'pango1.0',
441 'extra_configure_flags': [
442 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
443 '--enable-introspection=no',
444 # Pango is normally used with dynamically loaded modules. However,
445 # ensuring pango is able to find instrumented versions of those modules
446 # is a huge pain in the neck. Let's link them statically instead, and
448 '--with-included-modules=yes'
450 'includes': ['standard_instrumented_package_target.gypi'],
453 'package_name': 'libcap2',
455 'build_method': 'custom_libcap',
456 'includes': ['standard_instrumented_package_target.gypi'],
459 'package_name': 'libudev0',
461 'extra_configure_flags': [
462 # Without this flag there's a linking step that doesn't honor LDFLAGS
464 # TODO(earthdok): find a better fix.
467 'includes': ['standard_instrumented_package_target.gypi'],
470 'package_name': 'libtasn1-3',
472 'includes': ['standard_instrumented_package_target.gypi'],
475 'package_name': 'libgnome-keyring0',
476 'extra_configure_flags': [
477 # Build static libs (from debian/rules).
481 'package_ldflags': ['-Wl,--as-needed'],
483 'includes': ['standard_instrumented_package_target.gypi'],
486 'package_name': 'libgtk2.0-0',
487 'package_cflags': ['-Wno-return-type'],
488 'extra_configure_flags': [
492 '--enable-test-print-backend',
493 '--enable-introspection=no',
497 'patch': 'patches/libgtk2.0-0.diff',
498 'run_before_build': 'scripts/libgtk2.0-0.sh',
499 'includes': ['standard_instrumented_package_target.gypi'],
502 'package_name': 'libgdk-pixbuf2.0-0',
503 'extra_configure_flags': [
507 # Make the build less problematic.
508 '--disable-introspection',
511 'patch': 'patches/libgdk-pixbuf2.0-0.diff',
512 'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
513 'includes': ['standard_instrumented_package_target.gypi'],
516 'package_name': 'libpci3',
518 'build_method': 'custom_libpci3',
520 'includes': ['standard_instrumented_package_target.gypi'],
523 'package_name': 'libdbusmenu-glib4',
524 'extra_configure_flags': [
526 '--disable-scrollkeeper',
528 # --enable-introspection introduces a build step that attempts to run
529 # a just-built binary and crashes. Vala requires introspection.
530 # TODO(earthdok): find a better fix.
531 '--disable-introspection',
535 'includes': ['standard_instrumented_package_target.gypi'],
538 'package_name': 'liboverlay-scrollbar-0.2-0',
539 'extra_configure_flags': [
543 'includes': ['standard_instrumented_package_target.gypi'],
546 'package_name': 'libgconf-2-4',
547 'extra_configure_flags': [
548 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
552 '--disable-introspection',
555 'includes': ['standard_instrumented_package_target.gypi'],
558 'package_name': 'libappindicator1',
559 'extra_configure_flags': [
561 '--disable-introspection',
565 'includes': ['standard_instrumented_package_target.gypi'],
568 'package_name': 'libdbusmenu',
569 'extra_configure_flags': [
571 '--disable-scrollkeeper',
574 '--disable-introspection',
578 'includes': ['standard_instrumented_package_target.gypi'],
581 'package_name': 'atk1.0',
582 'extra_configure_flags': [
584 '--disable-introspection',
587 'includes': ['standard_instrumented_package_target.gypi'],
590 'package_name': 'libunity9',
592 'includes': ['standard_instrumented_package_target.gypi'],
595 'package_name': 'dee',
596 'extra_configure_flags': [
598 '--disable-introspection',
601 'includes': ['standard_instrumented_package_target.gypi'],