You could download and run gcc and any app on iphone for 15 years now, implying it is the same iphone from 2008. Just jailbreak it. Online.
Only iphones you can’t just download and run gcc are from 2018 onwards. These make you need some other device to upload gcc signed (by you) that can compile and execute code in the sandbox of own process. And, you can get windows or linux emulator (in fact, for ANY popular architecture) and run anything you want. Can your ancient device do it? Can it do anything useful? Because recompiling old trash over and over for amusement soon be banned in EU as part of global warming effort (along with eating bugs).