summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2017-02-24 14:41:42 +0000
committerDamien Doligez <damien.doligez@gmail.com>2017-02-24 15:41:42 +0100
commit70f84eef2dd50aa5f45e99ac8042398d428093b6 (patch)
treedf5e53b3f9581b5f23973a7427273fb856edb383 /configure
parent7ce080e102d940d60d80087cbfa3e241f2efd755 (diff)
downloadocaml-70f84eef2dd50aa5f45e99ac8042398d428093b6.tar.gz
Build dylibs, not bundles, on macOS. (#988)
Generally, OCaml creates dynamic libraries in three cases: * when building bytecode stubs (dllX.so); * when building a .cmxs plugin; * when building a .native.so or even .byte.so. Right now, this results in DLLs on Windows and ELF shared objects on Linux, all of which can be dynamically loaded (with dlopen() or equivalent) or linked against (with the -l linker flag or equivalent). However, on macOS, this is not the case. macOS has two kinds of dynamic libraries: "bundles" and "dylibs". Prior to the version 10.4, there have been significant differences between these, which I will not describe in this commit because 10.4 has long became irrelevant. After 10.4, there are only two differences: * rpath is handled slightly differently. * dylibs can be linked against, with the -l linker flag; Before this commit, ocamlc/ocamlopt on macOS produce bundles, when using the .so extension for the output file. After this commit, OCaml on macOS will produce dylibs, when using the same extension. The rationale is as follows: * For bytecode stubs and plugins, the exact structure of which is essentially an implementation detail of the OCaml runtime, nothing will change because they can still be dynamically loaded. * For .native.so and .byte.so objects, there are two changes: 1. The objects can be linked against with the -l flag. 2. The objects can be linked with the -cclib -shared flag, which is what ocamlbuild and perhaps other buildsystems pass when building a shared object through -output-obj/-output-complete-obj.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure4
1 files changed, 2 insertions, 2 deletions
diff --git a/configure b/configure
index a41ff0e170..d71ab25fa2 100755
--- a/configure
+++ b/configure
@@ -791,13 +791,13 @@ if test $with_sharedlibs = "yes"; then
mksharedlibrpath="-rpath "
shared_libraries_supported=true;;
i[3456]86-*-darwin[89].*)
- mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress \
+ mksharedlib="$bytecc -shared -flat_namespace -undefined suppress \
-read_only_relocs suppress"
bytecccompopts="$dl_defs $bytecccompopts"
dl_needs_underscore=false
shared_libraries_supported=true;;
*-apple-darwin*)
- mksharedlib="$bytecc -bundle -flat_namespace -undefined suppress \
+ mksharedlib="$bytecc -shared -flat_namespace -undefined suppress \
-Wl,-no_compact_unwind"
bytecccompopts="$dl_defs $bytecccompopts"
dl_needs_underscore=false