generate static linking invokes in the prelude; fixes #1468