title: Building a small Go program for MIPS with no hardware floating point (softfloat required)
body: <p>I have small program written in go that I'm trying to cross compile to get working on a MIPS architecture machine. I've been trying to cross compile using the XGO cross compilation library but have had limited success getting my program to run (<a href="https://github.com/karalabe/xgo" rel="nofollow noreferrer">https://github.com/karalabe/xgo</a>).</p>
  
  <p>Here is the cpuinfo of the device, which is currently running a version of openwrt.</p>
  
  <pre><code>system type     : Qualcomm Atheros QCA9533 ver 2 rev 0
  machine         : GL.iNet GL-AR750
  processor       : 0
  cpu model       : MIPS 24Kc V7.4
  BogoMIPS        : 432.53
  wait instruction    : yes
  microsecond timers  : yes
  tlb_entries     : 16
  extra interrupt vector  : yes
  hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
  isa         : mips1 mips2 mips32r1 mips32r2
  ASEs implemented    : mips16
  shadow register sets    : 1
  kscratch registers  : 0
  package         : 0
  core            : 0
  VCED exceptions     : not available
  VCEI exceptions     : not available
  </code></pre>
  
  <p>Running the program I get a SIGILL Illegal instruction from the following:</p>
  
  <pre><code>Program terminated with signal SIGILL, Illegal instruction.
  #0  0x008274a8 in __sigsetjmp_aux () 
  </code></pre>
  
  <p>I can see that __sigsetjmp_aux() is defined here</p>
  
  <pre><code>/usr/lib/gcc-cross/mips-linux-gnu/5/../../../../mips-linux-gnu/lib/../lib/libc.a(setjmp_aux.o): definition of __sigsetjmp_aux 
  </code></pre>
  
  <p>How can I ensure all my dependencies are compiled using SOFTFLOAT ?</p>
  
  <p>I've been passing xgo the following environment variables but it seems GLIBC is not being compiled as soft-float </p>
  
  <pre><code>CC=mips-linux-gnu-gcc-5 CXX=mips-linux-gnu-g++-5 GOOS=linux GOARCH=mips GOMIPS=softfloat CGO_ENABLED=1 CFLAGS=msoft-float
  </code></pre>
  
  <p>Any help would be appreciated thanks!</p>
  
  <p><strong>EDIT</strong>
  Here is the asm layout</p>
  
  <pre><code>    0x8274a4 &lt;__sigsetjmp_aux+4&gt;    addiu  gp,gp,-19312                                                                                                                          │
    &gt;│0x8274a8 &lt;__sigsetjmp_aux+8&gt;    sdc1   $f20,56(a0)                                                                                                                           │
     │0x8274ac &lt;__sigsetjmp_aux+12&gt;   sdc1   $f22,64(a0) 
  </code></pre>