Bug 199422 - fmodl not fully defined on architectures where LDBL_PREC == 53 (arm, mips, powerpc)
Summary: fmodl not fully defined on architectures where LDBL_PREC == 53 (arm, mips, po...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Enji Cooper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-13 17:00 UTC by Enji Cooper
Modified: 2019-01-21 18:29 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2015-04-13 17:00:08 UTC
I testing out a change to build lib/msun/tests on all architectures, and I lib/msun/tests/fmod_test failed to compile on MACHINE == {arm,mips,powerpc} with the following error:

t_fmod.o: In function `atfu_fmod_body':
t_fmod.c:(.text+0x200): undefined reference to `fmodl'
t_fmod.c:(.text+0x204): undefined reference to `fmodl'
t_fmod.c:(.text+0x2f0): undefined reference to `fmodl'
t_fmod.c:(.text+0x2f4): undefined reference to `fmodl'
t_fmod.c:(.text+0x434): undefined reference to `fmodl'
t_fmod.o:t_fmod.c:(.text+0x438): more undefined references to `fmodl' follow
--- fmod_test ---
*** [fmod_test] Error code 1

make[8]: stopped in /home/ngie/head/lib/msun/tests

Are these functions supposed to be fully defined?
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2015-04-13 17:08:39 UTC
lib/msun/Makefile only defines fmodl on select architectures:

 97 .if ${LDBL_PREC} != 53
 98 # If long double != double use these; otherwise, we alias the double versions.
 99 COMMON_SRCS+=   e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \
100         e_coshl.c e_fmodl.c e_hypotl.c \

This seems to support what I've seen.

Is there a list of functions that are only partially implemented on some architectures, so I can modify the testcases accordingly to skip them?
Comment 2 Ed Maste freebsd_committer freebsd_triage 2015-04-13 17:31:43 UTC
I'm not aware of any overall list, you'll have to handle it on a case by case basis.

That said, I think there's an actual error here -- fmodl should be an alias for fmod when long double == double.
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2015-04-13 17:41:57 UTC
(In reply to Ed Maste from comment #2)

The NetBSD testcases poke directly at fmodl and friends in t_fmod.c, so it's a problem with the testcases.

Thanks for the clarification :).
Comment 4 Ed Maste freebsd_committer freebsd_triage 2015-04-13 17:45:02 UTC
(In reply to Garrett Cooper,425-314-3911 from comment #3)

> so it's a problem with the testcases

I don't follow; the tests in t_fmod.c should build and pass on all architectures.
> ATF_CHECK(fmodl(2.0, 1.0) == 0);
Comment 5 Enji Cooper freebsd_committer freebsd_triage 2015-04-13 17:45:56 UTC
Nevermind. I just reread that. You're right -- it's an issue with libc.
Comment 6 Enji Cooper freebsd_committer freebsd_triage 2015-04-13 17:46:19 UTC
(In reply to Garrett Cooper,425-314-3911 from comment #5)

msun, not libc.
Comment 7 Ed Maste freebsd_committer freebsd_triage 2015-04-13 18:12:54 UTC
As an aside, by the same logic it looks like r274601 should be reverted
Comment 8 Enji Cooper freebsd_committer freebsd_triage 2015-04-14 09:40:43 UTC
Yes. Part or all of the logic I committed in that revision should be committed depending on the outcome...
Comment 9 commit-hook freebsd_committer freebsd_triage 2015-04-16 08:51:19 UTC
A commit references this bug:

Author: ngie
Date: Thu Apr 16 08:50:42 UTC 2015
New revision: 281597
URL: https://svnweb.freebsd.org/changeset/base/281597

Log:
  the fmodl compat shims on arm/mips/powerpc don't seem to be all there
  #if 0 the code for now

  PR: 199422

Changes:
  user/ngie/more-tests/contrib/netbsd-tests/lib/libm/t_fmod.c
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-04-27 06:47:32 UTC
A commit references this bug:

Author: ngie
Date: Mon Apr 27 06:46:34 UTC 2015
New revision: 282056
URL: https://svnweb.freebsd.org/changeset/base/282056

Log:
  The fmodl compat shims on arm/mips/powerpc aren't complete

  Disable the test code for now on those architectures

  MFC after: 1 week
  PR: 199422

Changes:
_U  head/
  head/contrib/netbsd-tests/lib/libm/t_fmod.c
Comment 11 commit-hook freebsd_committer freebsd_triage 2015-05-13 10:13:19 UTC
A commit references this bug:

Author: ngie
Date: Wed May 13 10:12:17 UTC 2015
New revision: 282836
URL: https://svnweb.freebsd.org/changeset/base/282836

Log:
  MFC r282056:

  The fmodl compat shims on arm/mips/powerpc aren't complete

  Disable the test code for now on those architectures

  PR: 199422

Changes:
_U  stable/10/
  stable/10/contrib/netbsd-tests/lib/libm/t_fmod.c
Comment 12 commit-hook freebsd_committer freebsd_triage 2016-09-04 12:02:07 UTC
A commit references this bug:

Author: bde
Date: Sun Sep  4 12:01:32 UTC 2016
New revision: 305380
URL: https://svnweb.freebsd.org/changeset/base/305380

Log:
  Fix missing fmodl() on arches with 53-bit long doubles.

  PR:		199422, 211965
  MFC after:	1 week

Changes:
  head/lib/msun/src/e_fmod.c
Comment 13 commit-hook freebsd_committer freebsd_triage 2016-09-19 12:35:10 UTC
A commit references this bug:

Author: bde
Date: Mon Sep 19 12:34:29 UTC 2016
New revision: 305971
URL: https://svnweb.freebsd.org/changeset/base/305971

Log:
  MFC r305380:

  Fix missing fmodl() on arches with 53-bit long doubles.

  PR:		199422, 211965

Changes:
  stable/11/lib/msun/src/e_fmod.c
Comment 14 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 10:09:30 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks
Comment 15 Enji Cooper freebsd_committer freebsd_triage 2019-01-21 18:29:01 UTC
Test hasn't been fixed. Reopening.