7173 sparc: __floatundidf undefined for sparcv9

Review Request #1387 — Created Jan. 24, 2019 and submitted

ptribble
illumos-gate
7173
general
The sun4u Makefile (but not the sparc or intel Makefiles) for the bignum kernel module has

-DUSE_FLOATING_POINT

which is causing the issue.

(As far as I can tell, emlxs is the only consumer.)
I have built the module with this fix and verified that __floatundidf is no longer present.

Gabriele Bulfon has built XStreamOS with this fix and verified that it boots, and does so without the reported error.
citrus
  1. Ship It!
  2. 
      
andy_js
  1. Ship It!
  2. 
      
igork
  1. Ship It!
  2. 
      
domag02
  1. Actually, floating-point isn't invalid in kernel, it just disabled in the case when GCC used as a compiler.
    cw translates Studio "-xregs=no%float" to GCC "-mno-fpu", but the meanings are completely different:

    • Studio "-xregs=no%float" means: do not to use floating point registers (on SPARC) as scratch registers for non-floating point operations.
      (if the programmer uses floating-point types explicitely, then Studio always emits code that uses hardware floating point)
    • GCC "-mno-fpu" means: using of hardware floating point isn't permitted.

    Can somebody (with SPARC hardware) test it what happens when hardware floating-point usage is enabled with GCC?

    Diff:
    /usr/src/tools/cw/cw.c:

     405  405  static const char *xregs_tbl[] = {
     406  406  #if defined(__sparc)
     407  407   "appl",     "-mapp-regs", NULL,
     408  408   "no%appl",  "-mno-app-regs", NULL,
     409  409   "float",    "-mfpu", NULL,
     410      - "no%float", "-mno-fpu", NULL,
          410 + "no%float", "-mfpu", NULL,  /* force to use fpu with GCC */
     411  411  #endif   /* __sparc */
     412  412   NULL,       NULL
     413  413  };
    
    1. That's not the problem. The problem is that the kernel lacks bits of gcc floating point support. Rather than hack all that into the kernel, it's far easier to make sure we don't need it, especially as the scope here is tiny.

  2. 
      
ptribble
Review request changed

Status: Closed (submitted)

Loading...