pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/ocaml Honor LDFLAGS. Fixes RELRO build.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/477b9b44cb0e
branches:  trunk
changeset: 365467:477b9b44cb0e
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Mon Jul 17 23:26:23 2017 +0000

description:
Honor LDFLAGS. Fixes RELRO build.

diffstat:

 lang/ocaml/Makefile                                    |  12 +++++-
 lang/ocaml/distinfo                                    |   8 ++-
 lang/ocaml/patches/patch-otherlibs_Makefile            |  23 +++++++++++
 lang/ocaml/patches/patch-otherlibs_systhreads_Makefile |  32 ++++++++++++++-
 lang/ocaml/patches/patch-otherlibs_threads_Makefile    |  35 ++++++++++++++++-
 lang/ocaml/patches/patch-yacc_Makefile                 |  15 +++++++
 6 files changed, 114 insertions(+), 11 deletions(-)

diffs (200 lines):

diff -r 3367cb93c6a6 -r 477b9b44cb0e lang/ocaml/Makefile
--- a/lang/ocaml/Makefile       Mon Jul 17 16:29:00 2017 +0000
+++ b/lang/ocaml/Makefile       Mon Jul 17 23:26:23 2017 +0000
@@ -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 @@
 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_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 -r 3367cb93c6a6 -r 477b9b44cb0e lang/ocaml/distinfo
--- a/lang/ocaml/distinfo       Mon Jul 17 16:29:00 2017 +0000
+++ b/lang/ocaml/distinfo       Mon Jul 17 23:26:23 2017 +0000
@@ -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-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_ocamloptp.ml) = bb6ba38e9bb260117d67491566474fda750d708b
 SHA1 (patch-utils_clflags.ml) = d16832fedb5db08d035f1661eaf9c3b48411bc69
 SHA1 (patch-utils_clflags.mli) = 381951d9583e032d3a520b68a8fe9f867ec49995
+SHA1 (patch-yacc_Makefile) = e7e77becbc1872fedd37bdeb4614739eb67977c8
diff -r 3367cb93c6a6 -r 477b9b44cb0e lang/ocaml/patches/patch-otherlibs_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ocaml/patches/patch-otherlibs_Makefile       Mon Jul 17 23:26:23 2017 +0000
@@ -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 -r 3367cb93c6a6 -r 477b9b44cb0e lang/ocaml/patches/patch-otherlibs_systhreads_Makefile
--- a/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile    Mon Jul 17 16:29:00 2017 +0000
+++ b/lang/ocaml/patches/patch-otherlibs_systhreads_Makefile    Mon Jul 17 23:26:23 2017 +0000
@@ -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 -r 3367cb93c6a6 -r 477b9b44cb0e lang/ocaml/patches/patch-otherlibs_threads_Makefile
--- a/lang/ocaml/patches/patch-otherlibs_threads_Makefile       Mon Jul 17 16:29:00 2017 +0000
+++ b/lang/ocaml/patches/patch-otherlibs_threads_Makefile       Mon Jul 17 23:26:23 2017 +0000
@@ -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 -r 3367cb93c6a6 -r 477b9b44cb0e lang/ocaml/patches/patch-yacc_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ocaml/patches/patch-yacc_Makefile    Mon Jul 17 23:26:23 2017 +0000
@@ -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'`\"" > $@



Home | Main Index | Thread Index | Old Index