summaryrefslogtreecommitdiffstats
path: root/meta/packages/openssl/openssl-0.9.8o/debian/pic.patch
diff options
context:
space:
mode:
authorQing He <qing.he@intel.com>2010-06-25 17:09:40 +0800
committerRichard Purdie <rpurdie@linux.intel.com>2010-06-30 13:19:05 +0100
commitc4713d040a5b3ae90781cbb31a19868a1fa39f4e (patch)
tree066b4062f2a0646829254c5e1a7195e287a1c4a1 /meta/packages/openssl/openssl-0.9.8o/debian/pic.patch
parent7ec15f47750b2977972bbbbbe2aadf064c9671d5 (diff)
downloadpoky-c4713d040a5b3ae90781cbb31a19868a1fa39f4e.tar.gz
openssl: upgrade to version 0.9.8o
from 0.9.8g update bugtracker and license 1.0.0 and 1.0.0a are available, but introduce some interface changes. Stick on 0.9.8 versions for now for stability (0.9.8 branch is still updated for security fixes) changes: - add perl-native as build dependency - include /usr/lib/ssl/* in the package - break down debian.package into separate patches under directory debian. Original monolithic patch is >1000 lines, and not very maintainable. Verbatim copy the debian patches, among which two are not needed, but still included with apply=no to increase readability The new patches are ~700 lines. Most that was in the monolithic patch but not here have already been fixed in upstream. - fix-md5-x86_64.patch is in upstream and thus removed - rebase shared-libs.patch Signed-off-by: Qing He <qing.he@intel.com>
Diffstat (limited to 'meta/packages/openssl/openssl-0.9.8o/debian/pic.patch')
-rw-r--r--meta/packages/openssl/openssl-0.9.8o/debian/pic.patch301
1 files changed, 301 insertions, 0 deletions
diff --git a/meta/packages/openssl/openssl-0.9.8o/debian/pic.patch b/meta/packages/openssl/openssl-0.9.8o/debian/pic.patch
new file mode 100644
index 0000000000..b534afa66c
--- /dev/null
+++ b/meta/packages/openssl/openssl-0.9.8o/debian/pic.patch
@@ -0,0 +1,301 @@
1Index: openssl-0.9.8o/crypto/Makefile
2===================================================================
3--- openssl-0.9.8o.orig/crypto/Makefile 2008-09-17 17:10:55.000000000 +0000
4+++ openssl-0.9.8o/crypto/Makefile 2010-06-06 13:09:28.000000000 +0000
5@@ -57,7 +57,7 @@
6 echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
7 echo '#endif' ) >buildinf.h
8
9-x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
10+x86cpuid-elf.S: x86cpuid.pl perlasm/x86asm.pl
11 $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
12 x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
13 $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
14@@ -70,7 +70,7 @@
15 uplink-cof.s: ../ms/uplink.pl
16 $(PERL) ../ms/uplink.pl coff > $@
17
18-x86_64cpuid.s: x86_64cpuid.pl
19+x86_64cpuid.S: x86_64cpuid.pl
20 $(PERL) x86_64cpuid.pl $@
21 ia64cpuid.s: ia64cpuid.S
22 $(CC) $(CFLAGS) -E ia64cpuid.S > $@
23Index: openssl-0.9.8o/crypto/x86_64cpuid.pl
24===================================================================
25--- openssl-0.9.8o.orig/crypto/x86_64cpuid.pl 2007-11-11 16:25:00.000000000 +0000
26+++ openssl-0.9.8o/crypto/x86_64cpuid.pl 2010-06-06 13:09:28.000000000 +0000
27@@ -95,7 +95,11 @@
28 .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
29
30 .section .init
31+#ifdef OPENSSL_PIC
32+ call OPENSSL_cpuid_setup\@PLT
33+#else
34 call OPENSSL_cpuid_setup
35+#endif
36
37 ___
38
39Index: openssl-0.9.8o/crypto/md5/Makefile
40===================================================================
41--- openssl-0.9.8o.orig/crypto/md5/Makefile 2008-09-17 17:11:02.000000000 +0000
42+++ openssl-0.9.8o/crypto/md5/Makefile 2010-06-06 13:09:28.000000000 +0000
43@@ -52,7 +52,8 @@
44 mx86-out.s: asm/md5-586.pl ../perlasm/x86asm.pl
45 (cd asm; $(PERL) md5-586.pl a.out $(CFLAGS) > ../$@)
46
47-md5-x86_64.s: asm/md5-x86_64.pl; $(PERL) asm/md5-x86_64.pl $@
48+md5-x86_64.s: asm/md5-x86_64.pl
49+ $(PERL) asm/md5-x86_64.pl $@
50
51 files:
52 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
53Index: openssl-0.9.8o/crypto/des/asm/desboth.pl
54===================================================================
55--- openssl-0.9.8o.orig/crypto/des/asm/desboth.pl 2001-10-24 21:20:56.000000000 +0000
56+++ openssl-0.9.8o/crypto/des/asm/desboth.pl 2010-06-06 13:09:28.000000000 +0000
57@@ -16,6 +16,11 @@
58
59 &push("edi");
60
61+ &call (&label("pic_point0"));
62+ &set_label("pic_point0");
63+ &blindpop("ebp");
64+ &add ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
65+
66 &comment("");
67 &comment("Load the data words");
68 &mov($L,&DWP(0,"ebx","",0));
69@@ -47,15 +52,21 @@
70 &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
71 &mov(&swtmp(1), "eax");
72 &mov(&swtmp(0), "ebx");
73- &call("DES_encrypt2");
74+ &exch("ebx", "ebp");
75+ &call("DES_encrypt2\@PLT");
76+ &exch("ebx", "ebp");
77 &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
78 &mov(&swtmp(1), "edi");
79 &mov(&swtmp(0), "ebx");
80- &call("DES_encrypt2");
81+ &exch("ebx", "ebp");
82+ &call("DES_encrypt2\@PLT");
83+ &exch("ebx", "ebp");
84 &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
85 &mov(&swtmp(1), "esi");
86 &mov(&swtmp(0), "ebx");
87- &call("DES_encrypt2");
88+ &exch("ebx", "ebp");
89+ &call("DES_encrypt2\@PLT");
90+ &exch("ebx", "ebp");
91
92 &stack_pop(3);
93 &mov($L,&DWP(0,"ebx","",0));
94Index: openssl-0.9.8o/crypto/rc4/Makefile
95===================================================================
96--- openssl-0.9.8o.orig/crypto/rc4/Makefile 2008-11-19 16:03:50.000000000 +0000
97+++ openssl-0.9.8o/crypto/rc4/Makefile 2010-06-06 13:09:28.000000000 +0000
98@@ -51,7 +51,7 @@
99 rx86-out.s: asm/rc4-586.pl ../perlasm/x86asm.pl
100 (cd asm; $(PERL) rc4-586.pl a.out $(CFLAGS) > ../$@)
101
102-rc4-x86_64.s: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@
103+rc4-x86_64.S: asm/rc4-x86_64.pl; $(PERL) asm/rc4-x86_64.pl $@
104
105 rc4-ia64.s: asm/rc4-ia64.S
106 @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \
107Index: openssl-0.9.8o/crypto/rc4/asm/rc4-x86_64.pl
108===================================================================
109--- openssl-0.9.8o.orig/crypto/rc4/asm/rc4-x86_64.pl 2008-09-16 10:47:27.000000000 +0000
110+++ openssl-0.9.8o/crypto/rc4/asm/rc4-x86_64.pl 2010-06-06 13:09:28.000000000 +0000
111@@ -270,7 +270,11 @@
112 xor %r10,%r10
113 xor %r11,%r11
114
115+#ifdef OPENSSL_PIC
116+ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),$idx#d
117+#else
118 mov OPENSSL_ia32cap_P(%rip),$idx#d
119+#endif
120 bt \$20,$idx#d
121 jnc .Lw1stloop
122 bt \$30,$idx#d
123@@ -338,7 +342,11 @@
124 RC4_options:
125 .picmeup %rax
126 lea .Lopts-.(%rax),%rax
127+#ifdef OPENSSL_PIC
128+ mov OPENSSL_ia32cap_P\@GOTPCREL(%rip),%edx
129+#else
130 mov OPENSSL_ia32cap_P(%rip),%edx
131+#endif
132 bt \$20,%edx
133 jnc .Ldone
134 add \$12,%rax
135Index: openssl-0.9.8o/crypto/perlasm/x86unix.pl
136===================================================================
137--- openssl-0.9.8o.orig/crypto/perlasm/x86unix.pl 2008-05-01 23:11:32.000000000 +0000
138+++ openssl-0.9.8o/crypto/perlasm/x86unix.pl 2010-06-06 13:09:28.000000000 +0000
139@@ -400,6 +400,29 @@
140 $stack=4;
141 }
142
143+sub main'function_begin_B_static
144+ {
145+ local($func,$extra)=@_;
146+
147+ &main'external_label($func);
148+ $func=$under.$func;
149+
150+ local($tmp)=<<"EOF";
151+.text
152+EOF
153+ push(@out,$tmp);
154+ if ($main'cpp)
155+ { push(@out,"TYPE($func,\@function)\n"); }
156+ elsif ($main'coff)
157+ { $tmp=push(@out,".def\t$func;\t.scl\t2;\t.type\t32;\t.endef\n"); }
158+ elsif ($main'aout and !$main'pic)
159+ { }
160+ else { push(@out,".type $func,\@function\n"); }
161+ push(@out,".align\t$align\n");
162+ push(@out,"$func:\n");
163+ $stack=4;
164+ }
165+
166 sub main'function_end
167 {
168 local($func)=@_;
169@@ -694,7 +717,17 @@
170 {
171 $tmp=<<___;
172 .section .init
173+#ifdef OPENSSL_PIC
174+ pushl %ebx
175+ call .pic_point0
176+.pic_point0:
177+ popl %ebx
178+ addl \$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx
179+ call $under$f\@PLT
180+ popl %ebx
181+#else
182 call $under$f
183+#endif
184 jmp .Linitalign
185 .align $align
186 .Linitalign:
187Index: openssl-0.9.8o/crypto/perlasm/cbc.pl
188===================================================================
189--- openssl-0.9.8o.orig/crypto/perlasm/cbc.pl 2005-05-09 21:48:00.000000000 +0000
190+++ openssl-0.9.8o/crypto/perlasm/cbc.pl 2010-06-06 13:09:28.000000000 +0000
191@@ -122,7 +122,11 @@
192 &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
193 &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
194
195- &call($enc_func);
196+ &call (&label("pic_point0"));
197+ &set_label("pic_point0");
198+ &blindpop("ebx");
199+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
200+ &call("$enc_func\@PLT");
201
202 &mov("eax", &DWP($data_off,"esp","",0));
203 &mov("ebx", &DWP($data_off+4,"esp","",0));
204@@ -187,7 +191,11 @@
205 &mov(&DWP($data_off,"esp","",0), "eax"); # put in array for call
206 &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
207
208- &call($enc_func);
209+ &call (&label("pic_point1"));
210+ &set_label("pic_point1");
211+ &blindpop("ebx");
212+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]");
213+ &call("$enc_func\@PLT");
214
215 &mov("eax", &DWP($data_off,"esp","",0));
216 &mov("ebx", &DWP($data_off+4,"esp","",0));
217@@ -220,7 +228,11 @@
218 &mov(&DWP($data_off,"esp","",0), "eax"); # put back
219 &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
220
221- &call($dec_func);
222+ &call (&label("pic_point2"));
223+ &set_label("pic_point2");
224+ &blindpop("ebx");
225+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]");
226+ &call("$dec_func\@PLT");
227
228 &mov("eax", &DWP($data_off,"esp","",0)); # get return
229 &mov("ebx", &DWP($data_off+4,"esp","",0)); #
230@@ -263,7 +275,11 @@
231 &mov(&DWP($data_off,"esp","",0), "eax"); # put back
232 &mov(&DWP($data_off+4,"esp","",0), "ebx"); #
233
234- &call($dec_func);
235+ &call (&label("pic_point3"));
236+ &set_label("pic_point3");
237+ &blindpop("ebx");
238+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]");
239+ &call("$dec_func\@PLT");
240
241 &mov("eax", &DWP($data_off,"esp","",0)); # get return
242 &mov("ebx", &DWP($data_off+4,"esp","",0)); #
243Index: openssl-0.9.8o/crypto/perlasm/x86_64-xlate.pl
244===================================================================
245--- openssl-0.9.8o.orig/crypto/perlasm/x86_64-xlate.pl 2010-06-06 13:09:00.000000000 +0000
246+++ openssl-0.9.8o/crypto/perlasm/x86_64-xlate.pl 2010-06-06 13:09:28.000000000 +0000
247@@ -435,7 +435,7 @@
248
249 chomp($line);
250
251- $line =~ s|[#!].*$||; # get rid of asm-style comments...
252+# $line =~ s|[#!].*$||; # get rid of asm-style comments...
253 $line =~ s|/\*.*\*/||; # ... and C-style comments...
254 $line =~ s|^\s+||; # ... and skip white spaces in beginning
255
256Index: openssl-0.9.8o/crypto/aes/asm/aes-586.pl
257===================================================================
258--- openssl-0.9.8o.orig/crypto/aes/asm/aes-586.pl 2008-12-17 14:14:51.000000000 +0000
259+++ openssl-0.9.8o/crypto/aes/asm/aes-586.pl 2010-06-06 13:09:28.000000000 +0000
260@@ -250,7 +250,7 @@
261 sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
262
263 &public_label("AES_Te");
264-&function_begin_B("_x86_AES_encrypt");
265+&function_begin_B_static("_x86_AES_encrypt");
266 if ($vertical_spin) {
267 # I need high parts of volatile registers to be accessible...
268 &exch ($s1="edi",$key="ebx");
269@@ -539,7 +539,7 @@
270 }
271
272 &public_label("AES_Td");
273-&function_begin_B("_x86_AES_decrypt");
274+&function_begin_B_static("_x86_AES_decrypt");
275 # note that caller is expected to allocate stack frame for me!
276 &mov (&DWP(12,"esp"),$key); # save key
277
278@@ -1461,15 +1461,22 @@
279 &public_label("AES_Td");
280 &public_label("AES_Te");
281 &function_begin_B("AES_set_decrypt_key");
282+ &push ("ebx");
283 &mov ("eax",&wparam(0));
284 &mov ("ecx",&wparam(1));
285 &mov ("edx",&wparam(2));
286 &sub ("esp",12);
287+
288+ &call (&label("pic_point0"));
289+ &set_label("pic_point0");
290+ &blindpop("ebx");
291+ &add ("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
292 &mov (&DWP(0,"esp"),"eax");
293 &mov (&DWP(4,"esp"),"ecx");
294 &mov (&DWP(8,"esp"),"edx");
295- &call ("AES_set_encrypt_key");
296+ &call ("AES_set_encrypt_key\@PLT");
297 &add ("esp",12);
298+ &pop ("ebx");
299 &cmp ("eax",0);
300 &je (&label("proceed"));
301 &ret ();