musl: another fix for building testcases
[valgrind.git] / tests / filter_libc
blob4f097903a3bf99a2b5807bd0c8e517321d73d73a
1 #!/usr/bin/env perl
3 use strict;
4 use warnings;
6 while (<>)
8 s/ __getsockname / getsockname /;
9 s/ __sigaction / sigaction /;
10 s/ __GI___/ __/;
11 s/ __([a-z]*)_nocancel / $1 /;
13 # "lib[S|s]ystem*" occurs on Darwin, "libsocket" on older Solaris/illumos.
14 s/\(in \/.*(libc|libSystem|libsystem|libsocket).*\)$/(in \/...libc...)/;
15 s/\(within \/.*(libc|libSystem|libsystem|libsocket).*\)$/(within \/...libc...)/;
17 # Filter out dynamic loader
18 s/ \(in \/.*ld-.*so\)$//;
20 # Remove the filename -- on some platforms (eg. Linux) it will be in
21 # libc, on some (eg. Darwin) it will be in the main executable.
22 s/\(below main\) \(.+\)$/(below main)/;
24 # libc on x86 FreeBSD
25 s#_start1 \(src/lib/csu/i386/crt1_c.c.*#(below main)#;
27 # filter out the exact libc-start.c:### line number. (ppc64*)
28 s/\(libc-start.c:[0-9]*\)$/(in \/...libc...)/;
30 # Merge the different C++ operator variations.
31 s/(at.*)__builtin_new/$1...operator new.../;
32 s/(at.*)operator new\(unsigned(| int| long)\)/$1...operator new.../;
34 s/(at.*)__builtin_vec_new/$1...operator new.../;
35 s/(at.*)operator new\[\]\(unsigned(| int| long)\)/$1...operator new[].../;
37 s/(at.*)__builtin_delete/$1...operator delete.../;
38 s/(at.*)operator delete\(void\*(, unsigned(| int| long))?\)/$1...operator delete.../;
40 s/(at.*)__builtin_vec_delete/$1...operator delete[].../;
41 s/(at.*)operator delete\[\]\(void\*\)/$1...operator delete[].../;
43 # Some glibc versions complain about unexpected futex syscall errors.
44 # With or without newline (see sourceware PR20271).
45 next if /^The futex facility returned an unexpected error code.$/;
46 s/The futex facility returned an unexpected error code.//;
48 print;
51 exit 0;