diff options
author | Alexis Ballier <aballier@gentoo.org> | 2012-06-10 20:06:19 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2012-06-10 20:06:19 +0000 |
commit | acb467060e80be2c54a4632211e69a3ac2d32c99 (patch) | |
tree | 50f60c7b0d8249975bc916c8a21aa60265a12007 /src/patchsets/ocaml | |
parent | Automated update of outdated-cpan-packages.xml (diff) | |
download | gentoo-acb467060e80be2c54a4632211e69a3ac2d32c99.tar.gz gentoo-acb467060e80be2c54a4632211e69a3ac2d32c99.tar.bz2 gentoo-acb467060e80be2c54a4632211e69a3ac2d32c99.zip |
add patches for 4.00.0
Diffstat (limited to 'src/patchsets/ocaml')
-rw-r--r-- | src/patchsets/ocaml/4.00.0/010_all_execstacks.patch | 116 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.00.0/020_all_configure.patch | 50 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.00.0/040_all_yaccldflags.patch | 17 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.00.0/050_all_objinfoldflags.patch | 13 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.00.0/series | 4 |
5 files changed, 200 insertions, 0 deletions
diff --git a/src/patchsets/ocaml/4.00.0/010_all_execstacks.patch b/src/patchsets/ocaml/4.00.0/010_all_execstacks.patch new file mode 100644 index 0000000000..38c9b7ab36 --- /dev/null +++ b/src/patchsets/ocaml/4.00.0/010_all_execstacks.patch @@ -0,0 +1,116 @@ +Fix the EXEC_STACK in ocaml compiled binaries (#153382) + +Index: ocaml-4.00.0+beta2/asmrun/sparc.S +=================================================================== +--- ocaml-4.00.0+beta2.orig/asmrun/sparc.S ++++ ocaml-4.00.0+beta2/asmrun/sparc.S +@@ -358,3 +358,8 @@ caml_system__frametable: + .type caml_raise_exception, #function + .type caml_system__frametable, #object + #endif ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-4.00.0+beta2/asmcomp/arm/emit.mlp +=================================================================== +--- ocaml-4.00.0+beta2.orig/asmcomp/arm/emit.mlp ++++ ocaml-4.00.0+beta2/asmcomp/arm/emit.mlp +@@ -895,6 +895,13 @@ 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() = +@@ -926,6 +933,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.00.0+beta2/asmcomp/power/emit.mlp +=================================================================== +--- ocaml-4.00.0+beta2.orig/asmcomp/power/emit.mlp ++++ ocaml-4.00.0+beta2/asmcomp/power/emit.mlp +@@ -930,6 +930,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() = +@@ -946,6 +952,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.00.0+beta2/asmcomp/sparc/emit.mlp +=================================================================== +--- ocaml-4.00.0+beta2.orig/asmcomp/sparc/emit.mlp ++++ ocaml-4.00.0+beta2/asmcomp/sparc/emit.mlp +@@ -745,6 +745,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() = +@@ -758,6 +764,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly() = ++ nx_stack(); + ` .text\n`; + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .global {emit_symbol lbl_end}\n`; +Index: ocaml-4.00.0+beta2/asmrun/power-elf.S +=================================================================== +--- ocaml-4.00.0+beta2.orig/asmrun/power-elf.S ++++ ocaml-4.00.0+beta2/asmrun/power-elf.S +@@ -424,3 +424,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.00.0+beta2/asmrun/arm.S +=================================================================== +--- ocaml-4.00.0+beta2.orig/asmrun/arm.S ++++ ocaml-4.00.0+beta2/asmrun/arm.S +@@ -446,3 +446,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 diff --git a/src/patchsets/ocaml/4.00.0/020_all_configure.patch b/src/patchsets/ocaml/4.00.0/020_all_configure.patch new file mode 100644 index 0000000000..779a4b556b --- /dev/null +++ b/src/patchsets/ocaml/4.00.0/020_all_configure.patch @@ -0,0 +1,50 @@ +The configure script doesn't inherit previous defined variables, +overwriting previous declarations of bytecccompopts, bytecclinkopts, +nativecccompopts and nativecclinkopts. Reported upstream as issue 0004267. + +Index: ocaml-4.00.0+beta2/configure +=================================================================== +--- ocaml-4.00.0+beta2.orig/configure ++++ ocaml-4.00.0+beta2/configure +@@ -255,7 +255,7 @@ esac + # Configure the bytecode compiler + + bytecc="$cc" +-mkexe="\$(BYTECC)" ++mkexe="\$(BYTECC) \$(BYTECCLINKOPTS)" + mkexedebugflag="-g" + bytecccompopts="" + bytecclinkopts="" +@@ -1565,7 +1565,15 @@ fi + + # Final twiddling of compiler options to work around known bugs + ++bytecccompopts="$CFLAGS $bytecccompopts" ++bytecclinkopts="$LDFLAGS $bytecclinkopts" ++natdynlinkopts="$LDFLAGS $natdynlinkopts" ++nativeccrawlinkopts="$RAW_LDFLAGS $nativecclinkopts" ++nativecclinkopts="$LDFLAGS $nativecclinkopts" ++nativecccompopts="$CFLAGS $nativecccompopts" + nativeccprofopts="$nativecccompopts" ++mksharedlib="$mksharedlib $LDFLAGS" ++mkmaindll="$mkmaindll $LDFLAGS" + case "$buggycc" in + gcc.2.96) + bytecccompopts="$bytecccompopts -fomit-frame-pointer" +@@ -1601,6 +1609,7 @@ echo "NATIVECC=$nativecc" >> Makefile + echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile + echo "NATIVECCPROFOPTS=$nativeccprofopts" >> Makefile + echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile ++echo "NATIVECCRAWLINKOPTS=$nativeccrawlinkopts" >> Makefile + echo "NATIVECCRPATH=$nativeccrpath" >> Makefile + echo "NATIVECCLIBS=$cclibs $dllib" >> Makefile + echo "ASM=$as" >> Makefile +@@ -1613,7 +1622,7 @@ echo "DEBUGGER=$debugger" >> Makefile + echo "CC_PROFILE=$cc_profile" >> Makefile + echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile + echo "PARTIALLD=$partialld" >> Makefile +-echo "PACKLD=\$(PARTIALLD) \$(NATIVECCLINKOPTS) -o " \ ++echo "PACKLD=\$(PARTIALLD) \$(NATIVECCRAWLINKOPTS) -o " \ + | sed -e 's/ $/\\ /' >> Makefile + echo "DLLCCCOMPOPTS=$dllccompopts" >> Makefile + echo "IFLEXDIR=$iflexdir" >> Makefile diff --git a/src/patchsets/ocaml/4.00.0/040_all_yaccldflags.patch b/src/patchsets/ocaml/4.00.0/040_all_yaccldflags.patch new file mode 100644 index 0000000000..67717e943a --- /dev/null +++ b/src/patchsets/ocaml/4.00.0/040_all_yaccldflags.patch @@ -0,0 +1,17 @@ +Respect LDFLAGS for ocamlyacc + +http://caml.inria.fr/mantis/view.php?id=4698 + +Index: ocaml-4.00.0+beta2/yacc/Makefile +=================================================================== +--- ocaml-4.00.0+beta2.orig/yacc/Makefile ++++ ocaml-4.00.0+beta2/yacc/Makefile +@@ -25,7 +25,7 @@ OBJS= closure.o error.o lalr.o lr0.o mai + all: ocamlyacc$(EXE) + + ocamlyacc$(EXE): $(OBJS) +- $(CC) $(CFLAGS) $(CCLINKFLAGS) -o ocamlyacc $(OBJS) ++ $(CC) $(LDFLAGS) $(CFLAGS) $(CCLINKFLAGS) -o ocamlyacc $(OBJS) + + version.h : ../VERSION + echo "#define OCAML_VERSION \"`sed -e 1q ../VERSION`\"" >version.h diff --git a/src/patchsets/ocaml/4.00.0/050_all_objinfoldflags.patch b/src/patchsets/ocaml/4.00.0/050_all_objinfoldflags.patch new file mode 100644 index 0000000000..e639585b8f --- /dev/null +++ b/src/patchsets/ocaml/4.00.0/050_all_objinfoldflags.patch @@ -0,0 +1,13 @@ +Index: ocaml-4.00.0+beta2/tools/Makefile.shared +=================================================================== +--- ocaml-4.00.0+beta2.orig/tools/Makefile.shared ++++ ocaml-4.00.0+beta2/tools/Makefile.shared +@@ -268,7 +268,7 @@ beforedepend:: opnames.ml + # Display info on compiled files + + objinfo_helper$(EXE): objinfo_helper.c ../config/s.h +- $(BYTECC) -o objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ ++ $(MKEXE) -o objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ + objinfo_helper.c $(LIBBFD_LINK) + + OBJINFO=../utils/misc.cmo ../utils/config.cmo \ diff --git a/src/patchsets/ocaml/4.00.0/series b/src/patchsets/ocaml/4.00.0/series new file mode 100644 index 0000000000..749ed9f477 --- /dev/null +++ b/src/patchsets/ocaml/4.00.0/series @@ -0,0 +1,4 @@ +010_all_execstacks.patch +020_all_configure.patch +040_all_yaccldflags.patch +050_all_objinfoldflags.patch |