summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authoris <is>2013-03-14 14:29:49 +0000
committeris <is>2013-03-14 14:29:49 +0000
commit7c1b72aee1b2aa4753fa9b5578b3283287faece4 (patch)
tree61af6c8eed7872781e77afe379509ecea0ddf45f /lang
parentefbbae836352a66231bd8a2559e2d5f6662df9a9 (diff)
downloadpkgsrc-7c1b72aee1b2aa4753fa9b5578b3283287faece4.tar.gz
ocamlmklib adds absolute directories (that is, such starting with
'/') given to -L to run-time library search path passed to the lower linker using -Wl,-rpath= This is a problem, because even if we add the right directory with -Wl,-rpath= or variants thereof, the wrong path still is in the RPATH on the resulting binary. This might lead to the wrong library being found at run-time. To build clean packages when using ocamlmklib, '-elfmode' will switch this behaviour off; when using '-elfmode', all following -L parameters won't augment the RPATH, and it has to be updated seperately with -dllpath, -Wl,-rpath= etc. (This is a local pkgsrc stopgap addition, needed to proceed with fixes to xentools41. The issue has been raised with upstream; hopefully this patch can be reverted with a future ocaml package version.)
Diffstat (limited to 'lang')
-rw-r--r--lang/ocaml/Makefile4
-rw-r--r--lang/ocaml/distinfo3
-rw-r--r--lang/ocaml/patches/patch-tools_ocamlmklib41
3 files changed, 46 insertions, 2 deletions
diff --git a/lang/ocaml/Makefile b/lang/ocaml/Makefile
index 748214b361f..a50178c34a9 100644
--- a/lang/ocaml/Makefile
+++ b/lang/ocaml/Makefile
@@ -1,7 +1,9 @@
-# $NetBSD: Makefile,v 1.82 2013/03/04 08:52:53 dbj Exp $
+# $NetBSD: Makefile,v 1.83 2013/03/14 14:29:49 is Exp $
.include "Makefile.common"
+PKGREVISION= 1
+
CONFIGURE_ARGS+= -no-tk
CONFIGURE_ARGS+= -cc ${CC}
CONFIGURE_ENV+= disable_x11=yes
diff --git a/lang/ocaml/distinfo b/lang/ocaml/distinfo
index 393925bb361..b83ecd597ef 100644
--- a/lang/ocaml/distinfo
+++ b/lang/ocaml/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.69 2013/02/18 16:29:28 jaapb Exp $
+$NetBSD: distinfo,v 1.70 2013/03/14 14:29:49 is Exp $
SHA1 (ocaml-4.00.1.tar.bz2) = 10b8a4d0b88d20b003e3dd719f2ac9434e6a1042
RMD160 (ocaml-4.00.1.tar.bz2) = db28f57b463af90650b877af0baf44eb226b0a79
@@ -29,3 +29,4 @@ SHA1 (patch-otherlibs_threads_Makefile) = 803952c7ee2b3f9eeddf473d29515fa102ee8a
SHA1 (patch-stdlib_Makefile) = 85c89d6b9caf08056407da3564e7d2f5353b93a0
SHA1 (patch-stdlib_Makefile.shared) = 42dafb10f88b501982fb0d65c380f1fa61740f54
SHA1 (patch-tools_Makefile.shared) = 8c23fc72c627e2315451e6223946e9257c3e341d
+SHA1 (patch-tools_ocamlmklib) = 4c288c1d7e281aaee9f7ef6d7158b848b49ed2a6
diff --git a/lang/ocaml/patches/patch-tools_ocamlmklib b/lang/ocaml/patches/patch-tools_ocamlmklib
new file mode 100644
index 00000000000..e55a78405f3
--- /dev/null
+++ b/lang/ocaml/patches/patch-tools_ocamlmklib
@@ -0,0 +1,41 @@
+$NetBSD: patch-tools_ocamlmklib,v 1.1 2013/03/14 14:29:49 is Exp $
+
+--- tools/ocamlmklib.mlp.orig 2012-07-17 18:25:54.000000000 +0000
++++ tools/ocamlmklib.mlp
+@@ -26,6 +26,7 @@ and c_objs = ref [] (* .o, .a, .
+ and caml_libs = ref [] (* -cclib to pass to ocamlc, ocamlopt *)
+ and caml_opts = ref [] (* -ccopt to pass to ocamlc, ocamlopt *)
+ and dynlink = ref supports_shared_libraries
++and elfmode = ref false (* do not add C link lib path to run-time path *)
+ and failsafe = ref false (* whether to fall back on static build only *)
+ and c_libs = ref [] (* libs to pass to mksharedlib and ocamlc -cclib *)
+ and c_Lopts = ref [] (* options to pass to mksharedlib and ocamlc -cclib *)
+@@ -95,8 +96,9 @@ let parse_arguments argv =
+ c_libs := s :: !c_libs
+ else if starts_with s "-L" then
+ (c_Lopts := s :: !c_Lopts;
+- let l = chop_prefix s "-L" in
+- if not (Filename.is_relative l) then rpath := l :: !rpath)
++ if not !elfmode then
++ (let l = chop_prefix s "-L" in
++ if not (Filename.is_relative l) then rpath := l :: !rpath))
+ else if s = "-ocamlc" then
+ ocamlc := next_arg ()
+ else if s = "-ocamlopt" then
+@@ -107,6 +109,8 @@ let parse_arguments argv =
+ output_c := next_arg()
+ else if s = "-dllpath" || s = "-R" || s = "-rpath" then
+ rpath := next_arg() :: !rpath
++ else if s = "-elfmode" then
++ elfmode := true
+ else if starts_with s "-R" then
+ rpath := chop_prefix s "-R" :: !rpath
+ else if s = "-Wl,-rpath" then
+@@ -150,6 +154,7 @@ Usage: ocamlmklib [options] <.cmo|.cma|.
+ \n -ccopt <opt> C option passed to ocamlc -a or ocamlopt -a only\
+ \n -custom disable dynamic loading\
+ \n -dllpath <dir> Add <dir> to the run-time search path for DLLs\
++\n -elfmode Do not add link-time search path to run-time path\
+ \n -F<dir> Specify a framework directory (MacOSX)\
+ \n -framework <name> Use framework <name> (MacOSX)\
+ \n -help Print this help message and exit\