Commit b282265e authored by Natanael Copa's avatar Natanael Copa

testing/ocaml: upgrade to 4.03.0

parent eb481902
Fix the EXEC_STACK in ocaml compiled binaries (#153382) Fix the EXEC_STACK in ocaml compiled binaries (#153382)
Index: ocaml-4.02.2/asmrun/sparc.S Index: ocaml-4.03.0+beta1/asmrun/sparc.S
=================================================================== ===================================================================
--- ocaml-4.02.2.orig/asmrun/sparc.S --- ocaml-4.03.0+beta1.orig/asmrun/sparc.S
+++ ocaml-4.02.2/asmrun/sparc.S +++ ocaml-4.03.0+beta1/asmrun/sparc.S
@@ -356,3 +356,8 @@ caml_system__frametable: @@ -358,3 +358,8 @@ caml_system__frametable:
.type caml_raise_exception, #function .type caml_raise_exception, #function
.type caml_system__frametable, #object .type caml_system__frametable, #object
#endif #endif
...@@ -13,62 +13,11 @@ Index: ocaml-4.02.2/asmrun/sparc.S ...@@ -13,62 +13,11 @@ Index: ocaml-4.02.2/asmrun/sparc.S
+.section .note.GNU-stack,"",%progbits +.section .note.GNU-stack,"",%progbits
+#endif +#endif
+ +
Index: ocaml-4.02.2/asmcomp/arm/emit.mlp Index: ocaml-4.03.0+beta1/asmcomp/sparc/emit.mlp
=================================================================== ===================================================================
--- ocaml-4.02.2.orig/asmcomp/arm/emit.mlp --- ocaml-4.03.0+beta1.orig/asmcomp/sparc/emit.mlp
+++ ocaml-4.02.2/asmcomp/arm/emit.mlp +++ ocaml-4.03.0+beta1/asmcomp/sparc/emit.mlp
@@ -888,6 +888,13 @@ let data l = @@ -737,6 +737,12 @@ let data l =
` .data\n`;
List.iter emit_item l
+(* Mark stack as non executable *)
+let nx_stack() =
+ if Config.system = "linux" then
+ ` .section .note.GNU-stack,\"\",%progbits\n`
+
+
+
(* Beginning / end of an assembly file *)
let begin_assembly() =
@@ -920,6 +927,7 @@ let begin_assembly() =
`{emit_symbol lbl_begin}:\n`
let end_assembly () =
+ nx_stack();
let lbl_end = Compilenv.make_symbol (Some "code_end") in
` .text\n`;
` .globl {emit_symbol lbl_end}\n`;
Index: ocaml-4.02.2/asmcomp/power/emit.mlp
===================================================================
--- ocaml-4.02.2.orig/asmcomp/power/emit.mlp
+++ ocaml-4.02.2/asmcomp/power/emit.mlp
@@ -882,6 +882,12 @@ let data l =
emit_string data_space;
List.iter emit_item l
+(* Mark stack as non executable *)
+let nx_stack() =
+ if Config.system = "elf" then
+ ` .section .note.GNU-stack,\"\",%progbits\n`
+
+
(* Beginning / end of an assembly file *)
let begin_assembly() =
@@ -898,6 +904,7 @@ let begin_assembly() =
`{emit_symbol lbl_begin}:\n`
let end_assembly() =
+ nx_stack();
if pic_externals then
(* Emit the pointers to external functions *)
StringSet.iter emit_external !external_functions;
Index: ocaml-4.02.2/asmcomp/sparc/emit.mlp
===================================================================
--- ocaml-4.02.2.orig/asmcomp/sparc/emit.mlp
+++ ocaml-4.02.2/asmcomp/sparc/emit.mlp
@@ -724,6 +724,12 @@ let data l =
` .data\n`; ` .data\n`;
List.iter emit_item l List.iter emit_item l
...@@ -81,7 +30,7 @@ Index: ocaml-4.02.2/asmcomp/sparc/emit.mlp ...@@ -81,7 +30,7 @@ Index: ocaml-4.02.2/asmcomp/sparc/emit.mlp
(* Beginning / end of an assembly file *) (* Beginning / end of an assembly file *)
let begin_assembly() = let begin_assembly() =
@@ -737,6 +743,7 @@ let begin_assembly() = @@ -750,6 +756,7 @@ let begin_assembly() =
`{emit_symbol lbl_begin}:\n` `{emit_symbol lbl_begin}:\n`
let end_assembly() = let end_assembly() =
...@@ -89,28 +38,3 @@ Index: ocaml-4.02.2/asmcomp/sparc/emit.mlp ...@@ -89,28 +38,3 @@ Index: ocaml-4.02.2/asmcomp/sparc/emit.mlp
` .text\n`; ` .text\n`;
let lbl_end = Compilenv.make_symbol (Some "code_end") in let lbl_end = Compilenv.make_symbol (Some "code_end") in
` .global {emit_symbol lbl_end}\n`; ` .global {emit_symbol lbl_end}\n`;
Index: ocaml-4.02.2/asmrun/power-elf.S
===================================================================
--- ocaml-4.02.2.orig/asmrun/power-elf.S
+++ ocaml-4.02.2/asmrun/power-elf.S
@@ -478,3 +478,8 @@ caml_system__frametable:
.long .L105 + 4 /* return address into callback */
.short -1 /* negative size count => use callback link */
.short 0 /* no roots here */
+
+#ifdef __ELF__
+.section .note.GNU-stack,"",%progbits
+#endif
+
Index: ocaml-4.02.2/asmrun/arm.S
===================================================================
--- ocaml-4.02.2.orig/asmrun/arm.S
+++ ocaml-4.02.2/asmrun/arm.S
@@ -498,3 +498,7 @@ caml_system__frametable:
.align 2
.type caml_system__frametable, %object
.size caml_system__frametable, .-caml_system__frametable
+
+#ifdef __ELF__
+.section .note.GNU-stack,"",%progbits
+#endif
...@@ -2,11 +2,11 @@ The configure script doesn't inherit previous defined variables, ...@@ -2,11 +2,11 @@ The configure script doesn't inherit previous defined variables,
overwriting previous declarations of bytecccompopts, bytecclinkopts, overwriting previous declarations of bytecccompopts, bytecclinkopts,
nativecccompopts and nativecclinkopts. Reported upstream as issue 0004267. nativecccompopts and nativecclinkopts. Reported upstream as issue 0004267.
Index: ocaml-4.02.2/configure Index: ocaml-4.03.0+beta1/configure
=================================================================== ===================================================================
--- ocaml-4.02.2.orig/configure --- ocaml-4.03.0+beta1.orig/configure
+++ ocaml-4.02.2/configure +++ ocaml-4.03.0+beta1/configure
@@ -314,7 +314,7 @@ esac @@ -290,7 +290,7 @@ esac
# Configure the bytecode compiler # Configure the bytecode compiler
bytecc="$cc" bytecc="$cc"
...@@ -15,9 +15,9 @@ Index: ocaml-4.02.2/configure ...@@ -15,9 +15,9 @@ Index: ocaml-4.02.2/configure
mkexedebugflag="-g" mkexedebugflag="-g"
bytecccompopts="" bytecccompopts=""
bytecclinkopts="" bytecclinkopts=""
@@ -1694,7 +1694,15 @@ sharedcccompopts="-O $sharedcccompopts" @@ -1671,6 +1671,16 @@ fi
echo "X11_INCLUDES=$x11_include" >> Makefile
# Final twiddling of compiler options to work around known bugs echo "X11_LINK=$x11_link" >> Makefile
+bytecccompopts="$CFLAGS $bytecccompopts" +bytecccompopts="$CFLAGS $bytecccompopts"
+bytecclinkopts="$LDFLAGS $bytecclinkopts" +bytecclinkopts="$LDFLAGS $bytecclinkopts"
...@@ -25,13 +25,14 @@ Index: ocaml-4.02.2/configure ...@@ -25,13 +25,14 @@ Index: ocaml-4.02.2/configure
+nativeccrawlinkopts="$RAW_LDFLAGS $nativecclinkopts" +nativeccrawlinkopts="$RAW_LDFLAGS $nativecclinkopts"
+nativecclinkopts="$LDFLAGS $nativecclinkopts" +nativecclinkopts="$LDFLAGS $nativecclinkopts"
+nativecccompopts="$CFLAGS $nativecccompopts" +nativecccompopts="$CFLAGS $nativecccompopts"
nativeccprofopts="$nativecccompopts" +nativeccprofopts="$nativecccompopts"
+mksharedlib="$mksharedlib $LDFLAGS" +mksharedlib="$mksharedlib $LDFLAGS"
+mkmaindll="$mkmaindll $LDFLAGS" +mkmaindll="$mkmaindll $LDFLAGS"
case "$buggycc" in +
gcc.2.96) # Look for BFD library
bytecccompopts="$bytecccompopts -fomit-frame-pointer"
@@ -1730,6 +1738,7 @@ echo "NATIVECC=$nativecc" >> Makefile if sh ./hasgot -DPACKAGE=ocaml -i bfd.h && \
@@ -1769,6 +1779,7 @@ echo "NATIVECC=$nativecc" >> Makefile
echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile
echo "NATIVECCPROFOPTS=$nativeccprofopts" >> Makefile echo "NATIVECCPROFOPTS=$nativeccprofopts" >> Makefile
echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile
...@@ -39,7 +40,7 @@ Index: ocaml-4.02.2/configure ...@@ -39,7 +40,7 @@ Index: ocaml-4.02.2/configure
echo "NATIVECCRPATH=$nativeccrpath" >> Makefile echo "NATIVECCRPATH=$nativeccrpath" >> Makefile
echo "NATIVECCLIBS=$cclibs $dllib" >> Makefile echo "NATIVECCLIBS=$cclibs $dllib" >> Makefile
echo "ASM=$as" >> Makefile echo "ASM=$as" >> Makefile
@@ -1741,7 +1750,7 @@ echo "OTHERLIBRARIES=$otherlibraries" >> @@ -1780,7 +1791,7 @@ echo "OTHERLIBRARIES=$otherlibraries" >>
echo "CC_PROFILE=$cc_profile" >> Makefile echo "CC_PROFILE=$cc_profile" >> Makefile
echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile
echo "PARTIALLD=$partialld" >> Makefile echo "PARTIALLD=$partialld" >> Makefile
......
Index: ocaml-4.02.2/tools/Makefile.shared Index: ocaml-4.03.0+beta1/tools/Makefile.shared
=================================================================== ===================================================================
--- ocaml-4.02.2.orig/tools/Makefile.shared --- ocaml-4.03.0+beta1.orig/tools/Makefile.shared
+++ ocaml-4.02.2/tools/Makefile.shared +++ ocaml-4.03.0+beta1/tools/Makefile.shared
@@ -286,7 +286,7 @@ CCOUT = -o $(EMPTY) @@ -273,7 +273,7 @@ CCOUT = -o $(EMPTY)
endif endif
objinfo_helper$(EXE): objinfo_helper.c ../config/s.h objinfo_helper$(EXE): objinfo_helper.c ../config/s.h
- $(BYTECC) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ - $(BYTECC) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \
+ $(MKEXE) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ + $(MKEXE) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \
objinfo_helper.c $(LIBBFD_LINK) $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) objinfo_helper.c $(LIBBFD_LINK)
OBJINFO=../compilerlibs/ocamlcommon.cma \ OBJINFO=../compilerlibs/ocamlcommon.cma \
# Contributor: Borys Zhukov <mp5@mp5.im> # Contributor: Borys Zhukov <mp5@mp5.im>
# Maintainer: Borys Zhukov <mp5@mp5.im> # Maintainer: Borys Zhukov <mp5@mp5.im>
pkgname=ocaml pkgname=ocaml
pkgver=4.02.3 pkgver=4.03.0
pkgrel=0 pkgrel=0
pkgdesc="Main implementation of the Caml programming language" pkgdesc="Main implementation of the Caml programming language"
url="http://caml.inria.fr" url="http://caml.inria.fr"
...@@ -61,15 +61,15 @@ package() { ...@@ -61,15 +61,15 @@ package() {
find "$pkgdir"/usr/lib/ocaml -name \*.ml -delete find "$pkgdir"/usr/lib/ocaml -name \*.ml -delete
} }
md5sums="ef1a324608c97031cbd92a442d685ab7 ocaml-4.02.3.tar.gz md5sums="43812739ea1b4641cf480f57f977c149 ocaml-4.03.0.tar.gz
fd073bf6c3a451a031b4900a86c0db48 010_all_execstacks.patch 08f8697f0c9aca620fb946418cd7272e 010_all_execstacks.patch
3838542279e0367271bf4dfd3dbb73c7 020_all_configure.patch 6e11ac70d23a21d9b38ac6b30cecc243 020_all_configure.patch
2dbce3de02afd4041311c3eb0076fa1e 050_all_objinfoldflags.patch" 6d63f3e63a4bd533fd1884e78a6de2ba 050_all_objinfoldflags.patch"
sha256sums="928fb5f64f4e141980ba567ff57b62d8dc7b951b58be9590ffb1be2172887a72 ocaml-4.02.3.tar.gz sha256sums="7fdf280cc6c0a2de4fc9891d0bf4633ea417046ece619f011fd44540fcfc8da2 ocaml-4.03.0.tar.gz
63e22fa143c3503951e5f3919028969b1713e2818a1158e5b0a340c4cf27bef8 010_all_execstacks.patch a32653d95498bdbdec4595d2d93270d6719b5512d7f0c2787fc216699aa5bc23 010_all_execstacks.patch
5344d1cf1a90fd5c12467da35688dde283cf2f0b19eefd7a04a6d570841a3fb8 020_all_configure.patch 747c8a48b5988776d1b0e9cbbf77b9dac63315d17854e9202b150362c16054e7 020_all_configure.patch
817fac532237d986277476c6890a498e5095f584c1959b286d188b51b0de1dbc 050_all_objinfoldflags.patch" 59c2bf7465bfc44ca5b984ba84a25341b2b7b7aae2c5019c1e3d3f26aeb22766 050_all_objinfoldflags.patch"
sha512sums="be69e00abc2503582d7a07440a59db6bc992cce8ed2812bf02de07578760ead2858544013bb1a7a28a3c812b79c2f545cdaef11653b04a39c04a898510c36187 ocaml-4.02.3.tar.gz sha512sums="91d5c0b2fcc52fc05be64bf54d3c7be8d77ee754e847907909d4e123c1d00c9f62523770d56bb81f80200f75ec53ab874e031ce46f7b437febbd3a8e6800e2ca ocaml-4.03.0.tar.gz
9c3ed77d84c4d1766f4d5568ca6c33aff08bd9d118b5a8c7af84b1263e39d3bba1e74221aad7290a10bc79a2c8ee86a7fa57d02eacabc9d36c14c7dacdda42cb 010_all_execstacks.patch 71ac807fb1173863b9dcf8e5fb4e651e0155d6cd0e4b327f5457b83fc09e1b5fbe34150c5d8ccd24f0faff1a8419f5ed8310aa60af1f38c2766ccc37dc6c3835 010_all_execstacks.patch
a4fb27979a75d951ee5c065e628028f03527618855fac4af3321cd2466953e0d1d40dec01816c012596ae656fb5bee51a2112b5038122a98e60d190f13e474b1 020_all_configure.patch 286758402517a1345556d374b0c3fc49eb93f1ec2bb9ccd2ffe1cc043f59d93b154f68eb9ff410020a15d3d8f148b27f249b7f97954b0e8a080cdd32d6014b4a 020_all_configure.patch
7d3f60153ab7df98879c6acff04e90977633449e16d176a48f492a6995a0a201e0f14255e6c45788edb6174832316e1ab893622a0b24d8dd1864ab8a0109e6ba 050_all_objinfoldflags.patch" 61d9cae6c8be7c16ed4aa6fafc533e2879caadbbe0e023775c1d735c0e54e66e94b9ffab8dc0b0b12c19ccf5c389e05f62af822014d202ae54c52943a0639753 050_all_objinfoldflags.patch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment