Bug 217845 - Replace SOFTFLOAT tests with __mips_soft_float, which gcc/clang define for us.
Summary: Replace SOFTFLOAT tests with __mips_soft_float, which gcc/clang define for us.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: mips Any
: --- Affects Some People
Assignee: Brooks Davis
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-03-16 15:08 UTC by Dan Nelson
Modified: 2017-03-27 22:37 UTC (History)
0 users

See Also:


Attachments
Replace SOFTFLOAT tests with __mips_soft_float, which gcc/clang define for us. (6.26 KB, patch)
2017-03-16 15:08 UTC, Dan Nelson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Nelson 2017-03-16 15:08:06 UTC
Created attachment 180878 [details]
Replace SOFTFLOAT tests with __mips_soft_float, which gcc/clang define for us.

Replace SOFTFLOAT tests with __mips_soft_float, which gcc/clang define for us.

base r308130 (review D8376) extended softfloat/hardfloat support, but used a macro that never actually gets set except in libc and msun's Makefile.inc.  So libc and libm got built correctly, but any program including fenv.h itself assumed it was on a hardfloat systen and emitted inline fpu instructions for fedisableexcept() and friends.

Using __mips_soft_float is better, since it's a compiler-internal macro that is always set correctly for the target.
Comment 1 Brooks Davis freebsd_committer freebsd_triage 2017-03-16 17:03:06 UTC
I'll take this.  We need it in our CheriBSD tree as well.
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-03-16 21:06:27 UTC
A commit references this bug:

Author: brooks
Date: Thu Mar 16 21:05:22 UTC 2017
New revision: 315424
URL: https://svnweb.freebsd.org/changeset/base/315424

Log:
  Replace SOFTFLOAT with __mips_soft_float, which gcc/clang define for us.

  D8376 extended softfloat/hardfloat support, but used a macro that never
  actually gets set except in libc and msun's Makefile.inc.  So libc and libm
  got built correctly, but any program including fenv.h itself assumed it was
  on a hardfloat systen and emitted inline fpu instructions for
  fedisableexcept() and friends.

  Using __mips_soft_float makes everything work in all cases, since it's a
  compiler-internal macro that is always set correctly for the target

  PR:		217845
  Submitted by:	Dan Nelson <dnelson_1901@yahoo.com>
  MFC after:	1 week

Changes:
  head/lib/libc/mips/Makefile.inc
  head/lib/libc/mips/gen/_setjmp.S
  head/lib/libc/mips/gen/flt_rounds.c
  head/lib/libc/mips/gen/setjmp.S
  head/lib/msun/mips/Makefile.inc
  head/lib/msun/mips/fenv.c
  head/lib/msun/mips/fenv.h
Comment 3 Brooks Davis freebsd_committer freebsd_triage 2017-03-27 22:37:57 UTC
I'd left this open to MFC, but the other hard-float changes haven't been merged to 11 so there's nothing useful to merge at this time.