Update V8 to version 3.30.4 (based on bleeding_edge revision r24443)
[chromium-blink-merge.git] / third_party / instrumented_libraries / instrumented_libraries.gyp
blobf03767f7397fe7292a5224ad6cbad34ef6cb7737
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   'ubuntu_release': '<!(lsb_release -cs)',
13   'conditions': [
14     ['asan==1', {
15       'sanitizer_type': 'asan',
16     }],
17     ['msan==1', {
18       'sanitizer_type': 'msan',
19     }],
20     ['tsan==1', {
21       'sanitizer_type': 'tsan',
22     }],
23     ['use_goma==1', {
24       'cc': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
25       'cxx': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
26     }, {
27       'cc': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',
28       'cxx': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',
29     }],
30   ],
32   'target_defaults': {
33     'build_method': 'destdir',
34     'extra_configure_flags': [],
35     'jobs': '<(instrumented_libraries_jobs)',
36     'package_cflags': [
37       '-O2',
38       '-gline-tables-only',
39       '-fPIC',
40       '-w',
41       '-U_FORITFY_SOURCE',
42       '-fno-omit-frame-pointer'
43     ],
44     'package_ldflags': [
45       '-Wl,-z,origin',
46       # We set RPATH=XORIGIN when building the package and replace it with
47       # $ORIGIN later. The reason is that this flag goes through configure/make
48       # differently for different packages. Because of this, we can't escape the
49       # $ character in a way that would work for every package.
50       '-Wl,-R,XORIGIN/.'
51     ],
52     'patch': '',
53     'run_before_build': '',
54     'asan_blacklist': '',
55     'msan_blacklist': '',
56     'tsan_blacklist': '',
58     'conditions': [
59       ['asan==1', {
60         'package_cflags': ['-fsanitize=address'],
61         'package_ldflags': ['-fsanitize=address'],
62       }],
63       ['msan==1', {
64         'package_cflags': [
65           '-fsanitize=memory',
66           '-fsanitize-memory-track-origins=<(msan_track_origins)'
67         ],
68         'package_ldflags': ['-fsanitize=memory'],
69       }],
70       ['tsan==1', {
71         'package_cflags': ['-fsanitize=thread'],
72         'package_ldflags': ['-fsanitize=thread'],
73       }],
74     ],
75   },
77   'targets': [
78     {
79       'target_name': 'instrumented_libraries',
80       'type': 'none',
81       'variables': {
82         'prune_self_dependency': 1,
83         # Don't add this target to the dependencies of targets with type=none.
84         'link_dependency': 1,
85       },
86       'dependencies': [
87         '<(_sanitizer_type)-freetype',
88         '<(_sanitizer_type)-libcairo2',
89         '<(_sanitizer_type)-libexpat1',
90         '<(_sanitizer_type)-libffi6',
91         '<(_sanitizer_type)-libgcrypt11',
92         '<(_sanitizer_type)-libgpg-error0',
93         '<(_sanitizer_type)-libnspr4',
94         '<(_sanitizer_type)-libp11-kit0',
95         '<(_sanitizer_type)-libpcre3',
96         '<(_sanitizer_type)-libpng12-0',
97         '<(_sanitizer_type)-libx11-6',
98         '<(_sanitizer_type)-libxau6',
99         '<(_sanitizer_type)-libxcb1',
100         '<(_sanitizer_type)-libxcomposite1',
101         '<(_sanitizer_type)-libxcursor1',
102         '<(_sanitizer_type)-libxdamage1',
103         '<(_sanitizer_type)-libxdmcp6',
104         '<(_sanitizer_type)-libxext6',
105         '<(_sanitizer_type)-libxfixes3',
106         '<(_sanitizer_type)-libxi6',
107         '<(_sanitizer_type)-libxinerama1',
108         '<(_sanitizer_type)-libxrandr2',
109         '<(_sanitizer_type)-libxrender1',
110         '<(_sanitizer_type)-libxss1',
111         '<(_sanitizer_type)-libxtst6',
112         '<(_sanitizer_type)-zlib1g',
113         '<(_sanitizer_type)-libglib2.0-0',
114         '<(_sanitizer_type)-libdbus-1-3',
115         '<(_sanitizer_type)-libdbus-glib-1-2',
116         '<(_sanitizer_type)-nss',
117         '<(_sanitizer_type)-libfontconfig1',
118         '<(_sanitizer_type)-pulseaudio',
119         '<(_sanitizer_type)-libasound2',
120         '<(_sanitizer_type)-pango1.0',
121         '<(_sanitizer_type)-libcap2',
122         '<(_sanitizer_type)-udev',
123         '<(_sanitizer_type)-libtasn1-3',
124         '<(_sanitizer_type)-libgnome-keyring0',
125         '<(_sanitizer_type)-libgtk2.0-0',
126         '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
127         '<(_sanitizer_type)-libpci3',
128         '<(_sanitizer_type)-libdbusmenu-glib4',
129         '<(_sanitizer_type)-overlay-scrollbar',
130         '<(_sanitizer_type)-libgconf-2-4',
131         '<(_sanitizer_type)-libappindicator1',
132         '<(_sanitizer_type)-libdbusmenu',
133         '<(_sanitizer_type)-atk1.0',
134         '<(_sanitizer_type)-libunity9',
135         '<(_sanitizer_type)-dee',
136       ],
137       'conditions': [
138         ['asan==1', {
139           'dependencies': [
140             '<(_sanitizer_type)-libpixman-1-0',
141           ],
142         }],
143         ['msan==1', {
144           'dependencies': [
145             '<(_sanitizer_type)-libcups2',
146           ],
147         }],
148         ['tsan==1', {
149           'dependencies!': [
150             '<(_sanitizer_type)-libpng12-0',
151           ],
152         }],
153       ],
154       'actions': [
155         {
156           'action_name': 'fix_rpaths',
157           'inputs': [
158             'fix_rpaths.sh',
159           ],
160           'outputs': [
161             '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',
162           ],
163           'action': [
164             './fix_rpaths.sh',
165             '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'
166           ],
167         },
168       ],
169       'direct_dependent_settings': {
170         'target_conditions': [
171           ['_toolset=="target"', {
172             'ldflags': [
173               # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
174               '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/:\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/usr/lib/x86_64-linux-gnu/',
175               '-Wl,-z,origin',
176             ],
177           }],
178         ],
179       },
180     },
181     {
182       'package_name': 'freetype',
183       'dependencies=': [],
184       'run_before_build': 'scripts/freetype.sh',
185       'includes': ['standard_instrumented_package_target.gypi'],
186     },
187     {
188       'package_name': 'libcairo2',
189       'dependencies=': [],
190       'extra_configure_flags': ['--disable-gtk-doc'],
191       'includes': ['standard_instrumented_package_target.gypi'],
192     },
193     {
194       'package_name': 'libdbus-1-3',
195       'dependencies=': [],
196       'includes': ['standard_instrumented_package_target.gypi'],
197     },
198     {
199       'package_name': 'libdbus-glib-1-2',
200       'dependencies=': [],
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       'extra_configure_flags': [
220         '--disable-docs',
221         '--sysconfdir=/etc/',
222         # From debian/rules.
223         '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
224       ],
225       'conditions': [
226         ['"<(_ubuntu_release)"=="precise"', {
227           'patch': 'patches/libfontconfig.precise.diff',
228         }, {
229           'patch': 'patches/libfontconfig.trusty.diff',
230         }],
231       ],
232       'includes': ['standard_instrumented_package_target.gypi'],
233     },
234     {
235       'package_name': 'libgcrypt11',
236       'dependencies=': [],
237       'package_ldflags': ['-Wl,-z,muldefs'],
238       'extra_configure_flags': [
239         # From debian/rules.
240         '--enable-noexecstack',
241         '--enable-ld-version-script',
242         '--enable-static',
243         # http://crbug.com/344505
244         '--disable-asm'
245       ],
246       'includes': ['standard_instrumented_package_target.gypi'],
247     },
248     {
249       'package_name': 'libglib2.0-0',
250       'dependencies=': [],
251       'extra_configure_flags': [
252         '--disable-gtk-doc',
253         '--disable-gtk-doc-html',
254         '--disable-gtk-doc-pdf',
255       ],
256       'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
257       'run_before_build': 'scripts/autogen.sh',
258       'includes': ['standard_instrumented_package_target.gypi'],
259     },
260     {
261       'package_name': 'libgpg-error0',
262       'dependencies=': [],
263       'includes': ['standard_instrumented_package_target.gypi'],
264     },
265     {
266       'package_name': 'libnspr4',
267       'dependencies=': [],
268       'extra_configure_flags': [
269         '--enable-64bit',
270         # TSan reports data races on debug variables.
271         '--disable-debug',
272       ],
273       'run_before_build': 'scripts/libnspr4.sh',
274       'includes': ['standard_instrumented_package_target.gypi'],
275     },
276     {
277       'package_name': 'libp11-kit0',
278       'dependencies=': [],
279       # Required on Trusty due to autoconf version mismatch.
280       'run_before_build': 'scripts/autoreconf.sh',
281       'includes': ['standard_instrumented_package_target.gypi'],
282     },
283     {
284       'package_name': 'libpcre3',
285       'dependencies=': [],
286       'extra_configure_flags': [
287         '--enable-utf8',
288         '--enable-unicode-properties',
289       ],
290       'includes': ['standard_instrumented_package_target.gypi'],
291     },
292     {
293       'package_name': 'libpixman-1-0',
294       'dependencies=': [],
295       'patch': 'patches/libpixman-1-0.diff',
296       'includes': ['standard_instrumented_package_target.gypi'],
297     },
298     {
299       'package_name': 'libpng12-0',
300       'dependencies=': [],
301       'includes': ['standard_instrumented_package_target.gypi'],
302     },
303     {
304       'package_name': 'libx11-6',
305       'dependencies=': [],
306       'extra_configure_flags': ['--disable-specs'],
307       'msan_blacklist': 'blacklists/msan/libx11-6.txt',
308       # Required on Trusty due to autoconf version mismatch.
309       'run_before_build': 'scripts/autoreconf.sh',
310       'includes': ['standard_instrumented_package_target.gypi'],
311     },
312     {
313       'package_name': 'libxau6',
314       'dependencies=': [],
315       'includes': ['standard_instrumented_package_target.gypi'],
316     },
317     {
318       'package_name': 'libxcb1',
319       'dependencies=': [],
320       'extra_configure_flags': ['--disable-build-docs'],
321       # Required on Trusty due to autoconf version mismatch.
322       'run_before_build': 'scripts/autoreconf.sh',
323       'includes': ['standard_instrumented_package_target.gypi'],
324     },
325     {
326       'package_name': 'libxcomposite1',
327       'dependencies=': [],
328       'includes': ['standard_instrumented_package_target.gypi'],
329     },
330     {
331       'package_name': 'libxcursor1',
332       'dependencies=': [],
333       'includes': ['standard_instrumented_package_target.gypi'],
334     },
335     {
336       'package_name': 'libxdamage1',
337       'dependencies=': [],
338       'includes': ['standard_instrumented_package_target.gypi'],
339     },
340     {
341       'package_name': 'libxdmcp6',
342       'dependencies=': [],
343       'extra_configure_flags': ['--disable-docs'],
344       'includes': ['standard_instrumented_package_target.gypi'],
345     },
346     {
347       'package_name': 'libxext6',
348       'dependencies=': [],
349       'extra_configure_flags': ['--disable-specs'],
350       'includes': ['standard_instrumented_package_target.gypi'],
351     },
352     {
353       'package_name': 'libxfixes3',
354       'dependencies=': [],
355       'includes': ['standard_instrumented_package_target.gypi'],
356     },
357     {
358       'package_name': 'libxi6',
359       'dependencies=': [],
360       'extra_configure_flags': [
361         '--disable-specs',
362         '--disable-docs',
363       ],
364       'includes': ['standard_instrumented_package_target.gypi'],
365     },
366     {
367       'package_name': 'libxinerama1',
368       'dependencies=': [],
369       'includes': ['standard_instrumented_package_target.gypi'],
370     },
371     {
372       'package_name': 'libxrandr2',
373       'dependencies=': [],
374       'includes': ['standard_instrumented_package_target.gypi'],
375     },
376     {
377       'package_name': 'libxrender1',
378       'dependencies=': [],
379       'includes': ['standard_instrumented_package_target.gypi'],
380     },
381     {
382       'package_name': 'libxss1',
383       'dependencies=': [],
384       'includes': ['standard_instrumented_package_target.gypi'],
385     },
386     {
387       'package_name': 'libxtst6',
388       'dependencies=': [],
389       'extra_configure_flags': ['--disable-specs'],
390       'includes': ['standard_instrumented_package_target.gypi'],
391     },
392     {
393       'package_name': 'zlib1g',
394       'dependencies=': [],
395       'patch': 'patches/zlib1g.diff',
396       'includes': ['standard_instrumented_package_target.gypi'],
397     },
398     {
399       'package_name': 'nss',
400       'dependencies=': [
401         # TODO(earthdok): get rid of this dependency
402         '<(_sanitizer_type)-libnspr4',
403       ],
404       'patch': 'patches/nss.diff',
405       'build_method': 'custom_nss',
406       'includes': ['standard_instrumented_package_target.gypi'],
407     },
408     {
409       'package_name': 'pulseaudio',
410       'dependencies=': [],
411       'patch': 'patches/pulseaudio.diff',
412       'run_before_build': 'scripts/pulseaudio.sh',
413       'jobs': 1,
414       'includes': ['standard_instrumented_package_target.gypi'],
415     },
416     {
417       'package_name': 'libasound2',
418       'dependencies=': [],
419       'run_before_build': 'scripts/libasound2.sh',
420       'includes': ['standard_instrumented_package_target.gypi'],
421     },
422     {
423       'package_name': 'libcups2',
424       'dependencies=': [],
425       'patch': 'patches/libcups2.diff',
426       'jobs': 1,
427       'extra_configure_flags': [
428         # All from debian/rules.
429         '--localedir=/usr/share/cups/locale',
430         '--enable-slp',
431         '--enable-libpaper',
432         '--enable-ssl',
433         '--enable-gnutls',
434         '--disable-openssl',
435         '--enable-threads',
436         '--enable-static',
437         '--enable-debug',
438         '--enable-dbus',
439         '--with-dbusdir=/etc/dbus-1',
440         '--enable-gssapi',
441         '--enable-avahi',
442         '--with-pdftops=/usr/bin/gs',
443         '--disable-launchd',
444         '--with-cups-group=lp',
445         '--with-system-groups=lpadmin',
446         '--with-printcap=/var/run/cups/printcap',
447         '--with-log-file-perm=0640',
448         '--with-local_protocols="CUPS dnssd"',
449         '--with-remote_protocols="CUPS dnssd"',
450         '--enable-libusb',
451       ],
452       'includes': ['standard_instrumented_package_target.gypi'],
453     },
454     {
455       'package_name': 'pango1.0',
456       'dependencies=': [],
457       'extra_configure_flags': [
458         # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
459         '--enable-introspection=no',
460         # Pango is normally used with dynamically loaded modules. However,
461         # ensuring pango is able to find instrumented versions of those modules
462         # is a huge pain in the neck. Let's link them statically instead, and
463         # hope for the best.
464         '--with-included-modules=yes'
465       ],
466       'includes': ['standard_instrumented_package_target.gypi'],
467     },
468     {
469       'package_name': 'libcap2',
470       'dependencies=': [],
471       'build_method': 'custom_libcap',
472       'includes': ['standard_instrumented_package_target.gypi'],
473     },
474     {
475       'package_name': 'udev',
476       'dependencies=': [],
477       'extra_configure_flags': [
478           # Without this flag there's a linking step that doesn't honor LDFLAGS
479           # and fails.
480           # TODO(earthdok): find a better fix.
481           '--disable-gudev'
482       ],
483       # Required on Trusty due to autoconf version mismatch.
484       'run_before_build': 'scripts/autoreconf.sh',
485       'includes': ['standard_instrumented_package_target.gypi'],
486     },
487     {
488       'package_name': 'libtasn1-3',
489       'dependencies=': [],
490       'includes': ['standard_instrumented_package_target.gypi'],
491     },
492     {
493       'package_name': 'libgnome-keyring0',
494       'extra_configure_flags': [
495           # Build static libs (from debian/rules).
496           '--enable-static',
497           '--enable-tests=no',
498           # Make the build less problematic.
499           '--disable-introspection',
500       ],
501       'package_ldflags': ['-Wl,--as-needed'],
502       'dependencies=': [],
503       'includes': ['standard_instrumented_package_target.gypi'],
504     },
505     {
506       'package_name': 'libgtk2.0-0',
507       'package_cflags': ['-Wno-return-type'],
508       'extra_configure_flags': [
509           # From debian/rules.
510           '--prefix=/usr',
511           '--sysconfdir=/etc',
512           '--enable-test-print-backend',
513           '--enable-introspection=no',
514           '--with-xinput=yes',
515       ],
516       'dependencies=': [],
517       'conditions': [
518         ['"<(_ubuntu_release)"=="precise"', {
519           'patch': 'patches/libgtk2.0-0.precise.diff',
520         }, {
521           'patch': 'patches/libgtk2.0-0.trusty.diff',
522         }],
523       ],
524       'run_before_build': 'scripts/libgtk2.0-0.sh',
525       'includes': ['standard_instrumented_package_target.gypi'],
526     },
527     {
528       'package_name': 'libgdk-pixbuf2.0-0',
529       'extra_configure_flags': [
530           # From debian/rules.
531           '--with-libjasper',
532           '--with-x11',
533           # Make the build less problematic.
534           '--disable-introspection',
535       ],
536       'dependencies=': [],
537       'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
538       'includes': ['standard_instrumented_package_target.gypi'],
539     },
540     {
541       'package_name': 'libpci3',
542       'dependencies=': [],
543       'build_method': 'custom_libpci3',
544       'jobs': 1,
545       'includes': ['standard_instrumented_package_target.gypi'],
546     },
547     {
548       'package_name': 'libdbusmenu-glib4',
549       'extra_configure_flags': [
550           # From debian/rules.
551           '--disable-scrollkeeper',
552           '--enable-gtk-doc',
553           # --enable-introspection introduces a build step that attempts to run
554           # a just-built binary and crashes. Vala requires introspection.
555           # TODO(earthdok): find a better fix.
556           '--disable-introspection',
557           '--disable-vala',
558       ],
559       'dependencies=': [],
560       'run_before_build': 'scripts/autogen.sh',
561       'includes': ['standard_instrumented_package_target.gypi'],
562     },
563     {
564       'package_name': 'overlay-scrollbar',
565       'extra_configure_flags': [
566           '--with-gtk=2',
567       ],
568       'dependencies=': [],
569       'run_before_build': 'scripts/autogen.sh',
570       'includes': ['standard_instrumented_package_target.gypi'],
571     },
572     {
573       'package_name': 'libgconf-2-4',
574       'extra_configure_flags': [
575           # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
576           '--with-gtk=3.0',
577           '--disable-orbit',
578           # See above.
579           '--disable-introspection',
580       ],
581       'dependencies=': [],
582       'includes': ['standard_instrumented_package_target.gypi'],
583     },
584     {
585       'package_name': 'libappindicator1',
586       'extra_configure_flags': [
587           # See above.
588           '--disable-introspection',
589       ],
590       'dependencies=': [],
591       'jobs': 1,
592       'run_before_build': 'scripts/autogen.sh',
593       'includes': ['standard_instrumented_package_target.gypi'],
594     },
595     {
596       'package_name': 'libdbusmenu',
597       'extra_configure_flags': [
598           # From debian/rules.
599           '--disable-scrollkeeper',
600           '--with-gtk=2',
601           # See above.
602           '--disable-introspection',
603           '--disable-vala',
604       ],
605       'dependencies=': [],
606       'run_before_build': 'scripts/autogen.sh',
607       'includes': ['standard_instrumented_package_target.gypi'],
608     },
609     {
610       'package_name': 'atk1.0',
611       'extra_configure_flags': [
612           # See above.
613           '--disable-introspection',
614       ],
615       'dependencies=': [],
616       'includes': ['standard_instrumented_package_target.gypi'],
617     },
618     {
619       'package_name': 'libunity9',
620       'dependencies=': [],
621       'run_before_build': 'scripts/autogen.sh',
622       'includes': ['standard_instrumented_package_target.gypi'],
623     },
624     {
625       'package_name': 'dee',
626       'extra_configure_flags': [
627           # See above.
628           '--disable-introspection',
629       ],
630       'dependencies=': [],
631       'run_before_build': 'scripts/autogen.sh',
632       'includes': ['standard_instrumented_package_target.gypi'],
633     },
634   ],