diff --git a/packages/g/gfortran/xmake.lua b/packages/g/gfortran/xmake.lua
index 23fc0e9cd..eb7ab768e 100644
--- a/packages/g/gfortran/xmake.lua
+++ b/packages/g/gfortran/xmake.lua
@@ -31,6 +31,9 @@ package("gfortran")
                         table.insert(paths, path.join("/usr/lib", target))
                         table.insert(paths, path.join("/usr/lib/gcc", target, vmajor))
                         table.insert(paths, path.join(installdir, "lib", target, vmajor))
+                        if package:is_plat("macosx") then
+                            table.insert(paths, path.join("/opt/homebrew/Cellar/gcc", version, "/lib/gcc", vmajor))
+                        end
                     end
                     local linkinfo = find_library("gfortran", paths)
                     if linkinfo then