Skip to content

Commit dafeff3

Browse files
committed
ocaml: patch incorrect -flat_namespace usage
We apply two patches: one of our generic Libtool patches, and a patch upstreamed upstreamed at ocaml/ocaml#10723. We embed a patch here to avoid having to regenerate `configure`, which we would need to do to use the upstreamed patch. This is needed for bottling on Monterey.
1 parent 17e4af5 commit dafeff3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Formula/ocaml.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ class Ocaml < Formula
3535
# brew detection doesn't find, and so needs to be explicitly blocked.
3636
pour_bottle? only_if: :default_prefix
3737

38+
# Remove use of -flat_namespace. Upstreamed at
39+
# https://github.com/ocaml/ocaml/pull/10723
40+
# We embed a patch here so we don't have to regenerate configure.
41+
patch :p0, :DATA
42+
43+
# Fix -flat_namespace being used on Big Sur and later.
44+
patch do
45+
url "https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff"
46+
sha256 "35acd6aebc19843f1a2b3a63e880baceb0f5278ab1ace661e57a502d9d78c93c"
47+
end
48+
3849
def install
3950
ENV.deparallelize # Builds are not parallel-safe, esp. with many cores
4051

@@ -55,3 +66,16 @@ def install
5566
assert_match HOMEBREW_PREFIX.to_s, shell_output("#{bin}/ocamlc -where")
5667
end
5768
end
69+
70+
__END__
71+
--- configure.orig 2021-10-24 09:34:12.145636659 +0800
72+
+++ configure 2021-10-24 09:34:30.504944693 +0800
73+
@@ -13644,7 +13644,7 @@
74+
if test x"$enable_shared" != "xno"; then :
75+
case $host in #(
76+
*-apple-darwin*) :
77+
- mksharedlib="$CC -shared -flat_namespace -undefined suppress \
78+
+ mksharedlib="$CC -shared -undefined dynamic_lookup \
79+
-Wl,-no_compact_unwind"
80+
shared_libraries_supported=true ;; #(
81+
*-*-mingw32) :

0 commit comments

Comments
 (0)