almost all of the usual senses seem to stem from the name of the fowl, dating way back to the late 9th century. cock-up (also given as cockup) itself, as a noun, goes like this:

1. A distinct turn up at the end or tip.
1826 Miss Mitford Village Ser. ii. (1863) 429 The cock-up of the nose, which seems+to be snuffing up intelligence.

2. A hat or cap cocked or turned up in front.
a1693 in Sc. Presbyt. Eloquence (1738) 129, I have been this Year of God preaching against the Vanity of Women, yet I see my own Daughter in the Kirk Even now have as high a Cockup as any of you all. 1818 Scott Hrt. Midl. xxv, Your cockups and your fallal duds—see what they a' come to.

3. A fresh-water and estuarian fish of India (Lates calcarifer). [Origin of name uncertain: see Yule.]
1845 Stocqueler Handbk. Brit. India (1854) 283 Cockup, crabs, lobsters, shrimps. 1854 Badham Halieut. 114 The Lates Nobilis of the erudite, somewhat freely rendered ‘cock-up-fish’ by the Bengalese.

4. A blunder, a mistake, a confused situation. slang.
1948 Partridge Dict. Forces' Slang 44 He made a complete cock-up of his orders. 1959 I. Jefferies 13 Days xiii. 206 ‘I was thinking of going out to Tikvah today, sir,’ I said, and did I make a cock-up of that job. 1964 J. Porter Dover One i. 11 George turned the local boys on it and you've never seen such a cock-up in your life!