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 'includes': ['standard_instrumented_package_target.gypi'],
195 'package_name': 'libdbus-glib-1-2',
197 # Use system dbus-binding-tool. The just-built one is instrumented but
198 # doesn't have the correct RPATH, and will crash.
199 'extra_configure_flags': ['--with-dbus-binding-tool=dbus-binding-tool'],
200 'includes': ['standard_instrumented_package_target.gypi'],
203 'package_name': 'libexpat1',
205 'includes': ['standard_instrumented_package_target.gypi'],
208 'package_name': 'libffi6',
210 'includes': ['standard_instrumented_package_target.gypi'],
213 'package_name': 'libfontconfig1',
215 'extra_configure_flags': [
217 '--sysconfdir=/etc/',
219 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
221 'patch': 'patches/libfontconfig.diff',
222 'includes': ['standard_instrumented_package_target.gypi'],
225 'package_name': 'libgcrypt11',
227 'package_ldflags': ['-Wl,-z,muldefs'],
228 'extra_configure_flags': [
230 '--enable-noexecstack',
231 '--enable-ld-version-script',
233 # http://crbug.com/344505
236 'includes': ['standard_instrumented_package_target.gypi'],
239 'package_name': 'libglib2.0-0',
241 'extra_configure_flags': [
243 '--disable-gtk-doc-html',
244 '--disable-gtk-doc-pdf',
246 'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
247 'includes': ['standard_instrumented_package_target.gypi'],
250 'package_name': 'libgpg-error0',
252 'includes': ['standard_instrumented_package_target.gypi'],
255 'package_name': 'libnspr4',
257 'extra_configure_flags': [
259 # TSan reports data races on debug variables.
262 'run_before_build': 'scripts/libnspr4.sh',
263 'includes': ['standard_instrumented_package_target.gypi'],
266 'package_name': 'libp11-kit0',
268 'includes': ['standard_instrumented_package_target.gypi'],
271 'package_name': 'libpcre3',
273 'extra_configure_flags': [
275 '--enable-unicode-properties',
277 'includes': ['standard_instrumented_package_target.gypi'],
280 'package_name': 'libpixman-1-0',
282 'patch': 'patches/libpixman-1-0.diff',
283 'includes': ['standard_instrumented_package_target.gypi'],
286 'package_name': 'libpng12-0',
288 'includes': ['standard_instrumented_package_target.gypi'],
291 'package_name': 'libx11-6',
293 'extra_configure_flags': ['--disable-specs'],
294 'msan_blacklist': 'blacklists/msan/libx11-6.txt',
295 'includes': ['standard_instrumented_package_target.gypi'],
298 'package_name': 'libxau6',
300 'includes': ['standard_instrumented_package_target.gypi'],
303 'package_name': 'libxcb1',
305 'extra_configure_flags': ['--disable-build-docs'],
306 'includes': ['standard_instrumented_package_target.gypi'],
309 'package_name': 'libxcomposite1',
311 'includes': ['standard_instrumented_package_target.gypi'],
314 'package_name': 'libxcursor1',
316 'includes': ['standard_instrumented_package_target.gypi'],
319 'package_name': 'libxdamage1',
321 'includes': ['standard_instrumented_package_target.gypi'],
324 'package_name': 'libxdmcp6',
326 'extra_configure_flags': ['--disable-docs'],
327 'includes': ['standard_instrumented_package_target.gypi'],
330 'package_name': 'libxext6',
332 'extra_configure_flags': ['--disable-specs'],
333 'includes': ['standard_instrumented_package_target.gypi'],
336 'package_name': 'libxfixes3',
338 'includes': ['standard_instrumented_package_target.gypi'],
341 'package_name': 'libxi6',
343 'extra_configure_flags': [
347 'includes': ['standard_instrumented_package_target.gypi'],
350 'package_name': 'libxinerama1',
352 'includes': ['standard_instrumented_package_target.gypi'],
355 'package_name': 'libxrandr2',
357 'includes': ['standard_instrumented_package_target.gypi'],
360 'package_name': 'libxrender1',
362 'includes': ['standard_instrumented_package_target.gypi'],
365 'package_name': 'libxss1',
367 'includes': ['standard_instrumented_package_target.gypi'],
370 'package_name': 'libxtst6',
372 'extra_configure_flags': ['--disable-specs'],
373 'includes': ['standard_instrumented_package_target.gypi'],
376 'package_name': 'zlib1g',
378 'patch': 'patches/zlib1g.diff',
379 'includes': ['standard_instrumented_package_target.gypi'],
382 'package_name': 'nss',
384 # TODO(earthdok): get rid of this dependency
385 '<(_sanitizer_type)-libnspr4',
387 'patch': 'patches/nss.diff',
388 'build_method': 'custom_nss',
389 'includes': ['standard_instrumented_package_target.gypi'],
392 'package_name': 'pulseaudio',
394 'patch': 'patches/pulseaudio.diff',
395 'run_before_build': 'scripts/pulseaudio.sh',
397 'includes': ['standard_instrumented_package_target.gypi'],
400 'package_name': 'libasound2',
402 'run_before_build': 'scripts/libasound2.sh',
403 'includes': ['standard_instrumented_package_target.gypi'],
406 'package_name': 'libcups2',
408 'patch': 'patches/libcups2.diff',
410 'extra_configure_flags': [
411 # All from debian/rules.
412 '--localedir=/usr/share/cups/locale',
422 '--with-dbusdir=/etc/dbus-1',
425 '--with-pdftops=/usr/bin/gs',
427 '--with-cups-group=lp',
428 '--with-system-groups=lpadmin',
429 '--with-printcap=/var/run/cups/printcap',
430 '--with-log-file-perm=0640',
431 '--with-local_protocols="CUPS dnssd"',
432 '--with-remote_protocols="CUPS dnssd"',
435 'includes': ['standard_instrumented_package_target.gypi'],
438 'package_name': 'pango1.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',
564 'includes': ['standard_instrumented_package_target.gypi'],
567 'package_name': 'libdbusmenu',
568 'extra_configure_flags': [
570 '--disable-scrollkeeper',
573 '--disable-introspection',
577 'includes': ['standard_instrumented_package_target.gypi'],
580 'package_name': 'atk1.0',
581 'extra_configure_flags': [
583 '--disable-introspection',
586 'includes': ['standard_instrumented_package_target.gypi'],
589 'package_name': 'libunity9',
591 'includes': ['standard_instrumented_package_target.gypi'],
594 'package_name': 'dee',
595 'extra_configure_flags': [
597 '--disable-introspection',
600 'includes': ['standard_instrumented_package_target.gypi'],