diff --git a/Makefile.def b/Makefile.def
index de3e0052106ad22dd98d7648161962b63c73d7d3..90316364d01121fcda545a327985ac79020c7de7 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -592,6 +592,7 @@ dependencies = { module=configure-target-fastjar; on=configure-target-zlib; };
 dependencies = { module=all-target-fastjar; on=all-target-zlib; };
 dependencies = { module=configure-target-libgo; on=configure-target-libffi; };
 dependencies = { module=configure-target-libgo; on=all-target-libstdc++-v3; };
+dependencies = { module=configure-target-libffi; on=all-target-libstdc++-v3; };
 dependencies = { module=all-target-libgo; on=all-target-libbacktrace; };
 dependencies = { module=all-target-libgo; on=all-target-libffi; };
 dependencies = { module=all-target-libgo; on=all-target-libatomic; };
diff --git a/Makefile.in b/Makefile.in
index 61af99dc75a1f97841b2ceb13d55e876c7019d05..81b26c7177eed013aceb7f7eed0d96515bc21cb1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -61261,6 +61261,7 @@ all-bison: maybe-all-intl
 all-flex: maybe-all-intl
 all-m4: maybe-all-intl
 configure-target-libgo: maybe-all-target-libstdc++-v3
+configure-target-libffi: maybe-all-target-libstdc++-v3
 configure-target-liboffloadmic: maybe-configure-target-libgomp
 all-target-liboffloadmic: maybe-all-target-libgomp
 configure-target-newlib: maybe-all-binutils