[LLVMdev] MIPS n64 ABI and non-PIC

Richard Sandiford rsandifo at linux.vnet.ibm.com
Tue May 6 06:04:13 PDT 2014


Daniel Sanders <Daniel.Sanders at imgtec.com> writes:
> Ok, I didn't know that. It looks like gcc's behaviour is
> triple-dependent. My mips-mti-linux-gnu-gcc toolchain (last updated in
> January) always generates PIC code for –fPIC, -fno-PIC, and neither
> option. I've just tried the latest mips-sde-elf-gcc toolchain and found
> it emits non-PIC code for –fno-PIC and neither option, and errors out
> with –fPIC (without additional options).

It's really -mabicalls-dependent, with the default -mabicalls depending
on triple like you say.  -fPIC -mno-abicalls isn't supported.

Note that even -mabicalls code will use non-PIC code with -msym32.
(The PLT/copy-reloc model requires 32-bit symbols.)

Thanks,
Richard





More information about the llvm-dev mailing list