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': '',
54 'sanitizer_blacklist': '',
55 'package_cflags': ['-fsanitize=address'],
56 'package_ldflags': ['-fsanitize=address'],
59 'sanitizer_blacklist': '<(msan_blacklist)',
62 '-fsanitize-memory-track-origins=<(msan_track_origins)'
64 'package_ldflags': ['-fsanitize=memory'],
67 'sanitizer_blacklist': '<(tsan_blacklist)',
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 'includes': ['standard_instrumented_package_target.gypi'],
237 'package_name': 'libglib2.0-0',
239 'extra_configure_flags': [
241 '--disable-gtk-doc-html',
242 '--disable-gtk-doc-pdf',
244 'includes': ['standard_instrumented_package_target.gypi'],
247 'package_name': 'libgpg-error0',
249 'includes': ['standard_instrumented_package_target.gypi'],
252 'package_name': 'libnspr4',
254 'extra_configure_flags': [
256 # TSan reports data races on debug variables.
259 'run_before_build': 'scripts/libnspr4.sh',
260 'includes': ['standard_instrumented_package_target.gypi'],
263 'package_name': 'libp11-kit0',
265 'includes': ['standard_instrumented_package_target.gypi'],
268 'package_name': 'libpcre3',
270 'extra_configure_flags': [
272 '--enable-unicode-properties',
274 'includes': ['standard_instrumented_package_target.gypi'],
277 'package_name': 'libpixman-1-0',
279 '<(_sanitizer_type)-libglib2.0-0',
281 'includes': ['standard_instrumented_package_target.gypi'],
284 'package_name': 'libpng12-0',
286 'includes': ['standard_instrumented_package_target.gypi'],
289 'package_name': 'libx11-6',
291 'extra_configure_flags': ['--disable-specs'],
292 'includes': ['standard_instrumented_package_target.gypi'],
295 'package_name': 'libxau6',
297 'includes': ['standard_instrumented_package_target.gypi'],
300 'package_name': 'libxcb1',
302 'extra_configure_flags': ['--disable-build-docs'],
303 'includes': ['standard_instrumented_package_target.gypi'],
306 'package_name': 'libxcomposite1',
308 'includes': ['standard_instrumented_package_target.gypi'],
311 'package_name': 'libxcursor1',
313 'includes': ['standard_instrumented_package_target.gypi'],
316 'package_name': 'libxdamage1',
318 'includes': ['standard_instrumented_package_target.gypi'],
321 'package_name': 'libxdmcp6',
323 'extra_configure_flags': ['--disable-docs'],
324 'includes': ['standard_instrumented_package_target.gypi'],
327 'package_name': 'libxext6',
329 'extra_configure_flags': ['--disable-specs'],
330 'includes': ['standard_instrumented_package_target.gypi'],
333 'package_name': 'libxfixes3',
335 'includes': ['standard_instrumented_package_target.gypi'],
338 'package_name': 'libxi6',
340 'extra_configure_flags': [
344 'includes': ['standard_instrumented_package_target.gypi'],
347 'package_name': 'libxinerama1',
349 'includes': ['standard_instrumented_package_target.gypi'],
352 'package_name': 'libxrandr2',
354 'includes': ['standard_instrumented_package_target.gypi'],
357 'package_name': 'libxrender1',
359 'includes': ['standard_instrumented_package_target.gypi'],
362 'package_name': 'libxss1',
364 'includes': ['standard_instrumented_package_target.gypi'],
367 'package_name': 'libxtst6',
369 'extra_configure_flags': ['--disable-specs'],
370 'includes': ['standard_instrumented_package_target.gypi'],
373 'package_name': 'zlib1g',
375 'patch': 'patches/zlib1g.diff',
376 'includes': ['standard_instrumented_package_target.gypi'],
379 'package_name': 'nss',
381 '<(_sanitizer_type)-libnspr4',
383 'patch': 'patches/nss.diff',
384 'build_method': 'custom_nss',
385 'includes': ['standard_instrumented_package_target.gypi'],
388 'package_name': 'pulseaudio',
390 '<(_sanitizer_type)-libdbus-1-3',
392 'patch': 'patches/pulseaudio.diff',
393 'run_before_build': 'scripts/pulseaudio.sh',
395 'includes': ['standard_instrumented_package_target.gypi'],
398 'package_name': 'libasound2',
400 'run_before_build': 'scripts/libasound2.sh',
401 'includes': ['standard_instrumented_package_target.gypi'],
404 'package_name': 'libcups2',
406 'patch': 'patches/libcups2.diff',
408 'extra_configure_flags': [
409 # All from debian/rules.
410 '--localedir=/usr/share/cups/locale',
420 '--with-dbusdir=/etc/dbus-1',
423 '--with-pdftops=/usr/bin/gs',
425 '--with-cups-group=lp',
426 '--with-system-groups=lpadmin',
427 '--with-printcap=/var/run/cups/printcap',
428 '--with-log-file-perm=0640',
429 '--with-local_protocols="CUPS dnssd"',
430 '--with-remote_protocols="CUPS dnssd"',
433 'includes': ['standard_instrumented_package_target.gypi'],
436 'package_name': 'pango1.0',
438 '<(_sanitizer_type)-libglib2.0-0',
440 'extra_configure_flags': [
441 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
442 '--enable-introspection=no',
443 # Pango is normally used with dynamically loaded modules. However,
444 # ensuring pango is able to find instrumented versions of those modules
445 # is a huge pain in the neck. Let's link them statically instead, and
447 '--with-included-modules=yes'
449 'includes': ['standard_instrumented_package_target.gypi'],
452 'package_name': 'libcap2',
454 'build_method': 'custom_libcap',
455 'includes': ['standard_instrumented_package_target.gypi'],
458 'package_name': 'libudev0',
460 'extra_configure_flags': [
461 # Without this flag there's a linking step that doesn't honor LDFLAGS
463 # TODO(earthdok): find a better fix.
466 'includes': ['standard_instrumented_package_target.gypi'],
469 'package_name': 'libtasn1-3',
471 'includes': ['standard_instrumented_package_target.gypi'],
474 'package_name': 'libgnome-keyring0',
475 'extra_configure_flags': [
476 # Build static libs (from debian/rules).
480 'package_ldflags': ['-Wl,--as-needed'],
482 'includes': ['standard_instrumented_package_target.gypi'],
485 'package_name': 'libgtk2.0-0',
486 'package_cflags': ['-Wno-return-type'],
487 'extra_configure_flags': [
491 '--enable-test-print-backend',
492 '--enable-introspection=no',
496 'patch': 'patches/libgtk2.0-0.diff',
497 'run_before_build': 'scripts/libgtk2.0-0.sh',
498 'includes': ['standard_instrumented_package_target.gypi'],
501 'package_name': 'libgdk-pixbuf2.0-0',
502 'extra_configure_flags': [
506 # Make the build less problematic.
507 '--disable-introspection',
510 'patch': 'patches/libgdk-pixbuf2.0-0.diff',
511 'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
512 'includes': ['standard_instrumented_package_target.gypi'],
515 'package_name': 'libpci3',
517 'build_method': 'custom_libpci3',
519 'includes': ['standard_instrumented_package_target.gypi'],
522 'package_name': 'libdbusmenu-glib4',
523 'extra_configure_flags': [
525 '--disable-scrollkeeper',
527 # --enable-introspection introduces a build step that attempts to run
528 # a just-built binary and crashes. Vala requires introspection.
529 # TODO(earthdok): find a better fix.
530 '--disable-introspection',
534 'includes': ['standard_instrumented_package_target.gypi'],
537 'package_name': 'liboverlay-scrollbar-0.2-0',
538 'extra_configure_flags': [
542 'includes': ['standard_instrumented_package_target.gypi'],
545 'package_name': 'libgconf-2-4',
546 'extra_configure_flags': [
547 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
551 '--disable-introspection',
554 'includes': ['standard_instrumented_package_target.gypi'],
557 'package_name': 'libappindicator1',
558 'extra_configure_flags': [
560 '--disable-introspection',
563 'build_method': 'custom_libappindicator1',
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'],