Roll DEPS for libelf clang compilation fix.
[chromium-blink-merge.git] / third_party / instrumented_libraries / instrumented_libraries.gyp
blob5c8309fb4ac77e659763599c9c0b0ff6974b0bfe
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': '',
52     'conditions': [
53       ['asan==1', {
54         'sanitizer_blacklist': '',
55         'package_cflags': ['-fsanitize=address'],
56         'package_ldflags': ['-fsanitize=address'],
57       }],
58       ['msan==1', {
59         'sanitizer_blacklist': '<(msan_blacklist)',
60         'package_cflags': [
61           '-fsanitize=memory',
62           '-fsanitize-memory-track-origins=<(msan_track_origins)'
63         ],
64         'package_ldflags': ['-fsanitize=memory'],
65       }],
66       ['tsan==1', {
67         'sanitizer_blacklist': '<(tsan_blacklist)',
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       'includes': ['standard_instrumented_package_target.gypi'],
235     },
236     {
237       'package_name': 'libglib2.0-0',
238       'dependencies=': [],
239       'extra_configure_flags': [
240         '--disable-gtk-doc',
241         '--disable-gtk-doc-html',
242         '--disable-gtk-doc-pdf',
243       ],
244       'includes': ['standard_instrumented_package_target.gypi'],
245     },
246     {
247       'package_name': 'libgpg-error0',
248       'dependencies=': [],
249       'includes': ['standard_instrumented_package_target.gypi'],
250     },
251     {
252       'package_name': 'libnspr4',
253       'dependencies=': [],
254       'extra_configure_flags': [
255         '--enable-64bit',
256         # TSan reports data races on debug variables.
257         '--disable-debug',
258       ],
259       'run_before_build': 'scripts/libnspr4.sh',
260       'includes': ['standard_instrumented_package_target.gypi'],
261     },
262     {
263       'package_name': 'libp11-kit0',
264       'dependencies=': [],
265       'includes': ['standard_instrumented_package_target.gypi'],
266     },
267     {
268       'package_name': 'libpcre3',
269       'dependencies=': [],
270       'extra_configure_flags': [
271         '--enable-utf8',
272         '--enable-unicode-properties',
273       ],
274       'includes': ['standard_instrumented_package_target.gypi'],
275     },
276     {
277       'package_name': 'libpixman-1-0',
278       'dependencies=': [
279         '<(_sanitizer_type)-libglib2.0-0',
280       ],
281       'includes': ['standard_instrumented_package_target.gypi'],
282     },
283     {
284       'package_name': 'libpng12-0',
285       'dependencies=': [],
286       'includes': ['standard_instrumented_package_target.gypi'],
287     },
288     {
289       'package_name': 'libx11-6',
290       'dependencies=': [],
291       'extra_configure_flags': ['--disable-specs'],
292       'includes': ['standard_instrumented_package_target.gypi'],
293     },
294     {
295       'package_name': 'libxau6',
296       'dependencies=': [],
297       'includes': ['standard_instrumented_package_target.gypi'],
298     },
299     {
300       'package_name': 'libxcb1',
301       'dependencies=': [],
302       'extra_configure_flags': ['--disable-build-docs'],
303       'includes': ['standard_instrumented_package_target.gypi'],
304     },
305     {
306       'package_name': 'libxcomposite1',
307       'dependencies=': [],
308       'includes': ['standard_instrumented_package_target.gypi'],
309     },
310     {
311       'package_name': 'libxcursor1',
312       'dependencies=': [],
313       'includes': ['standard_instrumented_package_target.gypi'],
314     },
315     {
316       'package_name': 'libxdamage1',
317       'dependencies=': [],
318       'includes': ['standard_instrumented_package_target.gypi'],
319     },
320     {
321       'package_name': 'libxdmcp6',
322       'dependencies=': [],
323       'extra_configure_flags': ['--disable-docs'],
324       'includes': ['standard_instrumented_package_target.gypi'],
325     },
326     {
327       'package_name': 'libxext6',
328       'dependencies=': [],
329       'extra_configure_flags': ['--disable-specs'],
330       'includes': ['standard_instrumented_package_target.gypi'],
331     },
332     {
333       'package_name': 'libxfixes3',
334       'dependencies=': [],
335       'includes': ['standard_instrumented_package_target.gypi'],
336     },
337     {
338       'package_name': 'libxi6',
339       'dependencies=': [],
340       'extra_configure_flags': [
341         '--disable-specs',
342         '--disable-docs',
343       ],
344       'includes': ['standard_instrumented_package_target.gypi'],
345     },
346     {
347       'package_name': 'libxinerama1',
348       'dependencies=': [],
349       'includes': ['standard_instrumented_package_target.gypi'],
350     },
351     {
352       'package_name': 'libxrandr2',
353       'dependencies=': [],
354       'includes': ['standard_instrumented_package_target.gypi'],
355     },
356     {
357       'package_name': 'libxrender1',
358       'dependencies=': [],
359       'includes': ['standard_instrumented_package_target.gypi'],
360     },
361     {
362       'package_name': 'libxss1',
363       'dependencies=': [],
364       'includes': ['standard_instrumented_package_target.gypi'],
365     },
366     {
367       'package_name': 'libxtst6',
368       'dependencies=': [],
369       'extra_configure_flags': ['--disable-specs'],
370       'includes': ['standard_instrumented_package_target.gypi'],
371     },
372     {
373       'package_name': 'zlib1g',
374       'dependencies=': [],
375       'patch': 'patches/zlib1g.diff',
376       'includes': ['standard_instrumented_package_target.gypi'],
377     },
378     {
379       'package_name': 'nss',
380       'dependencies=': [
381         '<(_sanitizer_type)-libnspr4',
382       ],
383       'patch': 'patches/nss.diff',
384       'build_method': 'custom_nss',
385       'includes': ['standard_instrumented_package_target.gypi'],
386     },
387     {
388       'package_name': 'pulseaudio',
389       'dependencies=': [
390         '<(_sanitizer_type)-libdbus-1-3',
391       ],
392       'patch': 'patches/pulseaudio.diff',
393       'run_before_build': 'scripts/pulseaudio.sh',
394       'jobs': 1,
395       'includes': ['standard_instrumented_package_target.gypi'],
396     },
397     {
398       'package_name': 'libasound2',
399       'dependencies=': [],
400       'run_before_build': 'scripts/libasound2.sh',
401       'includes': ['standard_instrumented_package_target.gypi'],
402     },
403     {
404       'package_name': 'libcups2',
405       'dependencies=': [],
406       'patch': 'patches/libcups2.diff',
407       'jobs': 1,
408       'extra_configure_flags': [
409         # All from debian/rules.
410         '--localedir=/usr/share/cups/locale',
411         '--enable-slp',
412         '--enable-libpaper',
413         '--enable-ssl',
414         '--enable-gnutls',
415         '--disable-openssl',
416         '--enable-threads',
417         '--enable-static',
418         '--enable-debug',
419         '--enable-dbus',
420         '--with-dbusdir=/etc/dbus-1',
421         '--enable-gssapi',
422         '--enable-avahi',
423         '--with-pdftops=/usr/bin/gs',
424         '--disable-launchd',
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"',
431         '--enable-libusb',
432       ],
433       'includes': ['standard_instrumented_package_target.gypi'],
434     },
435     {
436       'package_name': 'pango1.0',
437       'dependencies=': [
438         '<(_sanitizer_type)-libglib2.0-0',
439       ],
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
446         # hope for the best.
447         '--with-included-modules=yes'
448       ],
449       'includes': ['standard_instrumented_package_target.gypi'],
450     },
451     {
452       'package_name': 'libcap2',
453       'dependencies=': [],
454       'build_method': 'custom_libcap',
455       'includes': ['standard_instrumented_package_target.gypi'],
456     },
457     {
458       'package_name': 'libudev0',
459       'dependencies=': [],
460       'extra_configure_flags': [
461           # Without this flag there's a linking step that doesn't honor LDFLAGS
462           # and fails.
463           # TODO(earthdok): find a better fix.
464           '--disable-gudev'
465       ],
466       'includes': ['standard_instrumented_package_target.gypi'],
467     },
468     {
469       'package_name': 'libtasn1-3',
470       'dependencies=': [],
471       'includes': ['standard_instrumented_package_target.gypi'],
472     },
473     {
474       'package_name': 'libgnome-keyring0',
475       'extra_configure_flags': [
476           # Build static libs (from debian/rules).
477           '--enable-static',
478           '--enable-tests=no',
479       ],
480       'package_ldflags': ['-Wl,--as-needed'],
481       'dependencies=': [],
482       'includes': ['standard_instrumented_package_target.gypi'],
483     },
484     {
485       'package_name': 'libgtk2.0-0',
486       'package_cflags': ['-Wno-return-type'],
487       'extra_configure_flags': [
488           # From debian/rules.
489           '--prefix=/usr',
490           '--sysconfdir=/etc',
491           '--enable-test-print-backend',
492           '--enable-introspection=no',
493           '--with-xinput=yes',
494       ],
495       'dependencies=': [],
496       'patch': 'patches/libgtk2.0-0.diff',
497       'run_before_build': 'scripts/libgtk2.0-0.sh',
498       'includes': ['standard_instrumented_package_target.gypi'],
499     },
500     {
501       'package_name': 'libgdk-pixbuf2.0-0',
502       'extra_configure_flags': [
503           # From debian/rules.
504           '--with-libjasper',
505           '--with-x11',
506           # Make the build less problematic.
507           '--disable-introspection',
508       ],
509       'dependencies=': [],
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'],
513     },
514     {
515       'package_name': 'libpci3',
516       'dependencies=': [],
517       'build_method': 'custom_libpci3',
518       'jobs': 1,
519       'includes': ['standard_instrumented_package_target.gypi'],
520     },
521     {
522       'package_name': 'libdbusmenu-glib4',
523       'extra_configure_flags': [
524           # From debian/rules.
525           '--disable-scrollkeeper',
526           '--enable-gtk-doc',
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',
531           '--disable-vala',
532       ],
533       'dependencies=': [],
534       'includes': ['standard_instrumented_package_target.gypi'],
535     },
536     {
537       'package_name': 'liboverlay-scrollbar-0.2-0',
538       'extra_configure_flags': [
539           '--with-gtk=2',
540       ],
541       'dependencies=': [],
542       'includes': ['standard_instrumented_package_target.gypi'],
543     },
544     {
545       'package_name': 'libgconf-2-4',
546       'extra_configure_flags': [
547           # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
548           '--with-gtk=3.0',
549           '--disable-orbit',
550           # See above.
551           '--disable-introspection',
552       ],
553       'dependencies=': [],
554       'includes': ['standard_instrumented_package_target.gypi'],
555     },
556     {
557       'package_name': 'libappindicator1',
558       'extra_configure_flags': [
559           # See above.
560           '--disable-introspection',
561       ],
562       'dependencies=': [],
563       'build_method': 'custom_libappindicator1',
564       'jobs': 1,
565       'includes': ['standard_instrumented_package_target.gypi'],
566     },
567     {
568       'package_name': 'libdbusmenu',
569       'extra_configure_flags': [
570           # From debian/rules.
571           '--disable-scrollkeeper',
572           '--with-gtk=2',
573           # See above.
574           '--disable-introspection',
575           '--disable-vala',
576       ],
577       'dependencies=': [],
578       'includes': ['standard_instrumented_package_target.gypi'],
579     },
580     {
581       'package_name': 'atk1.0',
582       'extra_configure_flags': [
583           # See above.
584           '--disable-introspection',
585       ],
586       'dependencies=': [],
587       'includes': ['standard_instrumented_package_target.gypi'],
588     },
589     {
590       'package_name': 'libunity9',
591       'dependencies=': [],
592       'includes': ['standard_instrumented_package_target.gypi'],
593     },
594     {
595       'package_name': 'dee',
596       'extra_configure_flags': [
597           # See above.
598           '--disable-introspection',
599       ],
600       'dependencies=': [],
601       'includes': ['standard_instrumented_package_target.gypi'],
602     },
603   ],