Mercurial > hg > aboriginal
comparison sources/patches/linux-outoutdamnperl.patch @ 1717:086e1ff5dd19 draft
Bump to 3.18 kernel with yet another perl removal patch.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 30 Dec 2014 14:54:17 -0600 |
parents | |
children | 78050a31d1ee |
comparison
equal
deleted
inserted
replaced
1716:73b3dde1286d | 1717:086e1ff5dd19 |
---|---|
1 Commit e6023367d779 added perl back to the kernel build. KILL IT WITH FIRE. | |
2 | |
3 --- linux/arch/x86/boot/compressed/Makefile | |
4 +++ linux/arch/x86/boot/compressed/Makefile | |
5 @@ -89,8 +76,10 @@ | |
6 suffix-$(CONFIG_KERNEL_LZO) := lzo | |
7 suffix-$(CONFIG_KERNEL_LZ4) := lz4 | |
8 | |
9 -RUN_SIZE = $(shell $(OBJDUMP) -h vmlinux | \ | |
10 - perl $(srctree)/arch/x86/tools/calc_run_size.pl) | |
11 +RUN_SIZE = $(shell NUM='\([0-9a-fA-F]*[ \t]*\)'; objdump -h vmlinux | \ | |
12 +sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"$$NUM$$NUM$$NUM$$NUM"'.*/\1\4/p' | \ | |
13 +xargs | while read a b c d; do [ "$$b" != "$$d" ] && exit 1; \ | |
14 +expr $(printf "%d + %d + %d" 0x$$a 0x$$b 0x$$c); done) | |
15 quiet_cmd_mkpiggy = MKPIGGY $@ | |
16 cmd_mkpiggy = $(obj)/mkpiggy $< $(RUN_SIZE) > $@ || ( rm -f $@ ; false ) | |
17 | |
18 --- linux/arch/x86/tools/calc_run_size.pl | |
19 +++ /dev/null | |
20 @@ -1,39 +0,0 @@ | |
21 -#!/usr/bin/perl | |
22 -# | |
23 -# Calculate the amount of space needed to run the kernel, including room for | |
24 -# the .bss and .brk sections. | |
25 -# | |
26 -# Usage: | |
27 -# objdump -h a.out | perl calc_run_size.pl | |
28 -use strict; | |
29 - | |
30 -my $mem_size = 0; | |
31 -my $file_offset = 0; | |
32 - | |
33 -my $sections=" *[0-9]+ \.(?:bss|brk) +"; | |
34 -while (<>) { | |
35 - if (/^$sections([0-9a-f]+) +(?:[0-9a-f]+ +){2}([0-9a-f]+)/) { | |
36 - my $size = hex($1); | |
37 - my $offset = hex($2); | |
38 - $mem_size += $size; | |
39 - if ($file_offset == 0) { | |
40 - $file_offset = $offset; | |
41 - } elsif ($file_offset != $offset) { | |
42 - # BFD linker shows the same file offset in ELF. | |
43 - # Gold linker shows them as consecutive. | |
44 - next if ($file_offset + $mem_size == $offset + $size); | |
45 - | |
46 - printf STDERR "file_offset: 0x%lx\n", $file_offset; | |
47 - printf STDERR "mem_size: 0x%lx\n", $mem_size; | |
48 - printf STDERR "offset: 0x%lx\n", $offset; | |
49 - printf STDERR "size: 0x%lx\n", $size; | |
50 - | |
51 - die ".bss and .brk are non-contiguous\n"; | |
52 - } | |
53 - } | |
54 -} | |
55 - | |
56 -if ($file_offset == 0) { | |
57 - die "Never found .bss or .brk file offset\n"; | |
58 -} | |
59 -printf("%d\n", $mem_size + $file_offset); |