MorphOS Developer
Posts: 155 from 2003/3/17
Quote:Quote:
Piru wrote:
MorphOS binaries are always position independent anyway, so there is no need for it.
Okay, but is then throwing an error a good solution? Wouldn't it be better to simply accept -pie?
Piru simplified things a bit in his answer. -fPIC and -fPIE generate assembly code which is position independent in the sense that all pointers, jumps to address and so on are expressed in relative terms. In theory this could lead to some speed penalty (although I don't think it would be big on PPC). Anyhow, this type of position independent code is typically needed on *nix for e.g. shared libraries and for executables on embedded platforms. There is some problem in our linker related to GOT tables that currently prevents this from working properly at the moment. For the time being our GCC therefore issues a warning when trying to use these options.
It is on my todo list to fix this, but with low priority because as Piru mentioned, MorphOS executables are already position independent. Using a different method, they are relocated to another base than 0 at load time. To sum up, -fPIC and -fPIE do not make much sense on MorphOS.
Hope this clarifies.