mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org
Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tomasz Torcz <tomek@pipebreaker.pl>,
	Josh Boyer <jwboyer@redhat.com>
Subject: [PATCH] UAPI: Strip the _UAPI prefix from header guards during header installation
Date: Tue, 13 Nov 2012 14:26:41 +0000	[thread overview]
Message-ID: <20121113142641.16744.72039.stgit@warthog.procyon.org.uk> (raw)

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>
---

 0 files changed

diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 239d22d..6c353ae 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -42,6 +42,9 @@ foreach my $filename (@files) {
 		$line =~ s/(^|\s)(inline)\b/$1__$2__/g;
 		$line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
 		$line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
+		$line =~ s/#ifndef _UAPI/#ifndef /;
+		$line =~ s/#define _UAPI/#define /;
+		$line =~ s!#endif /[*] _UAPI!#endif /* !;
 		printf {$out} "%s", $line;
 	}
 	close $out;


             reply	other threads:[~2012-11-13 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-13 14:26 David Howells [this message]
2012-11-20 21:10 ` Josh Boyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121113142641.16744.72039.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=jwboyer@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomek@pipebreaker.pl \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®