aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/headers_install.pl
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-11-26 19:29:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-26 20:41:24 -0500
commit56c176c9cac9a77249fa1736bfd792f379d61942 (patch)
tree6eee2e41d0a04af2de9ca47bb90fab1d7ae1384e /scripts/headers_install.pl
parentc5782e9f5a535af09d7834693a52afdbcc6e5f3f (diff)
UAPI: strip the _UAPI prefix from header guards during header installation
Strip the _UAPI prefix from header guards during header installation so that any userspace dependencies aren't affected. glibc, for example, checks for linux/types.h, linux/kernel.h, linux/compiler.h and linux/list.h by their guards - though the last two aren't actually exported. libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -Wall -Werror -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fno-delete-null-pointer-checks -fstack-protector -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c child.c -fPIC -DPIC -o .libs/child.o In file included from cli.c:20:0: common.h:152:8: error: redefinition of 'struct sysinfo' In file included from /usr/include/linux/kernel.h:4:0, from /usr/include/linux/sysctl.h:25, from /usr/include/sys/sysctl.h:43, from common.h:50, from cli.c:20: /usr/include/linux/sysinfo.h:7:8: note: originally defined here Reported-by: Tomasz Torcz <tomek@pipebreaker.pl> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Josh Boyer <jwboyer@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/headers_install.pl')
-rw-r--r--scripts/headers_install.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 239d22d4207b..6c353ae8a451 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -42,6 +42,9 @@ foreach my $filename (@files) {
42 $line =~ s/(^|\s)(inline)\b/$1__$2__/g; 42 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
43 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; 43 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
44 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; 44 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
45 $line =~ s/#ifndef _UAPI/#ifndef /;
46 $line =~ s/#define _UAPI/#define /;
47 $line =~ s!#endif /[*] _UAPI!#endif /* !;
45 printf {$out} "%s", $line; 48 printf {$out} "%s", $line;
46 } 49 }
47 close $out; 50 close $out;