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)-libcairo2',
85 '<(_sanitizer_type)-libexpat1',
86 '<(_sanitizer_type)-libffi6',
87 '<(_sanitizer_type)-libgcrypt11',
88 '<(_sanitizer_type)-libgpg-error0',
89 '<(_sanitizer_type)-libnspr4',
90 '<(_sanitizer_type)-libp11-kit0',
91 '<(_sanitizer_type)-libpcre3',
92 '<(_sanitizer_type)-libpng12-0',
93 '<(_sanitizer_type)-libx11-6',
94 '<(_sanitizer_type)-libxau6',
95 '<(_sanitizer_type)-libxcb1',
96 '<(_sanitizer_type)-libxcomposite1',
97 '<(_sanitizer_type)-libxcursor1',
98 '<(_sanitizer_type)-libxdamage1',
99 '<(_sanitizer_type)-libxdmcp6',
100 '<(_sanitizer_type)-libxext6',
101 '<(_sanitizer_type)-libxfixes3',
102 '<(_sanitizer_type)-libxi6',
103 '<(_sanitizer_type)-libxinerama1',
104 '<(_sanitizer_type)-libxrandr2',
105 '<(_sanitizer_type)-libxrender1',
106 '<(_sanitizer_type)-libxss1',
107 '<(_sanitizer_type)-libxtst6',
108 '<(_sanitizer_type)-zlib1g',
109 '<(_sanitizer_type)-libglib2.0-0',
110 '<(_sanitizer_type)-libdbus-1-3',
111 '<(_sanitizer_type)-libdbus-glib-1-2',
112 '<(_sanitizer_type)-nss',
113 '<(_sanitizer_type)-libfontconfig1',
114 '<(_sanitizer_type)-pulseaudio',
115 '<(_sanitizer_type)-libasound2',
116 '<(_sanitizer_type)-pango1.0',
117 '<(_sanitizer_type)-libcap2',
118 '<(_sanitizer_type)-libudev0',
119 '<(_sanitizer_type)-libtasn1-3',
120 '<(_sanitizer_type)-libgnome-keyring0',
121 '<(_sanitizer_type)-libgtk2.0-0',
122 '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
123 '<(_sanitizer_type)-libpci3',
124 '<(_sanitizer_type)-libdbusmenu-glib4',
125 '<(_sanitizer_type)-liboverlay-scrollbar-0.2-0',
126 '<(_sanitizer_type)-libgconf-2-4',
127 '<(_sanitizer_type)-libappindicator1',
128 '<(_sanitizer_type)-libdbusmenu',
129 '<(_sanitizer_type)-atk1.0',
130 '<(_sanitizer_type)-libunity9',
131 '<(_sanitizer_type)-dee',
136 '<(_sanitizer_type)-libpixman-1-0',
141 '<(_sanitizer_type)-libcups2',
146 '<(_sanitizer_type)-libpng12-0',
152 'action_name': 'fix_rpaths',
157 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',
160 '<(DEPTH)/third_party/instrumented_libraries/fix_rpaths.sh',
161 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'
165 'direct_dependent_settings': {
166 'target_conditions': [
167 ['_toolset=="target"', {
169 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
170 '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/:\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/usr/lib/x86_64-linux-gnu/',
178 'package_name': 'freetype',
180 'run_before_build': 'scripts/freetype.sh',
181 'includes': ['standard_instrumented_package_target.gypi'],
184 'package_name': 'libcairo2',
186 'extra_configure_flags': ['--disable-gtk-doc'],
187 'includes': ['standard_instrumented_package_target.gypi'],
190 'package_name': 'libdbus-1-3',
192 '<(_sanitizer_type)-libglib2.0-0',
194 'includes': ['standard_instrumented_package_target.gypi'],
197 'package_name': 'libdbus-glib-1-2',
199 '<(_sanitizer_type)-libglib2.0-0',
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 '<(_sanitizer_type)-freetype',
221 'extra_configure_flags': [
223 '--sysconfdir=/etc/',
225 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
227 'patch': 'patches/libfontconfig.diff',
228 'includes': ['standard_instrumented_package_target.gypi'],
231 'package_name': 'libgcrypt11',
233 'package_ldflags': ['-Wl,-z,muldefs'],
234 'extra_configure_flags': [
236 '--enable-noexecstack',
237 '--enable-ld-version-script',
239 # http://crbug.com/344505
242 'includes': ['standard_instrumented_package_target.gypi'],
245 'package_name': 'libglib2.0-0',
247 'extra_configure_flags': [
249 '--disable-gtk-doc-html',
250 '--disable-gtk-doc-pdf',
252 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
253 'includes': ['standard_instrumented_package_target.gypi'],
256 'package_name': 'libgpg-error0',
258 'includes': ['standard_instrumented_package_target.gypi'],
261 'package_name': 'libnspr4',
263 'extra_configure_flags': [
265 # TSan reports data races on debug variables.
268 'run_before_build': 'scripts/libnspr4.sh',
269 'includes': ['standard_instrumented_package_target.gypi'],
272 'package_name': 'libp11-kit0',
274 'includes': ['standard_instrumented_package_target.gypi'],
277 'package_name': 'libpcre3',
279 'extra_configure_flags': [
281 '--enable-unicode-properties',
283 'includes': ['standard_instrumented_package_target.gypi'],
286 'package_name': 'libpixman-1-0',
288 '<(_sanitizer_type)-libglib2.0-0',
290 'includes': ['standard_instrumented_package_target.gypi'],
293 'package_name': 'libpng12-0',
295 'includes': ['standard_instrumented_package_target.gypi'],
298 'package_name': 'libx11-6',
300 'extra_configure_flags': ['--disable-specs'],
301 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
302 'includes': ['standard_instrumented_package_target.gypi'],
305 'package_name': 'libxau6',
307 'includes': ['standard_instrumented_package_target.gypi'],
310 'package_name': 'libxcb1',
312 'extra_configure_flags': ['--disable-build-docs'],
313 'includes': ['standard_instrumented_package_target.gypi'],
316 'package_name': 'libxcomposite1',
318 'includes': ['standard_instrumented_package_target.gypi'],
321 'package_name': 'libxcursor1',
323 'includes': ['standard_instrumented_package_target.gypi'],
326 'package_name': 'libxdamage1',
328 'includes': ['standard_instrumented_package_target.gypi'],
331 'package_name': 'libxdmcp6',
333 'extra_configure_flags': ['--disable-docs'],
334 'includes': ['standard_instrumented_package_target.gypi'],
337 'package_name': 'libxext6',
339 'extra_configure_flags': ['--disable-specs'],
340 'includes': ['standard_instrumented_package_target.gypi'],
343 'package_name': 'libxfixes3',
345 'includes': ['standard_instrumented_package_target.gypi'],
348 'package_name': 'libxi6',
350 'extra_configure_flags': [
354 'includes': ['standard_instrumented_package_target.gypi'],
357 'package_name': 'libxinerama1',
359 'includes': ['standard_instrumented_package_target.gypi'],
362 'package_name': 'libxrandr2',
364 'includes': ['standard_instrumented_package_target.gypi'],
367 'package_name': 'libxrender1',
369 'includes': ['standard_instrumented_package_target.gypi'],
372 'package_name': 'libxss1',
374 'includes': ['standard_instrumented_package_target.gypi'],
377 'package_name': 'libxtst6',
379 'extra_configure_flags': ['--disable-specs'],
380 'includes': ['standard_instrumented_package_target.gypi'],
383 'package_name': 'zlib1g',
385 'patch': 'patches/zlib1g.diff',
386 'includes': ['standard_instrumented_package_target.gypi'],
389 'package_name': 'nss',
391 '<(_sanitizer_type)-libnspr4',
393 'patch': 'patches/nss.diff',
394 'build_method': 'custom_nss',
395 'includes': ['standard_instrumented_package_target.gypi'],
398 'package_name': 'pulseaudio',
400 '<(_sanitizer_type)-libdbus-1-3',
402 'patch': 'patches/pulseaudio.diff',
403 'run_before_build': 'scripts/pulseaudio.sh',
405 'includes': ['standard_instrumented_package_target.gypi'],
408 'package_name': 'libasound2',
410 'run_before_build': 'scripts/libasound2.sh',
411 'includes': ['standard_instrumented_package_target.gypi'],
414 'package_name': 'libcups2',
416 'patch': 'patches/libcups2.diff',
418 'extra_configure_flags': [
419 # All from debian/rules.
420 '--localedir=/usr/share/cups/locale',
430 '--with-dbusdir=/etc/dbus-1',
433 '--with-pdftops=/usr/bin/gs',
435 '--with-cups-group=lp',
436 '--with-system-groups=lpadmin',
437 '--with-printcap=/var/run/cups/printcap',
438 '--with-log-file-perm=0640',
439 '--with-local_protocols="CUPS dnssd"',
440 '--with-remote_protocols="CUPS dnssd"',
443 'includes': ['standard_instrumented_package_target.gypi'],
446 'package_name': 'pango1.0',
448 '<(_sanitizer_type)-libglib2.0-0',
450 'extra_configure_flags': [
451 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
452 '--enable-introspection=no',
453 # Pango is normally used with dynamically loaded modules. However,
454 # ensuring pango is able to find instrumented versions of those modules
455 # is a huge pain in the neck. Let's link them statically instead, and
457 '--with-included-modules=yes'
459 'includes': ['standard_instrumented_package_target.gypi'],
462 'package_name': 'libcap2',
464 'build_method': 'custom_libcap',
465 'includes': ['standard_instrumented_package_target.gypi'],
468 'package_name': 'libudev0',
470 'extra_configure_flags': [
471 # Without this flag there's a linking step that doesn't honor LDFLAGS
473 # TODO(earthdok): find a better fix.
476 'includes': ['standard_instrumented_package_target.gypi'],
479 'package_name': 'libtasn1-3',
481 'includes': ['standard_instrumented_package_target.gypi'],
484 'package_name': 'libgnome-keyring0',
485 'extra_configure_flags': [
486 # Build static libs (from debian/rules).
490 'package_ldflags': ['-Wl,--as-needed'],
492 'includes': ['standard_instrumented_package_target.gypi'],
495 'package_name': 'libgtk2.0-0',
496 'package_cflags': ['-Wno-return-type'],
497 'extra_configure_flags': [
501 '--enable-test-print-backend',
502 '--enable-introspection=no',
506 'patch': 'patches/libgtk2.0-0.diff',
507 'run_before_build': 'scripts/libgtk2.0-0.sh',
508 'includes': ['standard_instrumented_package_target.gypi'],
511 'package_name': 'libgdk-pixbuf2.0-0',
512 'extra_configure_flags': [
516 # Make the build less problematic.
517 '--disable-introspection',
520 'patch': 'patches/libgdk-pixbuf2.0-0.diff',
521 'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
522 'includes': ['standard_instrumented_package_target.gypi'],
525 'package_name': 'libpci3',
527 'build_method': 'custom_libpci3',
529 'includes': ['standard_instrumented_package_target.gypi'],
532 'package_name': 'libdbusmenu-glib4',
533 'extra_configure_flags': [
535 '--disable-scrollkeeper',
537 # --enable-introspection introduces a build step that attempts to run
538 # a just-built binary and crashes. Vala requires introspection.
539 # TODO(earthdok): find a better fix.
540 '--disable-introspection',
544 'includes': ['standard_instrumented_package_target.gypi'],
547 'package_name': 'liboverlay-scrollbar-0.2-0',
548 'extra_configure_flags': [
552 'includes': ['standard_instrumented_package_target.gypi'],
555 'package_name': 'libgconf-2-4',
556 'extra_configure_flags': [
557 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
561 '--disable-introspection',
564 'includes': ['standard_instrumented_package_target.gypi'],
567 'package_name': 'libappindicator1',
568 'extra_configure_flags': [
570 '--disable-introspection',
574 'includes': ['standard_instrumented_package_target.gypi'],
577 'package_name': 'libdbusmenu',
578 'extra_configure_flags': [
580 '--disable-scrollkeeper',
583 '--disable-introspection',
587 'includes': ['standard_instrumented_package_target.gypi'],
590 'package_name': 'atk1.0',
591 'extra_configure_flags': [
593 '--disable-introspection',
596 'includes': ['standard_instrumented_package_target.gypi'],
599 'package_name': 'libunity9',
601 'includes': ['standard_instrumented_package_target.gypi'],
604 'package_name': 'dee',
605 'extra_configure_flags': [
607 '--disable-introspection',
610 'includes': ['standard_instrumented_package_target.gypi'],