aboutsummaryrefslogtreecommitdiff
path: root/scripts/headers_install.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/headers_install.pl')
-rw-r--r--scripts/headers_install.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index 48462be328b..9f56fc50116 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -18,7 +18,9 @@
use strict;
-my ($readdir, $installdir, $arch, @files) = @ARGV;
+my ($readdir, $installdir, $arch, $printdir, @files) = @ARGV;
+
+$printdir =~ s@^include/@@;
my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__";
@@ -30,6 +32,10 @@ foreach my $file (@files) {
open(my $out, '>', $tmpfile)
or die "$tmpfile: $!\n";
while (my $line = <$in>) {
+ # Any #include which uses "" and does not have a path needs
+ # rewriting so that the resultant user space headers are
+ # safe against the use of -I-.
+ $line =~ s/^(\s*#\s*include\s+)"([^\/]*?)"/$1<$printdir\/$2>/;
$line =~ s/([\s(])__user\s/$1/g;
$line =~ s/([\s(])__force\s/$1/g;
$line =~ s/([\s(])__iomem\s/$1/g;