[PATCH] ASM spec tweak for mips-netbsd

Jason R Thorpe thorpej@wasabisystems.com
Sun Sep 22 16:46:00 GMT 2002


mips-netbsd uses abicalls, and hence pic, by default, and so needs to
pass -KPIC to the assembler.  The ASM spec was only passing -KPIC if
-fPIC or -fpic were specified, however.

...noticed when porting libffi to mips-netbsd (the asm files ended
up non-pic, causing an error at link-time).

Fixed thus, committed to trunk.

        * config/mips/netbsd.h (SUBTARGET_ASM_SPEC): Always pass -KPIC
        unless -fno-pic or -fno-PIC is specified.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: config/mips/netbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/netbsd.h,v
retrieving revision 1.24
diff -c -r1.24 netbsd.h
*** config/mips/netbsd.h	15 Sep 2002 19:15:28 -0000	1.24
--- config/mips/netbsd.h	22 Sep 2002 23:36:16 -0000
***************
*** 158,164 ****
  
  #undef SUBTARGET_ASM_SPEC
  #define SUBTARGET_ASM_SPEC						\
!   "%{fpic:-KPIC} %{fPIC:-KPIC}"
  
  
  /* -G is incompatible with -KPIC which is the default, so only allow objects
--- 158,164 ----
  
  #undef SUBTARGET_ASM_SPEC
  #define SUBTARGET_ASM_SPEC						\
!   "%{!fno-PIC:%{!fno-pic:-KPIC}}"
  
  
  /* -G is incompatible with -KPIC which is the default, so only allow objects


More information about the Gcc-patches mailing list