about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2024-10-02 17:56:43 +0800
committerCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2024-10-02 17:56:43 +0800
commitcb5a61d8a1caf235a4852559086895ce841ac292 (patch)
tree291e9d9b82476f1eef4a907da1f28d26e19ebb98
parent146e535f7b644a3d38f8e90c415974b23ff295c0 (diff)
downloadafl++-cb5a61d8a1caf235a4852559086895ce841ac292.tar.gz
Update macOS linker flags in GNUmakefile.llvm
`-flat_namespace` is effectively deprecated and doesn't really work as
expected these days. Omitting the `-flat_namespace` means that binaries
are built with a two-level namespace, which don't support
`-undefined suppress`.

The idiomatic way of telling the linker to look up undefined symbols at
runtime is using `-undefined dynamic_lookup`, which is supported by a
two-level namespace.

See also:
ocaml/ocaml#10723
mono/mono#21257
-rw-r--r--GNUmakefile.llvm2
1 files changed, 1 insertions, 1 deletions
diff --git a/GNUmakefile.llvm b/GNUmakefile.llvm
index d5dcb09b..2e806ab8 100644
--- a/GNUmakefile.llvm
+++ b/GNUmakefile.llvm
@@ -327,7 +327,7 @@ endif
 
 # User teor2345 reports that this is required to make things work on MacOS X.
 ifeq "$(SYS)" "Darwin"
-  CLANG_LFL += -Wl,-flat_namespace -Wl,-undefined,suppress
+  CLANG_LFL += -Wl,-undefined,dynamic_lookup
   override LLVM_HAVE_LTO := 0
   override LLVM_LTO := 0
 else