···1+diff --git a/src/linker.cpp b/src/linker.cpp
2+index ec165ef7d..91a28b8fc 100644
3+--- a/src/linker.cpp
4++++ b/src/linker.cpp
5+@@ -769,18 +769,6 @@ try_cross_linking:;
6+ gbString platform_lib_str = gb_string_make(heap_allocator(), "");
7+ defer (gb_string_free(platform_lib_str));
8+ if (build_context.metrics.os == TargetOs_darwin) {
9+- platform_lib_str = gb_string_appendc(platform_lib_str, "-Wl,-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/usr/local/lib ");
10+-
11+- // Homebrew's default library path, checking if it exists to avoid linking warnings.
12+- if (gb_file_exists("/opt/homebrew/lib")) {
13+- platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/homebrew/lib ");
14+- }
15+-
16+- // MacPort's default library path, checking if it exists to avoid linking warnings.
17+- if (gb_file_exists("/opt/local/lib")) {
18+- platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib ");
19+- }
20+-
21+ // Only specify this flag if the user has given a minimum version to target.
22+ // This will cause warnings to show up for mismatched libraries.
23+ if (build_context.minimum_os_version_string_given) {
···15 cython,
16 fetchFromGitHub,
17 git,
18- darwin,
19 jsoncpp,
20 nsync,
21 openssl,
···409 );
410411 # Note: we cannot do most of this patching at `patch` phase as the deps
412- # are not available yet. Framework search paths aren't added by bintools
413- # hook. See https://github.com/NixOS/nixpkgs/pull/41914.
414 preBuild = lib.optionalString effectiveStdenv.hostPlatform.isDarwin ''
415- export NIX_LDFLAGS+=" -F${darwin.apple_sdk.frameworks.IOKit}/Library/Frameworks"
416 substituteInPlace ../output/external/rules_cc/cc/private/toolchain/osx_cc_wrapper.sh.tpl \
417 --replace "/usr/bin/install_name_tool" "${cctools}/bin/install_name_tool"
418 substituteInPlace ../output/external/rules_cc/cc/private/toolchain/unix_cc_configure.bzl \
···15 cython,
16 fetchFromGitHub,
17 git,
018 jsoncpp,
19 nsync,
20 openssl,
···408 );
409410 # Note: we cannot do most of this patching at `patch` phase as the deps
411+ # are not available yet.
0412 preBuild = lib.optionalString effectiveStdenv.hostPlatform.isDarwin ''
0413 substituteInPlace ../output/external/rules_cc/cc/private/toolchain/osx_cc_wrapper.sh.tpl \
414 --replace "/usr/bin/install_name_tool" "${cctools}/bin/install_name_tool"
415 substituteInPlace ../output/external/rules_cc/cc/private/toolchain/unix_cc_configure.bzl \