1 |
aballier 13/03/02 17:13:30 |
2 |
|
3 |
Added: 010_all_execstacks.patch 020_all_configure.patch |
4 |
050_all_objinfoldflags.patch 060_all_tk86.patch |
5 |
series |
6 |
Log: |
7 |
add patches for 4.00.1 |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 src/patchsets/ocaml/4.00.1/010_all_execstacks.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/010_all_execstacks.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/010_all_execstacks.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: 010_all_execstacks.patch |
16 |
=================================================================== |
17 |
Fix the EXEC_STACK in ocaml compiled binaries (#153382) |
18 |
|
19 |
Index: ocaml-4.00.1/asmrun/sparc.S |
20 |
=================================================================== |
21 |
--- ocaml-4.00.1.orig/asmrun/sparc.S |
22 |
+++ ocaml-4.00.1/asmrun/sparc.S |
23 |
@@ -358,3 +358,8 @@ caml_system__frametable: |
24 |
.type caml_raise_exception, #function |
25 |
.type caml_system__frametable, #object |
26 |
#endif |
27 |
+ |
28 |
+#ifdef __ELF__ |
29 |
+.section .note.GNU-stack,"",%progbits |
30 |
+#endif |
31 |
+ |
32 |
Index: ocaml-4.00.1/asmcomp/arm/emit.mlp |
33 |
=================================================================== |
34 |
--- ocaml-4.00.1.orig/asmcomp/arm/emit.mlp |
35 |
+++ ocaml-4.00.1/asmcomp/arm/emit.mlp |
36 |
@@ -895,6 +895,13 @@ let data l = |
37 |
` .data\n`; |
38 |
List.iter emit_item l |
39 |
|
40 |
+(* Mark stack as non executable *) |
41 |
+let nx_stack() = |
42 |
+ if Config.system = "linux" then |
43 |
+ ` .section .note.GNU-stack,\"\",%progbits\n` |
44 |
+ |
45 |
+ |
46 |
+ |
47 |
(* Beginning / end of an assembly file *) |
48 |
|
49 |
let begin_assembly() = |
50 |
@@ -926,6 +933,7 @@ let begin_assembly() = |
51 |
`{emit_symbol lbl_begin}:\n` |
52 |
|
53 |
let end_assembly () = |
54 |
+ nx_stack(); |
55 |
let lbl_end = Compilenv.make_symbol (Some "code_end") in |
56 |
` .text\n`; |
57 |
` .globl {emit_symbol lbl_end}\n`; |
58 |
Index: ocaml-4.00.1/asmcomp/power/emit.mlp |
59 |
=================================================================== |
60 |
--- ocaml-4.00.1.orig/asmcomp/power/emit.mlp |
61 |
+++ ocaml-4.00.1/asmcomp/power/emit.mlp |
62 |
@@ -930,6 +930,12 @@ let data l = |
63 |
emit_string data_space; |
64 |
List.iter emit_item l |
65 |
|
66 |
+(* Mark stack as non executable *) |
67 |
+let nx_stack() = |
68 |
+ if Config.system = "elf" then |
69 |
+ ` .section .note.GNU-stack,\"\",%progbits\n` |
70 |
+ |
71 |
+ |
72 |
(* Beginning / end of an assembly file *) |
73 |
|
74 |
let begin_assembly() = |
75 |
@@ -946,6 +952,7 @@ let begin_assembly() = |
76 |
`{emit_symbol lbl_begin}:\n` |
77 |
|
78 |
let end_assembly() = |
79 |
+ nx_stack(); |
80 |
if pic_externals then |
81 |
(* Emit the pointers to external functions *) |
82 |
StringSet.iter emit_external !external_functions; |
83 |
Index: ocaml-4.00.1/asmcomp/sparc/emit.mlp |
84 |
=================================================================== |
85 |
--- ocaml-4.00.1.orig/asmcomp/sparc/emit.mlp |
86 |
+++ ocaml-4.00.1/asmcomp/sparc/emit.mlp |
87 |
@@ -745,6 +745,12 @@ let data l = |
88 |
` .data\n`; |
89 |
List.iter emit_item l |
90 |
|
91 |
+(* Mark stack as non executable *) |
92 |
+let nx_stack() = |
93 |
+ if Config.system = "linux" then |
94 |
+ ` .section .note.GNU-stack,\"\",%progbits\n` |
95 |
+ |
96 |
+ |
97 |
(* Beginning / end of an assembly file *) |
98 |
|
99 |
let begin_assembly() = |
100 |
@@ -758,6 +764,7 @@ let begin_assembly() = |
101 |
`{emit_symbol lbl_begin}:\n` |
102 |
|
103 |
let end_assembly() = |
104 |
+ nx_stack(); |
105 |
` .text\n`; |
106 |
let lbl_end = Compilenv.make_symbol (Some "code_end") in |
107 |
` .global {emit_symbol lbl_end}\n`; |
108 |
Index: ocaml-4.00.1/asmrun/power-elf.S |
109 |
=================================================================== |
110 |
--- ocaml-4.00.1.orig/asmrun/power-elf.S |
111 |
+++ ocaml-4.00.1/asmrun/power-elf.S |
112 |
@@ -424,3 +424,8 @@ caml_system__frametable: |
113 |
.long .L105 + 4 /* return address into callback */ |
114 |
.short -1 /* negative size count => use callback link */ |
115 |
.short 0 /* no roots here */ |
116 |
+ |
117 |
+#ifdef __ELF__ |
118 |
+.section .note.GNU-stack,"",%progbits |
119 |
+#endif |
120 |
+ |
121 |
Index: ocaml-4.00.1/asmrun/arm.S |
122 |
=================================================================== |
123 |
--- ocaml-4.00.1.orig/asmrun/arm.S |
124 |
+++ ocaml-4.00.1/asmrun/arm.S |
125 |
@@ -446,3 +446,7 @@ caml_system__frametable: |
126 |
.align 2 |
127 |
.type caml_system__frametable, %object |
128 |
.size caml_system__frametable, .-caml_system__frametable |
129 |
+ |
130 |
+#ifdef __ELF__ |
131 |
+.section .note.GNU-stack,"",%progbits |
132 |
+#endif |
133 |
|
134 |
|
135 |
|
136 |
1.1 src/patchsets/ocaml/4.00.1/020_all_configure.patch |
137 |
|
138 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/020_all_configure.patch?rev=1.1&view=markup |
139 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/020_all_configure.patch?rev=1.1&content-type=text/plain |
140 |
|
141 |
Index: 020_all_configure.patch |
142 |
=================================================================== |
143 |
The configure script doesn't inherit previous defined variables, |
144 |
overwriting previous declarations of bytecccompopts, bytecclinkopts, |
145 |
nativecccompopts and nativecclinkopts. Reported upstream as issue 0004267. |
146 |
|
147 |
Index: ocaml-4.00.1/configure |
148 |
=================================================================== |
149 |
--- ocaml-4.00.1.orig/configure |
150 |
+++ ocaml-4.00.1/configure |
151 |
@@ -255,7 +255,7 @@ esac |
152 |
# Configure the bytecode compiler |
153 |
|
154 |
bytecc="$cc" |
155 |
-mkexe="\$(BYTECC)" |
156 |
+mkexe="\$(BYTECC) \$(BYTECCLINKOPTS)" |
157 |
mkexedebugflag="-g" |
158 |
bytecccompopts="" |
159 |
bytecclinkopts="" |
160 |
@@ -1569,7 +1569,15 @@ fi |
161 |
|
162 |
# Final twiddling of compiler options to work around known bugs |
163 |
|
164 |
+bytecccompopts="$CFLAGS $bytecccompopts" |
165 |
+bytecclinkopts="$LDFLAGS $bytecclinkopts" |
166 |
+natdynlinkopts="$LDFLAGS $natdynlinkopts" |
167 |
+nativeccrawlinkopts="$RAW_LDFLAGS $nativecclinkopts" |
168 |
+nativecclinkopts="$LDFLAGS $nativecclinkopts" |
169 |
+nativecccompopts="$CFLAGS $nativecccompopts" |
170 |
nativeccprofopts="$nativecccompopts" |
171 |
+mksharedlib="$mksharedlib $LDFLAGS" |
172 |
+mkmaindll="$mkmaindll $LDFLAGS" |
173 |
case "$buggycc" in |
174 |
gcc.2.96) |
175 |
bytecccompopts="$bytecccompopts -fomit-frame-pointer" |
176 |
@@ -1605,6 +1613,7 @@ echo "NATIVECC=$nativecc" >> Makefile |
177 |
echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile |
178 |
echo "NATIVECCPROFOPTS=$nativeccprofopts" >> Makefile |
179 |
echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile |
180 |
+echo "NATIVECCRAWLINKOPTS=$nativeccrawlinkopts" >> Makefile |
181 |
echo "NATIVECCRPATH=$nativeccrpath" >> Makefile |
182 |
echo "NATIVECCLIBS=$cclibs $dllib" >> Makefile |
183 |
echo "ASM=$as" >> Makefile |
184 |
@@ -1617,7 +1626,7 @@ echo "DEBUGGER=$debugger" >> Makefile |
185 |
echo "CC_PROFILE=$cc_profile" >> Makefile |
186 |
echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile |
187 |
echo "PARTIALLD=$partialld" >> Makefile |
188 |
-echo "PACKLD=\$(PARTIALLD) \$(NATIVECCLINKOPTS) -o " \ |
189 |
+echo "PACKLD=\$(PARTIALLD) \$(NATIVECCRAWLINKOPTS) -o " \ |
190 |
| sed -e 's/ $/\\ /' >> Makefile |
191 |
echo "DLLCCCOMPOPTS=$dllccompopts" >> Makefile |
192 |
echo "IFLEXDIR=$iflexdir" >> Makefile |
193 |
|
194 |
|
195 |
|
196 |
1.1 src/patchsets/ocaml/4.00.1/050_all_objinfoldflags.patch |
197 |
|
198 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/050_all_objinfoldflags.patch?rev=1.1&view=markup |
199 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/050_all_objinfoldflags.patch?rev=1.1&content-type=text/plain |
200 |
|
201 |
Index: 050_all_objinfoldflags.patch |
202 |
=================================================================== |
203 |
Index: ocaml-4.00.1/tools/Makefile.shared |
204 |
=================================================================== |
205 |
--- ocaml-4.00.1.orig/tools/Makefile.shared |
206 |
+++ ocaml-4.00.1/tools/Makefile.shared |
207 |
@@ -268,7 +268,7 @@ beforedepend:: opnames.ml |
208 |
# Display info on compiled files |
209 |
|
210 |
objinfo_helper$(EXE): objinfo_helper.c ../config/s.h |
211 |
- $(BYTECC) -o objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ |
212 |
+ $(MKEXE) -o objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ |
213 |
objinfo_helper.c $(LIBBFD_LINK) |
214 |
|
215 |
OBJINFO=../utils/misc.cmo ../utils/config.cmo \ |
216 |
|
217 |
|
218 |
|
219 |
1.1 src/patchsets/ocaml/4.00.1/060_all_tk86.patch |
220 |
|
221 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/060_all_tk86.patch?rev=1.1&view=markup |
222 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/060_all_tk86.patch?rev=1.1&content-type=text/plain |
223 |
|
224 |
Index: 060_all_tk86.patch |
225 |
=================================================================== |
226 |
From archlinux. Otherwise, labltk is not built with tk 8.6 installed... |
227 |
https://bugs.archlinux.org/task/33302 |
228 |
|
229 |
Index: ocaml-4.00.1/configure |
230 |
=================================================================== |
231 |
--- ocaml-4.00.1.orig/configure |
232 |
+++ ocaml-4.00.1/configure |
233 |
@@ -803,6 +803,8 @@ fi |
234 |
|
235 |
echo "ARCMD=ar" >> Makefile |
236 |
|
237 |
+bytecccompopts="$bytecccompopts -DUSE_INTERP_RESULT" |
238 |
+nativecccompopts="$nativecccompopts -DUSE_INTERP_RESULT" |
239 |
|
240 |
# Do #! scripts work? |
241 |
|
242 |
@@ -1450,6 +1452,7 @@ if test $has_tk = true; then |
243 |
if test -n "$tcl_version" && test "x$tcl_version" != "xnone"; then |
244 |
echo "tcl.h and tk.h version $tcl_version found with \"$tk_defs\"." |
245 |
case $tcl_version in |
246 |
+ 8.6) tclmaj=8 tclmin=6 tkmaj=8 tkmin=6 ;; |
247 |
8.5) tclmaj=8 tclmin=5 tkmaj=8 tkmin=5 ;; |
248 |
8.4) tclmaj=8 tclmin=4 tkmaj=8 tkmin=4 ;; |
249 |
8.3) tclmaj=8 tclmin=3 tkmaj=8 tkmin=3 ;; |
250 |
|
251 |
|
252 |
|
253 |
1.1 src/patchsets/ocaml/4.00.1/series |
254 |
|
255 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/series?rev=1.1&view=markup |
256 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.00.1/series?rev=1.1&content-type=text/plain |
257 |
|
258 |
Index: series |
259 |
=================================================================== |
260 |
010_all_execstacks.patch |
261 |
020_all_configure.patch |
262 |
050_all_objinfoldflags.patch |
263 |
060_all_tk86.patch |