Bug 259922 - math/sleef: fix build on armv7
Summary: math/sleef: fix build on armv7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: Johannes M Dieterich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-18 18:12 UTC by Robert Clausecker
Modified: 2022-01-01 22:12 UTC (History)
1 user (show)

See Also:
jmd: maintainer-feedback-
jmd: merge-quarterly-


Attachments
math/sleef: fix build on armv7 (4.92 KB, patch)
2021-11-18 18:12 UTC, Robert Clausecker
no flags Details | Diff
math/sleef: fix build on armv7 (4.92 KB, patch)
2021-11-18 19:23 UTC, Robert Clausecker
fuz: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker freebsd_committer freebsd_triage 2021-11-18 18:12:27 UTC
Created attachment 229581 [details]
math/sleef: fix build on armv7

- patch uses of non standard function isinff
 - patch a use of jmpbuf where sigjmpbuf is needed
 - apply ppc64 workaround to armv6/armv7
 - fix wrong WWW (see bug #254839)

Tested with Poudriere on armv7 arm64 i386 amd64 FreeBSD 13.
Tested with Poudriere on i386 amd64 FreeBSD 12.
Tested without Poudriere on armv6 FreeBSD 13.

Please MFH if possible.

Please also consider updating the port to the newest upstream version.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2021-11-18 19:23:40 UTC
Created attachment 229583 [details]
math/sleef: fix build on armv7

Fixed wrong WWW.  I had typed in the right WWW, but forgotten to git-add the file before committing.
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2021-12-02 10:06:11 UTC
Comment on attachment 229583 [details]
math/sleef: fix build on armv7

maintainer timeout
Comment 3 Johannes M Dieterich freebsd_committer freebsd_triage 2021-12-02 13:09:06 UTC
I do NOT approve the patch in its current form. Why is isinff(float) -> isinf(double) required?https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259922#
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2021-12-02 13:33:20 UTC
(In reply to Johannes M Dieterich from comment #3)

Hello Johannes,

The macro `isinf` is type generic.  It automatically selects the correct function for the operand type, so the float variant of the function is taken here.  See ISO/IEC 9899:1999 or IEEE 1003.1 2001.  A function or macro isinff does not exist on FreeBSD.
Comment 5 Robert Clausecker freebsd_committer freebsd_triage 2021-12-30 15:26:47 UTC
Any progress on this one?  It would be great to have this committed before 2022Q1 is branched off.
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-12-31 17:34:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c2a7241a3b4715b3ee6f8d53ea0f2a7569aa034f

commit c2a7241a3b4715b3ee6f8d53ea0f2a7569aa034f
Author:     Johannes M Dieterich <jmd@FreeBSD.org>
AuthorDate: 2021-12-31 17:30:36 +0000
Commit:     Johannes M Dieterich <jmd@FreeBSD.org>
CommitDate: 2021-12-31 17:33:45 +0000

    math/sleef: enable ARMv7

    PR:             259922
    Reported by:    Robert Clausecker

 math/sleef/Makefile  | 8 ++++----
 math/sleef/pkg-descr | 2 +-
 math/sleef/pkg-plist | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2022-01-01 12:48:04 UTC
Hi jmd,

Thank you for enabling the armv7 build.

Unfortunately, the port does not build because you forgot to also commit the patches I sent.  So build fails as expected:

: && /usr/bin/cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-unused -Wno-attributes -Wno-unused-result -ffp-contract=off -fno-math-errno -fno-trapping-math -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong src/libm-tester/CMakeFiles/iutneon32.dir/iutsimd.c.o src/libm-tester/CMakeFiles/iutneon32.dir/iutsimdmain.c.o src/libm-tester/CMakeFiles/iutneon32.dir/testerutil.c.o -o bin/iutneon32 -L/wrkdirs/usr/ports/math/sleef/work/.build/lib   -L/wrkdirs/usr/ports/math/sleef/work/.build/src/common -Wl,-rpath,/wrkdirs/usr/ports/math/sleef/work/.build/lib:/wrkdirs/usr/ports/math/sleef/work/.build/src/common  lib/libsleef.so.3.5.0  /usr/lib/libm.so  /usr/lib/librt.so && :
ld: error: undefined symbol: isinff
>>> referenced by testerutil.c
>>>               src/libm-tester/CMakeFiles/iutneon32.dir/testerutil.c.o:(isnumberf)
>>> did you mean: isinf
>>> defined in: /lib/libc.so.7
cc: error: linker command failed with exit code 1 (use -v to see invocation)

There are also a lot of warnings of this type, addressed by the other patch:

[ 61% 71/111] /usr/bin/cc -DDETERMINISTIC=1 -DENABLE_ALIAS=1 -DENABLE_NEON32=1 -I/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.0/src/common -I/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.0/src/arch -I/wrkdirs/usr/ports/math/sleef/work/.build/include -I/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.0/src/libm -I/wrkdirs/usr/ports/math/sleef/work/.build/src/libm/include -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -Wall -Wno-unused -Wno-attributes -Wno-unused-result -ffp-contract=off -fno-math-errno -fno-trapping-math -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing --target=arm-linux-gnueabihf -mcpu=cortex-a8 -std=gnu99 -MD -MT src/libm-tester/CMakeFiles/iutyneon32.dir/iutsimdmain.c.o -MF src/libm-tester/CMakeFiles/iutyneon32.dir/iutsimdmain.c.o.d -o src/libm-tester/CMakeFiles/iutyneon32.dir/iutsimdmain.c.o -c /wrkdirs/usr/ports/math/sleef/work/sleef-3.5.0/src/libm-tester/iutsimdmain.c
/wrkdirs/usr/ports/math/sleef/work/sleef-3.5.0/src/libm-tester/iutsimdmain.c:27:11: warning: incompatible pointer types passing 'jmp_buf' (aka 'struct _jmp_buf [1]') to parameter of type 'struct _sigjmp_buf *' [-Wincompatible-pointer-types]
  LONGJMP(sigjmp, 1);
          ^~~~~~
/usr/include/setjmp.h:59:27: note: passing argument to parameter here
void    siglongjmp(sigjmp_buf, int) __dead2;
                             ^

Please make sure to commit the full patch I sent, not just the changes to Makefile, pkg-descr, and pkg-plist.
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-01-01 17:25:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5babb3b84b9d787f2549a4da906fa30f25037a4

commit d5babb3b84b9d787f2549a4da906fa30f25037a4
Author:     Johannes M Dieterich <jmd@FreeBSD.org>
AuthorDate: 2022-01-01 17:23:09 +0000
Commit:     Johannes M Dieterich <jmd@FreeBSD.org>
CommitDate: 2022-01-01 17:24:31 +0000

    math/sleef: add ARMv7 patch files

    PR:             259922

 math/sleef/Makefile                                 |  2 +-
 .../files/patch-src_libm-tester_iutsimdmain.c (new) | 21 +++++++++++++++++++++
 .../patch-src_libm-tester_tester2simdsp.c (new)     | 11 +++++++++++
 .../files/patch-src_libm-tester_testerutil.c (new)  | 11 +++++++++++
 4 files changed, 44 insertions(+), 1 deletion(-)
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2022-01-01 18:13:35 UTC
Thank you.

I can confirm that the ports builds fine now.

Thanks a lot for the help.
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2022-01-01 18:22:29 UTC
Please don't forget to MFH to the newly created 2022Q1 branch whose branching your second commit narrowly missed.
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2022-01-01 22:12:52 UTC
Guess the port will remain broken on ARM for another quarter then :-(