A heap of stones; frequently with allusion to the convict's task of breaking stones. Hence (US, slang): a jail or prison; (humorously) any place in which hard work is supposedly performed. Also (rarely): a large or imposing building.
Mid 19th century; earliest use found in Robert Montgomery (1807–1855), poet and Church of England clergyman. From rock + pile.