[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / third_party / instrumented_libraries / instrumented_libraries.gyp
blobda0b05b2d77713e33eb2e3b1e72e9b76534823c6
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.
6   'variables': {
7     'verbose_libraries_build%': 0,
8     'instrumented_libraries_jobs%': 1,
9   },
11   'conditions': [
12     ['asan==1', {
13       'sanitizer_type': 'asan',
14     }],
15     ['msan==1', {
16       'sanitizer_type': 'msan',
17     }],
18     ['tsan==1', {
19       'sanitizer_type': 'tsan',
20     }],
21     ['use_goma==1', {
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++',
24     }, {
25       'cc': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
26       'cxx': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
27     }],
28   ],
30   'target_defaults': {
31     'build_method': 'destdir',
32     'extra_configure_flags': [],
33     'jobs': '<(instrumented_libraries_jobs)',
34     'package_cflags': [
35       '-O2',
36       '-gline-tables-only',
37       '-fPIC',
38       '-w',
39       '-U_FORITFY_SOURCE'
40     ],
41     'package_ldflags': [
42       '-Wl,-z,origin',
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.
47       '-Wl,-R,XORIGIN/.'
48     ],
49     'patch': '',
50     'run_before_build': '',
51     'asan_blacklist': '',
52     'msan_blacklist': '',
53     'tsan_blacklist': '',
55     'conditions': [
56       ['asan==1', {
57         'package_cflags': ['-fsanitize=address'],
58         'package_ldflags': ['-fsanitize=address'],
59       }],
60       ['msan==1', {
61         'package_cflags': [
62           '-fsanitize=memory',
63           '-fsanitize-memory-track-origins=<(msan_track_origins)'
64         ],
65         'package_ldflags': ['-fsanitize=memory'],
66       }],
67       ['tsan==1', {
68         'package_cflags': ['-fsanitize=thread'],
69         'package_ldflags': ['-fsanitize=thread'],
70       }],
71     ],
72   },
74   'targets': [
75     {
76       'target_name': 'instrumented_libraries',
77       'type': 'none',
78       'variables': {
79         'prune_self_dependency': 1,
80         # Don't add this target to the dependencies of targets with type=none.
81         'link_dependency': 1,
82       },
83       'dependencies': [
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',
132       ],
133       'conditions': [
134         ['asan==1', {
135           'dependencies': [
136             '<(_sanitizer_type)-libpixman-1-0',
137           ],
138         }],
139         ['msan==1', {
140           'dependencies': [
141             '<(_sanitizer_type)-libcups2',
142           ],
143         }],
144         ['tsan==1', {
145           'dependencies!': [
146             '<(_sanitizer_type)-libpng12-0',
147           ],
148         }],
149       ],
150       'actions': [
151         {
152           'action_name': 'fix_rpaths',
153           'inputs': [
154             'fix_rpaths.sh',
155           ],
156           'outputs': [
157             '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',
158           ],
159           'action': [
160             '<(DEPTH)/third_party/instrumented_libraries/fix_rpaths.sh',
161             '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'
162           ],
163         },
164       ],
165       'direct_dependent_settings': {
166         'target_conditions': [
167           ['_toolset=="target"', {
168             'ldflags': [
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/',
171               '-Wl,-z,origin',
172             ],
173           }],
174         ],
175       },
176     },
177     {
178       'package_name': 'freetype',
179       'dependencies=': [],
180       'run_before_build': 'scripts/freetype.sh',
181       'includes': ['standard_instrumented_package_target.gypi'],
182     },
183     {
184       'package_name': 'libcairo2',
185       'dependencies=': [],
186       'extra_configure_flags': ['--disable-gtk-doc'],
187       'includes': ['standard_instrumented_package_target.gypi'],
188     },
189     {
190       'package_name': 'libdbus-1-3',
191       'dependencies=': [
192         '<(_sanitizer_type)-libglib2.0-0',
193       ],
194       'includes': ['standard_instrumented_package_target.gypi'],
195     },
196     {
197       'package_name': 'libdbus-glib-1-2',
198       'dependencies=': [
199         '<(_sanitizer_type)-libglib2.0-0',
200       ],
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'],
205     },
206     {
207       'package_name': 'libexpat1',
208       'dependencies=': [],
209       'includes': ['standard_instrumented_package_target.gypi'],
210     },
211     {
212       'package_name': 'libffi6',
213       'dependencies=': [],
214       'includes': ['standard_instrumented_package_target.gypi'],
215     },
216     {
217       'package_name': 'libfontconfig1',
218       'dependencies=': [
219         '<(_sanitizer_type)-freetype',
220       ],
221       'extra_configure_flags': [
222         '--disable-docs',
223         '--sysconfdir=/etc/',
224         # From debian/rules.
225         '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
226       ],
227       'patch': 'patches/libfontconfig.diff',
228       'includes': ['standard_instrumented_package_target.gypi'],
229     },
230     {
231       'package_name': 'libgcrypt11',
232       'dependencies=': [],
233       'package_ldflags': ['-Wl,-z,muldefs'],
234       'extra_configure_flags': [
235         # From debian/rules.
236         '--enable-noexecstack',
237         '--enable-ld-version-script',
238         '--enable-static',
239         # http://crbug.com/344505
240         '--disable-asm'
241       ],
242       'includes': ['standard_instrumented_package_target.gypi'],
243     },
244     {
245       'package_name': 'libglib2.0-0',
246       'dependencies=': [],
247       'extra_configure_flags': [
248         '--disable-gtk-doc',
249         '--disable-gtk-doc-html',
250         '--disable-gtk-doc-pdf',
251       ],
252       'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
253       'includes': ['standard_instrumented_package_target.gypi'],
254     },
255     {
256       'package_name': 'libgpg-error0',
257       'dependencies=': [],
258       'includes': ['standard_instrumented_package_target.gypi'],
259     },
260     {
261       'package_name': 'libnspr4',
262       'dependencies=': [],
263       'extra_configure_flags': [
264         '--enable-64bit',
265         # TSan reports data races on debug variables.
266         '--disable-debug',
267       ],
268       'run_before_build': 'scripts/libnspr4.sh',
269       'includes': ['standard_instrumented_package_target.gypi'],
270     },
271     {
272       'package_name': 'libp11-kit0',
273       'dependencies=': [],
274       'includes': ['standard_instrumented_package_target.gypi'],
275     },
276     {
277       'package_name': 'libpcre3',
278       'dependencies=': [],
279       'extra_configure_flags': [
280         '--enable-utf8',
281         '--enable-unicode-properties',
282       ],
283       'includes': ['standard_instrumented_package_target.gypi'],
284     },
285     {
286       'package_name': 'libpixman-1-0',
287       'dependencies=': [
288         '<(_sanitizer_type)-libglib2.0-0',
289       ],
290       'includes': ['standard_instrumented_package_target.gypi'],
291     },
292     {
293       'package_name': 'libpng12-0',
294       'dependencies=': [],
295       'includes': ['standard_instrumented_package_target.gypi'],
296     },
297     {
298       'package_name': 'libx11-6',
299       'dependencies=': [],
300       'extra_configure_flags': ['--disable-specs'],
301       'msan_blacklist': 'blacklists/msan/libx11-6.txt',
302       'includes': ['standard_instrumented_package_target.gypi'],
303     },
304     {
305       'package_name': 'libxau6',
306       'dependencies=': [],
307       'includes': ['standard_instrumented_package_target.gypi'],
308     },
309     {
310       'package_name': 'libxcb1',
311       'dependencies=': [],
312       'extra_configure_flags': ['--disable-build-docs'],
313       'includes': ['standard_instrumented_package_target.gypi'],
314     },
315     {
316       'package_name': 'libxcomposite1',
317       'dependencies=': [],
318       'includes': ['standard_instrumented_package_target.gypi'],
319     },
320     {
321       'package_name': 'libxcursor1',
322       'dependencies=': [],
323       'includes': ['standard_instrumented_package_target.gypi'],
324     },
325     {
326       'package_name': 'libxdamage1',
327       'dependencies=': [],
328       'includes': ['standard_instrumented_package_target.gypi'],
329     },
330     {
331       'package_name': 'libxdmcp6',
332       'dependencies=': [],
333       'extra_configure_flags': ['--disable-docs'],
334       'includes': ['standard_instrumented_package_target.gypi'],
335     },
336     {
337       'package_name': 'libxext6',
338       'dependencies=': [],
339       'extra_configure_flags': ['--disable-specs'],
340       'includes': ['standard_instrumented_package_target.gypi'],
341     },
342     {
343       'package_name': 'libxfixes3',
344       'dependencies=': [],
345       'includes': ['standard_instrumented_package_target.gypi'],
346     },
347     {
348       'package_name': 'libxi6',
349       'dependencies=': [],
350       'extra_configure_flags': [
351         '--disable-specs',
352         '--disable-docs',
353       ],
354       'includes': ['standard_instrumented_package_target.gypi'],
355     },
356     {
357       'package_name': 'libxinerama1',
358       'dependencies=': [],
359       'includes': ['standard_instrumented_package_target.gypi'],
360     },
361     {
362       'package_name': 'libxrandr2',
363       'dependencies=': [],
364       'includes': ['standard_instrumented_package_target.gypi'],
365     },
366     {
367       'package_name': 'libxrender1',
368       'dependencies=': [],
369       'includes': ['standard_instrumented_package_target.gypi'],
370     },
371     {
372       'package_name': 'libxss1',
373       'dependencies=': [],
374       'includes': ['standard_instrumented_package_target.gypi'],
375     },
376     {
377       'package_name': 'libxtst6',
378       'dependencies=': [],
379       'extra_configure_flags': ['--disable-specs'],
380       'includes': ['standard_instrumented_package_target.gypi'],
381     },
382     {
383       'package_name': 'zlib1g',
384       'dependencies=': [],
385       'patch': 'patches/zlib1g.diff',
386       'includes': ['standard_instrumented_package_target.gypi'],
387     },
388     {
389       'package_name': 'nss',
390       'dependencies=': [
391         '<(_sanitizer_type)-libnspr4',
392       ],
393       'patch': 'patches/nss.diff',
394       'build_method': 'custom_nss',
395       'includes': ['standard_instrumented_package_target.gypi'],
396     },
397     {
398       'package_name': 'pulseaudio',
399       'dependencies=': [
400         '<(_sanitizer_type)-libdbus-1-3',
401       ],
402       'patch': 'patches/pulseaudio.diff',
403       'run_before_build': 'scripts/pulseaudio.sh',
404       'jobs': 1,
405       'includes': ['standard_instrumented_package_target.gypi'],
406     },
407     {
408       'package_name': 'libasound2',
409       'dependencies=': [],
410       'run_before_build': 'scripts/libasound2.sh',
411       'includes': ['standard_instrumented_package_target.gypi'],
412     },
413     {
414       'package_name': 'libcups2',
415       'dependencies=': [],
416       'patch': 'patches/libcups2.diff',
417       'jobs': 1,
418       'extra_configure_flags': [
419         # All from debian/rules.
420         '--localedir=/usr/share/cups/locale',
421         '--enable-slp',
422         '--enable-libpaper',
423         '--enable-ssl',
424         '--enable-gnutls',
425         '--disable-openssl',
426         '--enable-threads',
427         '--enable-static',
428         '--enable-debug',
429         '--enable-dbus',
430         '--with-dbusdir=/etc/dbus-1',
431         '--enable-gssapi',
432         '--enable-avahi',
433         '--with-pdftops=/usr/bin/gs',
434         '--disable-launchd',
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"',
441         '--enable-libusb',
442       ],
443       'includes': ['standard_instrumented_package_target.gypi'],
444     },
445     {
446       'package_name': 'pango1.0',
447       'dependencies=': [
448         '<(_sanitizer_type)-libglib2.0-0',
449       ],
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
456         # hope for the best.
457         '--with-included-modules=yes'
458       ],
459       'includes': ['standard_instrumented_package_target.gypi'],
460     },
461     {
462       'package_name': 'libcap2',
463       'dependencies=': [],
464       'build_method': 'custom_libcap',
465       'includes': ['standard_instrumented_package_target.gypi'],
466     },
467     {
468       'package_name': 'libudev0',
469       'dependencies=': [],
470       'extra_configure_flags': [
471           # Without this flag there's a linking step that doesn't honor LDFLAGS
472           # and fails.
473           # TODO(earthdok): find a better fix.
474           '--disable-gudev'
475       ],
476       'includes': ['standard_instrumented_package_target.gypi'],
477     },
478     {
479       'package_name': 'libtasn1-3',
480       'dependencies=': [],
481       'includes': ['standard_instrumented_package_target.gypi'],
482     },
483     {
484       'package_name': 'libgnome-keyring0',
485       'extra_configure_flags': [
486           # Build static libs (from debian/rules).
487           '--enable-static',
488           '--enable-tests=no',
489       ],
490       'package_ldflags': ['-Wl,--as-needed'],
491       'dependencies=': [],
492       'includes': ['standard_instrumented_package_target.gypi'],
493     },
494     {
495       'package_name': 'libgtk2.0-0',
496       'package_cflags': ['-Wno-return-type'],
497       'extra_configure_flags': [
498           # From debian/rules.
499           '--prefix=/usr',
500           '--sysconfdir=/etc',
501           '--enable-test-print-backend',
502           '--enable-introspection=no',
503           '--with-xinput=yes',
504       ],
505       'dependencies=': [],
506       'patch': 'patches/libgtk2.0-0.diff',
507       'run_before_build': 'scripts/libgtk2.0-0.sh',
508       'includes': ['standard_instrumented_package_target.gypi'],
509     },
510     {
511       'package_name': 'libgdk-pixbuf2.0-0',
512       'extra_configure_flags': [
513           # From debian/rules.
514           '--with-libjasper',
515           '--with-x11',
516           # Make the build less problematic.
517           '--disable-introspection',
518       ],
519       'dependencies=': [],
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'],
523     },
524     {
525       'package_name': 'libpci3',
526       'dependencies=': [],
527       'build_method': 'custom_libpci3',
528       'jobs': 1,
529       'includes': ['standard_instrumented_package_target.gypi'],
530     },
531     {
532       'package_name': 'libdbusmenu-glib4',
533       'extra_configure_flags': [
534           # From debian/rules.
535           '--disable-scrollkeeper',
536           '--enable-gtk-doc',
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',
541           '--disable-vala',
542       ],
543       'dependencies=': [],
544       'includes': ['standard_instrumented_package_target.gypi'],
545     },
546     {
547       'package_name': 'liboverlay-scrollbar-0.2-0',
548       'extra_configure_flags': [
549           '--with-gtk=2',
550       ],
551       'dependencies=': [],
552       'includes': ['standard_instrumented_package_target.gypi'],
553     },
554     {
555       'package_name': 'libgconf-2-4',
556       'extra_configure_flags': [
557           # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
558           '--with-gtk=3.0',
559           '--disable-orbit',
560           # See above.
561           '--disable-introspection',
562       ],
563       'dependencies=': [],
564       'includes': ['standard_instrumented_package_target.gypi'],
565     },
566     {
567       'package_name': 'libappindicator1',
568       'extra_configure_flags': [
569           # See above.
570           '--disable-introspection',
571       ],
572       'dependencies=': [],
573       'jobs': 1,
574       'includes': ['standard_instrumented_package_target.gypi'],
575     },
576     {
577       'package_name': 'libdbusmenu',
578       'extra_configure_flags': [
579           # From debian/rules.
580           '--disable-scrollkeeper',
581           '--with-gtk=2',
582           # See above.
583           '--disable-introspection',
584           '--disable-vala',
585       ],
586       'dependencies=': [],
587       'includes': ['standard_instrumented_package_target.gypi'],
588     },
589     {
590       'package_name': 'atk1.0',
591       'extra_configure_flags': [
592           # See above.
593           '--disable-introspection',
594       ],
595       'dependencies=': [],
596       'includes': ['standard_instrumented_package_target.gypi'],
597     },
598     {
599       'package_name': 'libunity9',
600       'dependencies=': [],
601       'includes': ['standard_instrumented_package_target.gypi'],
602     },
603     {
604       'package_name': 'dee',
605       'extra_configure_flags': [
606           # See above.
607           '--disable-introspection',
608       ],
609       'dependencies=': [],
610       'includes': ['standard_instrumented_package_target.gypi'],
611     },
612   ],