  M-theory on compact eight-manifolds with $\mathrm{Spin}(7)$-holonomy is a
framework for geometric engineering of 3d $\mathcal{N}=1$ gauge theories
coupled to gravity. We propose a new construction of such
$\mathrm{Spin}(7)$-manifolds, based on a generalized connected sum, where the
building blocks are a Calabi-Yau four-fold and a $G_2$-holonomy manifold times
a circle, respectively, which both asymptote to a Calabi-Yau three-fold times a
cylinder. The generalized connected sum construction is first exemplified for
Joyce orbifolds, and is then used to construct examples of new compact
manifolds with $\mathrm{Spin}(7)$-holonomy. In instances when there is a
K3-fibration of the $\mathrm{Spin}(7)$-manifold, we test the spectra using
duality to heterotic on a $T^3$-fibered $G_2$-holonomy manifold, which are
shown to be precisely the recently discovered twisted-connected sum
constructions.
