aballier    17/02/21 14:16:41

  Added:                010_all_execstacks.patch 020_all_configure.patch
                        050_all_objinfoldflags.patch series
  Log:
  Add patches for ocaml 4.05

Revision  Changes    Path
1.1                  src/patchsets/ocaml/4.05.0/010_all_execstacks.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/010_all_execstacks.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/010_all_execstacks.patch?rev=1.1&content-type=text/plain

Index: 010_all_execstacks.patch
===================================================================
Fix the EXEC_STACK in ocaml compiled binaries (#153382)

Index: ocaml-4.05.0-beta2/asmrun/sparc.S
===================================================================
--- ocaml-4.05.0-beta2.orig/asmrun/sparc.S
+++ ocaml-4.05.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.05.0-beta2/asmcomp/sparc/emit.mlp
===================================================================
--- ocaml-4.05.0-beta2.orig/asmcomp/sparc/emit.mlp
+++ ocaml-4.05.0-beta2/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`;



1.1                  src/patchsets/ocaml/4.05.0/020_all_configure.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/020_all_configure.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/020_all_configure.patch?rev=1.1&content-type=text/plain

Index: 020_all_configure.patch
===================================================================
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.05.0-beta2/configure
===================================================================
--- ocaml-4.05.0-beta2.orig/configure
+++ ocaml-4.05.0-beta2/configure
@@ -355,7 +355,7 @@ esac
 # with ocamlc.
 
 bytecc="$cc"
-mkexe="\$(BYTECC)"
+mkexe="\$(BYTECC) \$(BYTECCLINKOPTS)"
 mkexedebugflag="-g"
 bytecccompopts=""
 byteccprivatecompopts=""
@@ -1795,6 +1795,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 && \
@@ -2023,7 +2033,7 @@ echo "DYNLINKOPTS=$dllib" >> Makefile
 echo "OTHERLIBRARIES=$otherlibraries" >> Makefile
 echo "CC_PROFILE=$cc_profile" >> Makefile
 echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile
-echo "PACKLD=$partialld $nativecclinkopts -o\\ " >> Makefile
+echo "PACKLD=$partialld $nativeccrawlinkopts -o\\ " >> Makefile
 echo "IFLEXDIR=$iflexdir" >> Makefile
 echo "O=o" >> Makefile
 echo "A=a" >> Makefile



1.1                  src/patchsets/ocaml/4.05.0/050_all_objinfoldflags.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/050_all_objinfoldflags.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/050_all_objinfoldflags.patch?rev=1.1&content-type=text/plain

Index: 050_all_objinfoldflags.patch
===================================================================
Index: ocaml-4.05.0-beta2/tools/Makefile
===================================================================
--- ocaml-4.05.0-beta2.orig/tools/Makefile
+++ ocaml-4.05.0-beta2/tools/Makefile
@@ -320,7 +320,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 \



1.1                  src/patchsets/ocaml/4.05.0/series

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/series?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/ocaml/4.05.0/series?rev=1.1&content-type=text/plain

Index: series
===================================================================
010_all_execstacks.patch
020_all_configure.patch
050_all_objinfoldflags.patch




Reply via email to