The building material comes from minerals dissolved in the ocean, mainly $\mathrm{Ca}^{2+}$, $\mathrm{Mg}^{2+}$, and $\mathrm{HCO}_3^{–}$, but of course there are all sorts of biochemical details. Most limestone originated as the skeletons of micro- and macro-organisms, such as plankton and coral.
The minerals come in turn from the erosion of older rocks (among other places). For example, here are the famous white cliffs near Dover, UK, where massive amounts of calcium carbonate, mostly stable since the Cretaceous, are falling into the sea, where it will be re-used:

This attrition is part of the rock cycle and a very slow-moving part of the carbon cycle. These are well-studied and reasonably well-understood.
You seem to suggest there is a paradox, that there's just constant deposition and no erosion or dissolution. But there is no paradox. The earth is not becoming thicker and thicker, material is not coming from space (not in substantial quantities anyway), and there's no need to invoke any processes we don't understand sufficiently to explain our large-scale observations. We know this because those processes would have a measurable effect on all sorts of things: the earth's orbit, climate, plate tectonics, and so on. There would be, I suggest, a strong low-frequency trend in all sorts of signals (stable isotopes, organism growth rates, sedimentation rates, volcanism rates, and so on).
The image is by Flickr/Harvey Barrison, CC-BY-SA.