Extend the suppression for issue 379943
[chromium-blink-merge.git] / third_party / instrumented_libraries / instrumented_libraries.gyp
blob5bd857eaabfd290c4a4d3efb08a1434edc296d76
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)-freetype',
85         '<(_sanitizer_type)-libcairo2',
86         '<(_sanitizer_type)-libexpat1',
87         '<(_sanitizer_type)-libffi6',
88         '<(_sanitizer_type)-libgcrypt11',
89         '<(_sanitizer_type)-libgpg-error0',
90         '<(_sanitizer_type)-libnspr4',
91         '<(_sanitizer_type)-libp11-kit0',
92         '<(_sanitizer_type)-libpcre3',
93         '<(_sanitizer_type)-libpng12-0',
94         '<(_sanitizer_type)-libx11-6',
95         '<(_sanitizer_type)-libxau6',
96         '<(_sanitizer_type)-libxcb1',
97         '<(_sanitizer_type)-libxcomposite1',
98         '<(_sanitizer_type)-libxcursor1',
99         '<(_sanitizer_type)-libxdamage1',
100         '<(_sanitizer_type)-libxdmcp6',
101         '<(_sanitizer_type)-libxext6',
102         '<(_sanitizer_type)-libxfixes3',
103         '<(_sanitizer_type)-libxi6',
104         '<(_sanitizer_type)-libxinerama1',
105         '<(_sanitizer_type)-libxrandr2',
106         '<(_sanitizer_type)-libxrender1',
107         '<(_sanitizer_type)-libxss1',
108         '<(_sanitizer_type)-libxtst6',
109         '<(_sanitizer_type)-zlib1g',
110         '<(_sanitizer_type)-libglib2.0-0',
111         '<(_sanitizer_type)-libdbus-1-3',
112         '<(_sanitizer_type)-libdbus-glib-1-2',
113         '<(_sanitizer_type)-nss',
114         '<(_sanitizer_type)-libfontconfig1',
115         '<(_sanitizer_type)-pulseaudio',
116         '<(_sanitizer_type)-libasound2',
117         '<(_sanitizer_type)-pango1.0',
118         '<(_sanitizer_type)-libcap2',
119         '<(_sanitizer_type)-libudev0',
120         '<(_sanitizer_type)-libtasn1-3',
121         '<(_sanitizer_type)-libgnome-keyring0',
122         '<(_sanitizer_type)-libgtk2.0-0',
123         '<(_sanitizer_type)-libgdk-pixbuf2.0-0',
124         '<(_sanitizer_type)-libpci3',
125         '<(_sanitizer_type)-libdbusmenu-glib4',
126         '<(_sanitizer_type)-liboverlay-scrollbar-0.2-0',
127         '<(_sanitizer_type)-libgconf-2-4',
128         '<(_sanitizer_type)-libappindicator1',
129         '<(_sanitizer_type)-libdbusmenu',
130         '<(_sanitizer_type)-atk1.0',
131         '<(_sanitizer_type)-libunity9',
132         '<(_sanitizer_type)-dee',
133       ],
134       'conditions': [
135         ['asan==1', {
136           'dependencies': [
137             '<(_sanitizer_type)-libpixman-1-0',
138           ],
139         }],
140         ['msan==1', {
141           'dependencies': [
142             '<(_sanitizer_type)-libcups2',
143           ],
144         }],
145         ['tsan==1', {
146           'dependencies!': [
147             '<(_sanitizer_type)-libpng12-0',
148           ],
149         }],
150       ],
151       'actions': [
152         {
153           'action_name': 'fix_rpaths',
154           'inputs': [
155             'fix_rpaths.sh',
156           ],
157           'outputs': [
158             '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',
159           ],
160           'action': [
161             '<(DEPTH)/third_party/instrumented_libraries/fix_rpaths.sh',
162             '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'
163           ],
164         },
165       ],
166       'direct_dependent_settings': {
167         'target_conditions': [
168           ['_toolset=="target"', {
169             'ldflags': [
170               # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)
171               '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/:\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/usr/lib/x86_64-linux-gnu/',
172               '-Wl,-z,origin',
173             ],
174           }],
175         ],
176       },
177     },
178     {
179       'package_name': 'freetype',
180       'dependencies=': [],
181       'run_before_build': 'scripts/freetype.sh',
182       'includes': ['standard_instrumented_package_target.gypi'],
183     },
184     {
185       'package_name': 'libcairo2',
186       'dependencies=': [],
187       'extra_configure_flags': ['--disable-gtk-doc'],
188       'includes': ['standard_instrumented_package_target.gypi'],
189     },
190     {
191       'package_name': 'libdbus-1-3',
192       'dependencies=': [],
193       'includes': ['standard_instrumented_package_target.gypi'],
194     },
195     {
196       'package_name': 'libdbus-glib-1-2',
197       'dependencies=': [],
198       # Use system dbus-binding-tool. The just-built one is instrumented but
199       # doesn't have the correct RPATH, and will crash.
200       'extra_configure_flags': ['--with-dbus-binding-tool=dbus-binding-tool'],
201       'includes': ['standard_instrumented_package_target.gypi'],
202     },
203     {
204       'package_name': 'libexpat1',
205       'dependencies=': [],
206       'includes': ['standard_instrumented_package_target.gypi'],
207     },
208     {
209       'package_name': 'libffi6',
210       'dependencies=': [],
211       'includes': ['standard_instrumented_package_target.gypi'],
212     },
213     {
214       'package_name': 'libfontconfig1',
215       'dependencies=': [],
216       'extra_configure_flags': [
217         '--disable-docs',
218         '--sysconfdir=/etc/',
219         # From debian/rules.
220         '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',
221       ],
222       'patch': 'patches/libfontconfig.diff',
223       'includes': ['standard_instrumented_package_target.gypi'],
224     },
225     {
226       'package_name': 'libgcrypt11',
227       'dependencies=': [],
228       'package_ldflags': ['-Wl,-z,muldefs'],
229       'extra_configure_flags': [
230         # From debian/rules.
231         '--enable-noexecstack',
232         '--enable-ld-version-script',
233         '--enable-static',
234         # http://crbug.com/344505
235         '--disable-asm'
236       ],
237       'includes': ['standard_instrumented_package_target.gypi'],
238     },
239     {
240       'package_name': 'libglib2.0-0',
241       'dependencies=': [],
242       'extra_configure_flags': [
243         '--disable-gtk-doc',
244         '--disable-gtk-doc-html',
245         '--disable-gtk-doc-pdf',
246       ],
247       'asan_blacklist': 'blacklists/asan/libglib2.0-0.txt',
248       'includes': ['standard_instrumented_package_target.gypi'],
249     },
250     {
251       'package_name': 'libgpg-error0',
252       'dependencies=': [],
253       'includes': ['standard_instrumented_package_target.gypi'],
254     },
255     {
256       'package_name': 'libnspr4',
257       'dependencies=': [],
258       'extra_configure_flags': [
259         '--enable-64bit',
260         # TSan reports data races on debug variables.
261         '--disable-debug',
262       ],
263       'run_before_build': 'scripts/libnspr4.sh',
264       'includes': ['standard_instrumented_package_target.gypi'],
265     },
266     {
267       'package_name': 'libp11-kit0',
268       'dependencies=': [],
269       'includes': ['standard_instrumented_package_target.gypi'],
270     },
271     {
272       'package_name': 'libpcre3',
273       'dependencies=': [],
274       'extra_configure_flags': [
275         '--enable-utf8',
276         '--enable-unicode-properties',
277       ],
278       'includes': ['standard_instrumented_package_target.gypi'],
279     },
280     {
281       'package_name': 'libpixman-1-0',
282       'dependencies=': [],
283       'patch': 'patches/libpixman-1-0.diff',
284       'includes': ['standard_instrumented_package_target.gypi'],
285     },
286     {
287       'package_name': 'libpng12-0',
288       'dependencies=': [],
289       'includes': ['standard_instrumented_package_target.gypi'],
290     },
291     {
292       'package_name': 'libx11-6',
293       'dependencies=': [],
294       'extra_configure_flags': ['--disable-specs'],
295       'msan_blacklist': 'blacklists/msan/libx11-6.txt',
296       'includes': ['standard_instrumented_package_target.gypi'],
297     },
298     {
299       'package_name': 'libxau6',
300       'dependencies=': [],
301       'includes': ['standard_instrumented_package_target.gypi'],
302     },
303     {
304       'package_name': 'libxcb1',
305       'dependencies=': [],
306       'extra_configure_flags': ['--disable-build-docs'],
307       'includes': ['standard_instrumented_package_target.gypi'],
308     },
309     {
310       'package_name': 'libxcomposite1',
311       'dependencies=': [],
312       'includes': ['standard_instrumented_package_target.gypi'],
313     },
314     {
315       'package_name': 'libxcursor1',
316       'dependencies=': [],
317       'includes': ['standard_instrumented_package_target.gypi'],
318     },
319     {
320       'package_name': 'libxdamage1',
321       'dependencies=': [],
322       'includes': ['standard_instrumented_package_target.gypi'],
323     },
324     {
325       'package_name': 'libxdmcp6',
326       'dependencies=': [],
327       'extra_configure_flags': ['--disable-docs'],
328       'includes': ['standard_instrumented_package_target.gypi'],
329     },
330     {
331       'package_name': 'libxext6',
332       'dependencies=': [],
333       'extra_configure_flags': ['--disable-specs'],
334       'includes': ['standard_instrumented_package_target.gypi'],
335     },
336     {
337       'package_name': 'libxfixes3',
338       'dependencies=': [],
339       'includes': ['standard_instrumented_package_target.gypi'],
340     },
341     {
342       'package_name': 'libxi6',
343       'dependencies=': [],
344       'extra_configure_flags': [
345         '--disable-specs',
346         '--disable-docs',
347       ],
348       'includes': ['standard_instrumented_package_target.gypi'],
349     },
350     {
351       'package_name': 'libxinerama1',
352       'dependencies=': [],
353       'includes': ['standard_instrumented_package_target.gypi'],
354     },
355     {
356       'package_name': 'libxrandr2',
357       'dependencies=': [],
358       'includes': ['standard_instrumented_package_target.gypi'],
359     },
360     {
361       'package_name': 'libxrender1',
362       'dependencies=': [],
363       'includes': ['standard_instrumented_package_target.gypi'],
364     },
365     {
366       'package_name': 'libxss1',
367       'dependencies=': [],
368       'includes': ['standard_instrumented_package_target.gypi'],
369     },
370     {
371       'package_name': 'libxtst6',
372       'dependencies=': [],
373       'extra_configure_flags': ['--disable-specs'],
374       'includes': ['standard_instrumented_package_target.gypi'],
375     },
376     {
377       'package_name': 'zlib1g',
378       'dependencies=': [],
379       'patch': 'patches/zlib1g.diff',
380       'includes': ['standard_instrumented_package_target.gypi'],
381     },
382     {
383       'package_name': 'nss',
384       'dependencies=': [
385         # TODO(earthdok): get rid of this dependency
386         '<(_sanitizer_type)-libnspr4',
387       ],
388       'patch': 'patches/nss.diff',
389       'build_method': 'custom_nss',
390       'includes': ['standard_instrumented_package_target.gypi'],
391     },
392     {
393       'package_name': 'pulseaudio',
394       'dependencies=': [],
395       'patch': 'patches/pulseaudio.diff',
396       'run_before_build': 'scripts/pulseaudio.sh',
397       'jobs': 1,
398       'includes': ['standard_instrumented_package_target.gypi'],
399     },
400     {
401       'package_name': 'libasound2',
402       'dependencies=': [],
403       'run_before_build': 'scripts/libasound2.sh',
404       'includes': ['standard_instrumented_package_target.gypi'],
405     },
406     {
407       'package_name': 'libcups2',
408       'dependencies=': [],
409       'patch': 'patches/libcups2.diff',
410       'jobs': 1,
411       'extra_configure_flags': [
412         # All from debian/rules.
413         '--localedir=/usr/share/cups/locale',
414         '--enable-slp',
415         '--enable-libpaper',
416         '--enable-ssl',
417         '--enable-gnutls',
418         '--disable-openssl',
419         '--enable-threads',
420         '--enable-static',
421         '--enable-debug',
422         '--enable-dbus',
423         '--with-dbusdir=/etc/dbus-1',
424         '--enable-gssapi',
425         '--enable-avahi',
426         '--with-pdftops=/usr/bin/gs',
427         '--disable-launchd',
428         '--with-cups-group=lp',
429         '--with-system-groups=lpadmin',
430         '--with-printcap=/var/run/cups/printcap',
431         '--with-log-file-perm=0640',
432         '--with-local_protocols="CUPS dnssd"',
433         '--with-remote_protocols="CUPS dnssd"',
434         '--enable-libusb',
435       ],
436       'includes': ['standard_instrumented_package_target.gypi'],
437     },
438     {
439       'package_name': 'pango1.0',
440       'dependencies=': [],
441       'extra_configure_flags': [
442         # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620
443         '--enable-introspection=no',
444         # Pango is normally used with dynamically loaded modules. However,
445         # ensuring pango is able to find instrumented versions of those modules
446         # is a huge pain in the neck. Let's link them statically instead, and
447         # hope for the best.
448         '--with-included-modules=yes'
449       ],
450       'includes': ['standard_instrumented_package_target.gypi'],
451     },
452     {
453       'package_name': 'libcap2',
454       'dependencies=': [],
455       'build_method': 'custom_libcap',
456       'includes': ['standard_instrumented_package_target.gypi'],
457     },
458     {
459       'package_name': 'libudev0',
460       'dependencies=': [],
461       'extra_configure_flags': [
462           # Without this flag there's a linking step that doesn't honor LDFLAGS
463           # and fails.
464           # TODO(earthdok): find a better fix.
465           '--disable-gudev'
466       ],
467       'includes': ['standard_instrumented_package_target.gypi'],
468     },
469     {
470       'package_name': 'libtasn1-3',
471       'dependencies=': [],
472       'includes': ['standard_instrumented_package_target.gypi'],
473     },
474     {
475       'package_name': 'libgnome-keyring0',
476       'extra_configure_flags': [
477           # Build static libs (from debian/rules).
478           '--enable-static',
479           '--enable-tests=no',
480       ],
481       'package_ldflags': ['-Wl,--as-needed'],
482       'dependencies=': [],
483       'includes': ['standard_instrumented_package_target.gypi'],
484     },
485     {
486       'package_name': 'libgtk2.0-0',
487       'package_cflags': ['-Wno-return-type'],
488       'extra_configure_flags': [
489           # From debian/rules.
490           '--prefix=/usr',
491           '--sysconfdir=/etc',
492           '--enable-test-print-backend',
493           '--enable-introspection=no',
494           '--with-xinput=yes',
495       ],
496       'dependencies=': [],
497       'patch': 'patches/libgtk2.0-0.diff',
498       'run_before_build': 'scripts/libgtk2.0-0.sh',
499       'includes': ['standard_instrumented_package_target.gypi'],
500     },
501     {
502       'package_name': 'libgdk-pixbuf2.0-0',
503       'extra_configure_flags': [
504           # From debian/rules.
505           '--with-libjasper',
506           '--with-x11',
507           # Make the build less problematic.
508           '--disable-introspection',
509       ],
510       'dependencies=': [],
511       'patch': 'patches/libgdk-pixbuf2.0-0.diff',
512       'run_before_build': 'scripts/libgdk-pixbuf2.0-0.sh',
513       'includes': ['standard_instrumented_package_target.gypi'],
514     },
515     {
516       'package_name': 'libpci3',
517       'dependencies=': [],
518       'build_method': 'custom_libpci3',
519       'jobs': 1,
520       'includes': ['standard_instrumented_package_target.gypi'],
521     },
522     {
523       'package_name': 'libdbusmenu-glib4',
524       'extra_configure_flags': [
525           # From debian/rules.
526           '--disable-scrollkeeper',
527           '--enable-gtk-doc',
528           # --enable-introspection introduces a build step that attempts to run
529           # a just-built binary and crashes. Vala requires introspection.
530           # TODO(earthdok): find a better fix.
531           '--disable-introspection',
532           '--disable-vala',
533       ],
534       'dependencies=': [],
535       'includes': ['standard_instrumented_package_target.gypi'],
536     },
537     {
538       'package_name': 'liboverlay-scrollbar-0.2-0',
539       'extra_configure_flags': [
540           '--with-gtk=2',
541       ],
542       'dependencies=': [],
543       'includes': ['standard_instrumented_package_target.gypi'],
544     },
545     {
546       'package_name': 'libgconf-2-4',
547       'extra_configure_flags': [
548           # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)
549           '--with-gtk=3.0',
550           '--disable-orbit',
551           # See above.
552           '--disable-introspection',
553       ],
554       'dependencies=': [],
555       'includes': ['standard_instrumented_package_target.gypi'],
556     },
557     {
558       'package_name': 'libappindicator1',
559       'extra_configure_flags': [
560           # See above.
561           '--disable-introspection',
562       ],
563       'dependencies=': [],
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   ],