diff options
author | 2016-03-01 17:21:34 +0000 | |
---|---|---|
committer | 2016-03-01 17:21:34 +0000 | |
commit | ec62debff21ae731c04567e681b2559c6b9be2dc (patch) | |
tree | dd0290d153d96287b4094e29fafdc15890415d6a /src/patchsets/ocaml | |
parent | initial 2.23 patchset (diff) | |
download | gentoo-ec62debff21ae731c04567e681b2559c6b9be2dc.tar.gz gentoo-ec62debff21ae731c04567e681b2559c6b9be2dc.tar.bz2 gentoo-ec62debff21ae731c04567e681b2559c6b9be2dc.zip |
add patches for ocaml 4.03
Diffstat (limited to 'src/patchsets/ocaml')
-rw-r--r-- | src/patchsets/ocaml/4.03.0/010_all_execstacks.patch | 40 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.03.0/020_all_configure.patch | 51 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.03.0/050_all_objinfoldflags.patch | 13 | ||||
-rw-r--r-- | src/patchsets/ocaml/4.03.0/series | 3 |
4 files changed, 107 insertions, 0 deletions
diff --git a/src/patchsets/ocaml/4.03.0/010_all_execstacks.patch b/src/patchsets/ocaml/4.03.0/010_all_execstacks.patch new file mode 100644 index 0000000000..30cf23ec61 --- /dev/null +++ b/src/patchsets/ocaml/4.03.0/010_all_execstacks.patch @@ -0,0 +1,40 @@ +Fix the EXEC_STACK in ocaml compiled binaries (#153382) + +Index: ocaml-4.03.0+beta1/asmrun/sparc.S +=================================================================== +--- ocaml-4.03.0+beta1.orig/asmrun/sparc.S ++++ ocaml-4.03.0+beta1/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.03.0+beta1/asmcomp/sparc/emit.mlp +=================================================================== +--- ocaml-4.03.0+beta1.orig/asmcomp/sparc/emit.mlp ++++ ocaml-4.03.0+beta1/asmcomp/sparc/emit.mlp +@@ -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() = +@@ -750,6 +756,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`; diff --git a/src/patchsets/ocaml/4.03.0/020_all_configure.patch b/src/patchsets/ocaml/4.03.0/020_all_configure.patch new file mode 100644 index 0000000000..4505a987ec --- /dev/null +++ b/src/patchsets/ocaml/4.03.0/020_all_configure.patch @@ -0,0 +1,51 @@ +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.03.0+beta1/configure +=================================================================== +--- ocaml-4.03.0+beta1.orig/configure ++++ ocaml-4.03.0+beta1/configure +@@ -290,7 +290,7 @@ esac + # Configure the bytecode compiler + + bytecc="$cc" +-mkexe="\$(BYTECC)" ++mkexe="\$(BYTECC) \$(BYTECCLINKOPTS)" + mkexedebugflag="-g" + bytecccompopts="" + bytecclinkopts="" +@@ -1671,6 +1671,16 @@ fi + echo "X11_INCLUDES=$x11_include" >> Makefile + echo "X11_LINK=$x11_link" >> Makefile + ++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" ++ + # Look for BFD library + + if sh ./hasgot -DPACKAGE=ocaml -i bfd.h && \ +@@ -1769,6 +1779,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 +@@ -1780,7 +1791,7 @@ echo "OTHERLIBRARIES=$otherlibraries" >> + 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.03.0/050_all_objinfoldflags.patch b/src/patchsets/ocaml/4.03.0/050_all_objinfoldflags.patch new file mode 100644 index 0000000000..e7b2fc170f --- /dev/null +++ b/src/patchsets/ocaml/4.03.0/050_all_objinfoldflags.patch @@ -0,0 +1,13 @@ +Index: ocaml-4.03.0+beta1/tools/Makefile.shared +=================================================================== +--- ocaml-4.03.0+beta1.orig/tools/Makefile.shared ++++ ocaml-4.03.0+beta1/tools/Makefile.shared +@@ -273,7 +273,7 @@ CCOUT = -o $(EMPTY) + endif + + objinfo_helper$(EXE): objinfo_helper.c ../config/s.h +- $(BYTECC) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ ++ $(MKEXE) $(CCOUT)objinfo_helper$(EXE) $(BYTECCCOMPOPTS) \ + $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) objinfo_helper.c $(LIBBFD_LINK) + + OBJINFO=../compilerlibs/ocamlcommon.cma \ diff --git a/src/patchsets/ocaml/4.03.0/series b/src/patchsets/ocaml/4.03.0/series new file mode 100644 index 0000000000..a459212299 --- /dev/null +++ b/src/patchsets/ocaml/4.03.0/series @@ -0,0 +1,3 @@ +010_all_execstacks.patch +020_all_configure.patch +050_all_objinfoldflags.patch |