--- gdb/python/python-config.py.orig	2023-02-01 22:45:52.000000000 -0600
+++ gdb/python/python-config.py	2023-04-08 17:07:57.000000000 -0500
@@ -77,6 +77,6 @@
                     libs.insert(0, "-L" + getvar("LIBPL"))
                 elif os.name == "nt":
                     libs.insert(0, "-L" + os.path.normpath(sys.prefix) + "/libs")
-            if getvar("LINKFORSHARED") is not None:
+            if not getvar("PYTHONFRAMEWORK"):
                 libs.extend(getvar("LINKFORSHARED").split())
         print(to_unix_path(" ".join(libs)))
