From bce2bc0465efa922ae129487bf34cf7c0a2d8c76 Mon Sep 17 00:00:00 2001 From: Christopher Milan Date: Thu, 16 Oct 2025 10:07:21 -0400 Subject: [PATCH] Revert "use RTLD_GLOBAL on macos" (#12738) This reverts commit 89fe3e574d6876a44624ddf9b59a78a850c3f060. --- autogen_stubs.sh | 4 ++-- tinygrad/runtime/autogen/llvm.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autogen_stubs.sh b/autogen_stubs.sh index 122247bb60..5d02cd37f4 100755 --- a/autogen_stubs.sh +++ b/autogen_stubs.sh @@ -279,9 +279,9 @@ generate_llvm() { --clang-args="$(llvm-config-14 --cflags)" \ -o "$BASE/llvm.py" - sed -i "s\import ctypes\import ctypes, tinygrad.runtime.support.llvm as llvm_support, tinygrad.helpers as helpers\g" "$BASE/llvm.py" + sed -i "s\import ctypes\import ctypes, tinygrad.runtime.support.llvm as llvm_support\g" "$BASE/llvm.py" sed -i "s\FIXME_STUB\llvm\g" "$BASE/llvm.py" - sed -i "s\FunctionFactoryStub()\ctypes.CDLL(llvm_support.LLVM_PATH, ctypes.RTLD_GLOBAL if helpers.OSX else ctypes.DEFAULT_MODE)\g" "$BASE/llvm.py" + sed -i "s\FunctionFactoryStub()\ctypes.CDLL(llvm_support.LLVM_PATH)\g" "$BASE/llvm.py" fixup "$BASE/llvm.py" } diff --git a/tinygrad/runtime/autogen/llvm.py b/tinygrad/runtime/autogen/llvm.py index 55c3ecdd05..1b50e41e49 100644 --- a/tinygrad/runtime/autogen/llvm.py +++ b/tinygrad/runtime/autogen/llvm.py @@ -6,7 +6,7 @@ # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # -import ctypes, tinygrad.runtime.support.llvm as llvm_support, tinygrad.helpers as helpers +import ctypes, tinygrad.runtime.support.llvm as llvm_support class AsDictMixin: @@ -146,7 +146,7 @@ class FunctionFactoryStub: # You can either re-run clan2py with -l /path/to/library.so # Or manually fix this by comment the ctypes.CDLL loading _libraries = {} -_libraries['llvm'] = ctypes.CDLL(llvm_support.LLVM_PATH, ctypes.RTLD_GLOBAL if helpers.OSX else ctypes.DEFAULT_MODE) # ctypes.CDLL('llvm') +_libraries['llvm'] = ctypes.CDLL(llvm_support.LLVM_PATH) # ctypes.CDLL('llvm') c_int128 = ctypes.c_ubyte*16 c_uint128 = c_int128 void = None