diff options
author | wiz <wiz@pkgsrc.org> | 2017-07-17 23:26:23 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2017-07-17 23:26:23 +0000 |
commit | bd637aa3f6eeeb69b5bbf7b6e1c839f4c1563dcd (patch) | |
tree | 7f913e26559f00ff0200b94912960b6b0b6a7abf /lang/ocaml | |
parent | 40e8bb7e882847b610e5717f0bedccfa6703d88e (diff) | |
download | pkgsrc-bd637aa3f6eeeb69b5bbf7b6e1c839f4c1563dcd.tar.gz |
Honor LDFLAGS. Fixes RELRO build.
Diffstat (limited to 'lang/ocaml')
-rw-r--r-- | lang/ocaml/Makefile | 12 | ||||
-rw-r--r-- | lang/ocaml/distinfo | 8 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-otherlibs_Makefile | 23 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-otherlibs_systhreads_Makefile | 32 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-otherlibs_threads_Makefile | 35 | ||||
-rw-r--r-- | lang/ocaml/patches/patch-yacc_Makefile | 15 |
6 files changed, 114 insertions, 11 deletions
diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile index 4c36a882679..d07fcf5c6bf 100644 --- a/lang/ocaml/Makefile +++ b/lang/ocaml/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.110 2017/07/12 07:52:28 he Exp $ +# $NetBSD: Makefile,v 1.111 2017/07/17 23:26:23 wiz Exp $ .include "Makefile.common" @@ -72,6 +72,8 @@ PLIST_SRC+= ${PKGDIR}/PLIST INSTALL_MAKE_FLAGS+= SHELL=${SH:Q} .endif +INSTALLATION_DIRS= ${PKGMANDIR}/man1 + OPSYSVARS+= EXTRA_RT_LIBS EXTRA_RT_LIBS.NetBSD= -lcurses EXTRA_RT_LIBS.*= @@ -81,11 +83,17 @@ SUBST_FILES.extra-rt-libs= bytecomp/bytelink.ml SUBST_SED.extra-rt-libs+= -e 's,@EXTRA_RT_LIBS@,${EXTRA_RT_LIBS},g' SUBST_STAGE.extra-rt-libs= pre-configure +SUBST_CLASSES+= linkopts +SUBST_FILES.linkopts= configure +SUBST_SED.linkopts+= -e '\|bytecclinkopts=|s|""|"${LDFLAGS}"|' +SUBST_SED.linkopts+= -e "\|nativecclinkopts=|s|''|\"${LDFLAGS:C/-Wl,//}\"|" +SUBST_STAGE.linkopts= pre-configure +SUBST_MESSAGE.linkopts= Honor LDFLAGS. + do-test: cd ${WRKSRC}/testsuite && ${MAKE_PROGRAM} all post-install: - ${INSTALL_MAN_DIR} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 set -e ; cd ${DESTDIR}${PREFIX}/lib/ocaml/${PKGMANDIR}/man1; \ for m in *; do \ ln -s ${PREFIX}/lib/ocaml/${PKGMANDIR}/man1/$$m \ diff --git a/lang/ocaml/distinfo b/lang/ocaml/distinfo index 992498146b5..041f71655d6 100644 --- a/lang/ocaml/distinfo +++ b/lang/ocaml/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.106 2017/07/12 07:52:28 he Exp $ +$NetBSD: distinfo,v 1.107 2017/07/17 23:26:23 wiz Exp $ SHA1 (ocaml-4.04.2.tar.gz) = 24281675ea90c9234e323d556f1d4cd7bdab8ec1 RMD160 (ocaml-4.04.2.tar.gz) = 3d8f78cd544815233f814a0e24eba8d3c948b190 @@ -19,10 +19,11 @@ SHA1 (patch-driver_optmain.ml) = 5ce77f1f906ce59cb533b4d25e4d57f7a70ab1b3 SHA1 (patch-man_Makefile) = f4fcde662061e7e7e664ec42617f1e37f1fcf214 SHA1 (patch-ocamldoc_Makefile) = ba4e2c76e1f2832988dd6933cd9d68a7ba3fb870 SHA1 (patch-ocamldoc_odoc__messages.ml) = 77f650a5f34f40b9648a8d5091e9aa31efb5734b +SHA1 (patch-otherlibs_Makefile) = e7b777dd1c5723eb5950db38525fd9565258801f SHA1 (patch-otherlibs_bigarray_mmap__unix.c) = 39979990e3463c944598ac0d0bf8a2c4a3f0d558 SHA1 (patch-otherlibs_dynlink_Makefile) = f892254a5e5a01462ecbf68e45f9bfe5783158d3 -SHA1 (patch-otherlibs_systhreads_Makefile) = d731864c613383b36846cae4961b7a221bd6160e -SHA1 (patch-otherlibs_threads_Makefile) = 47331a06a93eac68403fa2114495782430087f1e +SHA1 (patch-otherlibs_systhreads_Makefile) = cc579ea90c738b6ae8a377d15695b907b630e660 +SHA1 (patch-otherlibs_threads_Makefile) = 3d01ed6de00d8d1991e7cd3ec4fa004f542792e9 SHA1 (patch-stdlib_Makefile) = 67591b1809dd72aac446238491e371d135466734 SHA1 (patch-stdlib_Makefile.shared) = dac87da3b0461a2c816b862af3a0c0bdf740b749 SHA1 (patch-testsuite_tests_tool-ocamldoc-man_Makefile) = 41c7d6ffa98ed4f4fe261d6ed890be045c55adaf @@ -32,3 +33,4 @@ SHA1 (patch-tools_ocamlmklib) = 49ea077e3f77527336548ae6515d135461b83080 SHA1 (patch-tools_ocamloptp.ml) = bb6ba38e9bb260117d67491566474fda750d708b SHA1 (patch-utils_clflags.ml) = d16832fedb5db08d035f1661eaf9c3b48411bc69 SHA1 (patch-utils_clflags.mli) = 381951d9583e032d3a520b68a8fe9f867ec49995 +SHA1 (patch-yacc_Makefile) = e7e77becbc1872fedd37bdeb4614739eb67977c8 diff --git a/lang/ocaml/patches/patch-otherlibs_Makefile b/lang/ocaml/patches/patch-otherlibs_Makefile new file mode 100644 index 00000000000..5dd287314ec --- /dev/null +++ b/lang/ocaml/patches/patch-otherlibs_Makefile @@ -0,0 +1,23 @@ +$NetBSD: patch-otherlibs_Makefile,v 1.6 2017/07/17 23:26:23 wiz Exp $ + +Honor LDFLAGS. + +--- otherlibs/Makefile.orig 2017-06-23 15:13:40.000000000 +0000 ++++ otherlibs/Makefile +@@ -32,7 +32,7 @@ CAMLOPT=$(CAMLRUN) $(ROOTDIR)/ocamlopt - + CFLAGS=-I$(ROOTDIR)/byterun $(SHAREDCCCOMPOPTS) $(EXTRACFLAGS) + + # Compilation options +-CC=$(BYTECC) ++CC=$(BYTECC) $(BYTECCLINKOPTS) + COMPFLAGS=-absname -w +a-4-9-41-42-44-45-48 -warn-error A -bin-annot -g \ + -safe-string -strict-sequence -strict-formats $(EXTRACAMLFLAGS) + ifeq "$(FLAMBDA)" "true" +@@ -53,6 +53,7 @@ MKLIB=$(CAMLRUN) $(ROOTDIR)/tools/ocamlm + #LINKOPTS= + #LDOPTS= + #HEADERS= ++LDOPTS=-ldopt "$(LDFLAGS)" + + CMIFILES ?= $(CAMLOBJS:.cmo=.cmi) + CAMLOBJS_NAT ?= $(CAMLOBJS:.cmo=.cmx) diff --git a/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile b/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile index 57e4ff93938..e92e855c0a5 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.5 2016/05/05 08:12:01 jaapb Exp $ +$NetBSD: patch-otherlibs_systhreads_Makefile,v 1.6 2017/07/17 23:26:23 wiz Exp $ Use BSD_INSTALL_* instead of mkdir and cp ---- otherlibs/systhreads/Makefile.orig 2016-04-01 12:53:41.000000000 +0000 +--- otherlibs/systhreads/Makefile.orig 2017-06-23 15:13:40.000000000 +0000 +++ otherlibs/systhreads/Makefile -@@ -86,21 +86,21 @@ INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDI +@@ -29,6 +29,7 @@ OPTCOMPFLAGS=-O3 + else + OPTCOMPFLAGS= + endif ++LDOPTS=-ldopt "$(LDFLAGS)" + + BYTECODE_C_OBJS=st_stubs_b.o + NATIVECODE_C_OBJS=st_stubs_n.o +@@ -40,7 +41,7 @@ all: libthreads.a threads.cma + allopt: libthreadsnat.a threads.cmxa + + libthreads.a: $(BYTECODE_C_OBJS) +- $(MKLIB) -o threads $(BYTECODE_C_OBJS) $(PTHREAD_LINK) ++ $(MKLIB) -o threads $(BYTECODE_C_OBJS) $(PTHREAD_LINK) $(LDOPTS) + + st_stubs_b.o: st_stubs.c st_posix.h + $(BYTECC) -I../../byterun $(BYTECCCOMPOPTS) $(SHAREDCCCOMPOPTS) \ +@@ -60,7 +61,7 @@ st_stubs_n.o: st_stubs.c st_posix.h + + threads.cma: $(THREAD_OBJS) + $(MKLIB) -ocamlc '$(CAMLC)' -o threads $(THREAD_OBJS) \ +- -cclib -lunix $(PTHREAD_CAML_LINK) ++ -cclib -lunix $(PTHREAD_CAML_LINK) $(LDOPTS) + + # See remark above: force static linking of libthreadsnat.a + threads.cmxa: $(THREAD_OBJS:.cmo=.cmx) +@@ -86,21 +87,21 @@ INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDI install: if test -f dllthreads.so; then \ diff --git a/lang/ocaml/patches/patch-otherlibs_threads_Makefile b/lang/ocaml/patches/patch-otherlibs_threads_Makefile index 631e989d8d4..c40fe145bb7 100644 --- a/lang/ocaml/patches/patch-otherlibs_threads_Makefile +++ b/lang/ocaml/patches/patch-otherlibs_threads_Makefile @@ -1,10 +1,39 @@ -$NetBSD: patch-otherlibs_threads_Makefile,v 1.7 2016/05/05 08:12:01 jaapb Exp $ +$NetBSD: patch-otherlibs_threads_Makefile,v 1.8 2017/07/17 23:26:23 wiz Exp $ Use BSD_INSTALL_* instead of mkdir and cp ---- otherlibs/threads/Makefile.orig 2016-04-01 12:53:41.000000000 +0000 +--- otherlibs/threads/Makefile.orig 2017-06-23 15:13:40.000000000 +0000 +++ otherlibs/threads/Makefile -@@ -109,14 +109,14 @@ INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDI +@@ -31,6 +31,8 @@ C_OBJS=scheduler.o + + CAML_OBJS=thread.cmo mutex.cmo condition.cmo event.cmo threadUnix.cmo + ++LDOPTS=-ldopt "$(LDFLAGS)" ++ + LIB=../../stdlib + + LIB_OBJS=$(LIB)/camlinternalFormatBasics.cmo pervasives.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 +@@ -109,14 +111,14 @@ INSTALL_STUBLIBDIR=$(DESTDIR)$(STUBLIBDI install: if test -f dllvmthreads.so; then \ diff --git a/lang/ocaml/patches/patch-yacc_Makefile b/lang/ocaml/patches/patch-yacc_Makefile new file mode 100644 index 00000000000..d89c45f10e7 --- /dev/null +++ b/lang/ocaml/patches/patch-yacc_Makefile @@ -0,0 +1,15 @@ +$NetBSD: patch-yacc_Makefile,v 1.1 2017/07/17 23:26:23 wiz Exp $ + +Honor LDFLAGS when building ocamlyacc. + +--- yacc/Makefile.orig 2017-06-23 15:13:40.000000000 +0000 ++++ yacc/Makefile +@@ -27,7 +27,7 @@ OBJS= closure.$(O) error.$(O) lalr.$(O) + all: ocamlyacc$(EXE) + + ocamlyacc$(EXE): $(OBJS) +- $(MKEXE) -o ocamlyacc$(EXE) $(OBJS) $(EXTRALIBS) ++ $(MKEXE) $(BYTECCLINKOPTS) -o ocamlyacc$(EXE) $(OBJS) $(EXTRALIBS) + + version.h : ../VERSION + echo "#define OCAML_VERSION \"`sed -e 1q $^ | tr -d '\r'`\"" > $@ |