[PATCH] For FreeBSD on mips, pass -G options to the linker

Dimitry Andric dimitry at andric.com
Fri May 29 11:30:24 PDT 2015


In http://reviews.llvm.org/D9114#176912, @atanasyan wrote:

> Is it necessary on FreeBSD to pass the `-G` option to the assembler as well as to the linker?


Hm, yes, you are right about that.  With our copy of gcc for mips, I see that it passes that flag:

  /usr/obj/mips.mips/usr/src/tmp/usr/bin/as -G0 -EB -no-mdebug -mabi=32 -march=mips3 -v -KPIC -o foo.o foo.s

in addition to passing it to the linker:

  /usr/obj/mips.mips/usr/src/tmp/usr/bin/ld --eh-frame-hdr -EB -EB -G0 -melf32btsmip_fbsd -V --enable-new-dtags -dynamic-linker /libexec/ld-elf.so.1 -o foo crt1.o crti.o crtbegin.o -L/usr/obj/mips.mips/usr/src/tmp/usr/lib -L/usr/obj/mips.mips/usr/src/tmp/usr/lib foo.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o crtn.o

@seanbruno, @emaste, any idea about this?  I think the patch as-is now incomplete, as we must also make sure any -G flag is passed to the assembler too, or is applied to the integrated assembler, though I have no clue how to do that. :-)  And of course we should extend the test cases for it.


http://reviews.llvm.org/D9114

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list