gcc 4 won't build a non-position-independent executable
(This is the compile-side counterpart to #12427.)
On Haiku, executables are position-independent by default. However asking gcc (4.8.5) to build a non-position-independent executable with (for instance) the
-fno-pie flag fails with an error message like
/boot/system/(...)/bin/ld: /tmp//ccxbCP1i.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/tmp//ccxbCP1i.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
This is because gcc is configured to always pass either the
-shared flag to the linker, and there is no easy way to override this. But not everything is relocatable or a shared object, and if the user specifically requests something different, that request should be honoured.
Consequently apps like GNU Emacs that rely on support for fixed-position executables cannot be built on Haiku right now.