summaryrefslogtreecommitdiff
path: root/lang/ocaml/patches
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2017-09-10 08:56:47 +0000
committerwiz <wiz@pkgsrc.org>2017-09-10 08:56:47 +0000
commit5bbd6f9cc26dad911983da67f6953db0cc2182e2 (patch)
treeac5d881b4ecb33e78fd50b7b723e95ac5ca55d34 /lang/ocaml/patches
parent1ae05c8f7fd67e56ff4ae5ff0ffd51570fcbb4b6 (diff)
downloadpkgsrc-5bbd6f9cc26dad911983da67f6953db0cc2182e2.tar.gz
Honor LDFLAGS again. Fixes RELRO build.
Diffstat (limited to 'lang/ocaml/patches')
-rw-r--r--lang/ocaml/patches/patch-otherlibs_systhreads_Makefile32
-rw-r--r--lang/ocaml/patches/patch-otherlibs_threads_Makefile36
2 files changed, 62 insertions, 6 deletions
diff --git a/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile b/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile
index f7785a977ad..92c82d663d5 100644
--- a/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile
+++ b/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile
@@ -1,10 +1,36 @@
-$NetBSD: patch-otherlibs_systhreads_Makefile,v 1.7 2017/09/08 09:12:44 jaapb Exp $
+$NetBSD: patch-otherlibs_systhreads_Makefile,v 1.8 2017/09/10 08:56:47 wiz Exp $
+Honor LDFLAGS.
Use BSD_INSTALL_* instead of mkdir and cp
---- otherlibs/systhreads/Makefile.orig 2017-06-23 15:13:40.000000000 +0000
+--- otherlibs/systhreads/Makefile.orig 2017-07-13 08:56:44.000000000 +0000
+++ otherlibs/systhreads/Makefile
-@@ -124,17 +124,17 @@ INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDI
+@@ -27,6 +27,7 @@ export OCAML_FLEXLINK:=$(ROOTDIR)/boot/o
+ endif
+
+ LIBS = -nostdlib -I $(ROOTDIR)/stdlib -I $(ROOTDIR)/otherlibs/$(UNIXLIB)
++LDOPTS=-ldopt "$(LDFLAGS)"
+
+ CAMLC=$(CAMLRUN) $(ROOTDIR)/ocamlc $(LIBS)
+ CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt $(LIBS)
+@@ -62,14 +63,14 @@ all: lib$(LIBNAME).$(A) $(LIBNAME).cma $
+ allopt: lib$(LIBNAME)nat.$(A) $(LIBNAME).cmxa $(CMIFILES)
+
+ lib$(LIBNAME).$(A): $(BYTECODE_C_OBJS)
+- $(MKLIB) -o $(LIBNAME) $(BYTECODE_C_OBJS) $(PTHREAD_LINK)
++ $(MKLIB) -o $(LIBNAME) $(BYTECODE_C_OBJS) $(PTHREAD_LINK) $(LDOPTS)
+
+ lib$(LIBNAME)nat.$(A): $(NATIVECODE_C_OBJS)
+ $(MKLIB) -o $(LIBNAME)nat $^
+
+ $(LIBNAME).cma: $(THREADS_BCOBJS)
+ ifeq "$(UNIX_OR_WIN32)" "unix"
+- $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall $(PTHREAD_CAML_LINK) $^
++ $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall $(PTHREAD_CAML_LINK) $(LDOPTS) $^
+ # TODO: Figure out why -cclib -lunix is used here.
+ # It may be because of the threadsUnix module which is deprecated.
+ # It may hence be good to figure out whether this module shouldn't be
+@@ -124,17 +125,17 @@ INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDI
install:
if test -f dllthreads$(EXT_DLL); then \
cp dllthreads$(EXT_DLL) "$(INSTALL_STUBLIBDIR)/dllthreads$(EXT_DLL)"; fi
diff --git a/lang/ocaml/patches/patch-otherlibs_threads_Makefile b/lang/ocaml/patches/patch-otherlibs_threads_Makefile
index 55327f4d9c3..2f4b851a4b9 100644
--- a/lang/ocaml/patches/patch-otherlibs_threads_Makefile
+++ b/lang/ocaml/patches/patch-otherlibs_threads_Makefile
@@ -1,10 +1,40 @@
-$NetBSD: patch-otherlibs_threads_Makefile,v 1.9 2017/09/08 09:12:44 jaapb Exp $
+$NetBSD: patch-otherlibs_threads_Makefile,v 1.10 2017/09/10 08:56:47 wiz Exp $
+Honor LDFLAGS.
Use BSD_INSTALL_* instead of mkdir and cp
---- otherlibs/threads/Makefile.orig 2017-06-23 15:13:40.000000000 +0000
+--- otherlibs/threads/Makefile.orig 2017-07-13 08:56:44.000000000 +0000
+++ otherlibs/threads/Makefile
-@@ -111,12 +111,12 @@ CMIFILES=thread.cmi mutex.cmi condition.
+@@ -33,6 +33,8 @@ CAML_OBJS=thread.cmo mutex.cmo condition
+
+ LIB=../../stdlib
+
++LDOPTS=-ldopt "$(LDFLAGS)"
++
+ LIB_OBJS=$(LIB)/camlinternalFormatBasics.cmo pervasives.cmo \
+ $(LIB)/array.cmo $(LIB)/list.cmo $(LIB)/char.cmo $(LIB)/bytes.cmo \
+ $(LIB)/string.cmo $(LIB)/sys.cmo $(LIB)/sort.cmo marshal.cmo \
+@@ -59,16 +61,16 @@ all: libvmthreads.a threads.cma stdlib.c
+ allopt:
+
+ libvmthreads.a: $(C_OBJS)
+- $(MKLIB) -o threads -oc vmthreads $(C_OBJS)
++ $(MKLIB) -o threads -oc vmthreads $(C_OBJS) $(LDOPTS)
+
+ threads.cma: $(CAML_OBJS)
+- $(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS)
++ $(MKLIB) -ocamlc '$(CAMLC)' -o threads -oc vmthreads $(CAML_OBJS) $(LDOPTS)
+
+ stdlib.cma: $(LIB_OBJS)
+ $(CAMLC) -a -o stdlib.cma $(LIB_OBJS)
+
+ unix.cma: $(UNIXLIB_OBJS)
+- $(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $(UNIXLIB_OBJS)
++ $(MKLIB) -ocamlc '$(CAMLC)' -o unix -linkall $(UNIXLIB_OBJS) $(LDOPTS)
+
+ pervasives.cmo: pervasives.mli pervasives.cmi pervasives.ml
+ $(CAMLC) ${COMPFLAGS} -nopervasives -c pervasives.ml
+@@ -111,12 +113,12 @@ CMIFILES=thread.cmi mutex.cmi condition.
install:
if test -f dllvmthreads.so; then \