We give a new proof and an extension of the celebrated theorem of Hirzebruch and Zagier  that the generating function for the intersection numbers of the Hirzebruch-Zagier cycles in (certain) Hilbert modular surfaces is a classical modular form of weight 2. In our approach we replace Hirzebuch’s smooth complex analytic compactification of the Hilbert modular surface with the (real) Borel-Serre compactification. The various algebro-geometric quantities that occur in  are replaced by topological quantities associated to 4-manifolds with boundary. In particular, the “boundary contribution” in  is replaced by sums of linking numbers of circles (the boundaries of the cycles) in 3-manifolds of type Sol (torus bundle over a circle) which comprise the Borel-Serre boundary.
Funke, J., & Millson, J. (2014). The geometric theta correspondence for Hilbert modular surfaces. Duke Mathematical Journal, 163(1), 65-116. https://doi.org/10.1215/00127094-2405279