Bug 242143 - math/sleef: fix build on powerpc64 elfv2
Summary: math/sleef: fix build on powerpc64 elfv2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Johannes M Dieterich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-21 15:46 UTC by Piotr Kubaj
Modified: 2019-12-02 18:00 UTC (History)
2 users (show)

See Also:
jmd: maintainer-feedback+


Attachments
patch (299 bytes, patch)
2019-11-21 15:46 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (jmd)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2019-11-21 15:46:59 UTC
Created attachment 209321 [details]
patch

This port doesn't build on powerpc64 elfv2, because clang doesn't find vec_nand:
In file included from /wrkdirs/usr/ports/math/sleef/work/sleef-3.4.0/src/libm/sleefsimdsp.c:145:
/wrkdirs/usr/ports/math/sleef/work/sleef-3.4.0/src/arch/helperpower_128.h:266:54: warning: implicit declaration of function 'vec_nand' is invalid in C99 [-Wimplicit-function-declaration]
static INLINE vopmask vnot_vo_vo(vopmask o) { return vec_nand(o, o); }
                                                     ^
/wrkdirs/usr/ports/math/sleef/work/sleef-3.4.0/src/arch/helperpower_128.h:266:54: error: returning 'int' from a function with incompatible result type 'vopmask' (vector of 4 'unsigned int' values)
static INLINE vopmask vnot_vo_vo(vopmask o) { return vec_nand(o, o); }
                                                     ^~~~~~~~~~~~~~

-mpower8-vector is needed because vec_nand is behind #ifdef __POWER8_VECTOR__ in clang's altivec.h.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2019-11-27 08:40:15 UTC
Approved as mentor pending maintainer review.
Comment 2 commit-hook freebsd_committer 2019-12-02 18:00:20 UTC
A commit references this bug:

Author: pkubaj
Date: Mon Dec  2 18:00:07 UTC 2019
New revision: 518859
URL: https://svnweb.freebsd.org/changeset/ports/518859

Log:
  math/sleef: fix build on powerpc64 elfv2

  clang doesn't find vec_nand:
  In file included from /wrkdirs/usr/ports/math/sleef/work/sleef-3.4.0/src/libm/sleefsimdsp.c:145:
  /wrkdirs/usr/ports/math/sleef/work/sleef-3.4.0/src/arch/helperpower_128.h:266:54: warning: implicit declaration of function 'vec_nand' is invalid in C99 [-Wimplicit-function-declaration]
  static INLINE vopmask vnot_vo_vo(vopmask o) { return vec_nand(o, o); }
                                                       ^
  /wrkdirs/usr/ports/math/sleef/work/sleef-3.4.0/src/arch/helperpower_128.h:266:54: error: returning 'int' from a function with incompatible result type 'vopmask' (vector of 4 'unsigned int' values)
  static INLINE vopmask vnot_vo_vo(vopmask o) { return vec_nand(o, o); }
                                                       ^~~~~~~~~~~~~~

  -mpower8-vector is needed because vec_nand is behind #ifdef __POWER8_VECTOR__ in clang's altivec.h.

  PR:		242143
  Approved by:	linimon (mentor), jmd (maintainer)

Changes:
  head/math/sleef/Makefile