Bug 240531 - multimedia/kvazaar: fix build on powerpc64 elfv2
Summary: multimedia/kvazaar: 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: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-12 11:03 UTC by Piotr Kubaj
Modified: 2019-09-14 01:05 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (jbeich)


Attachments
patch (1.09 KB, patch)
2019-09-12 11:03 UTC, Piotr Kubaj
no flags Details | Diff
v2 (988 bytes, patch)
2019-09-12 13:07 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (jbeich)
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-09-12 11:03:05 UTC
Created attachment 207417 [details]
patch

Reported at:
https://github.com/ultravideo/kvazaar/issues/245

I use LLVM 8.0.1 on FreeBSD/powerpc64.

Currently build fails with:

libtool: compile:  cc -DHAVE_CONFIG_H -I. -I.. -DKVZ_DLL_EXPORTS -maltivec -pthread -Wall -Wextra -Wvla -Wno-sign-compare -Wno-unused-parameter -I./src -I./src/extras -ftree-vectorize -fvisibility=hidden -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MT strategies/altivec/libaltivec_la-picture-altivec.lo -MD -MP -MF strategies/altivec/.deps/libaltivec_la-picture-altivec.Tpo -c strategies/altivec/picture-altivec.c  -fPIC -DPIC -o strategies/altivec/.libs/libaltivec_la-picture-altivec.o
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:69:19: error: unknown type name 'vector'
static __inline__ vector bool char __ATTRS_o_ai
                  ^
/usr/lib/clang/8.0.1/include/altivec.h:69:26: error: expected identifier or '('
static __inline__ vector bool char __ATTRS_o_ai
                         ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:80:19: error: unknown type name 'vector'
static __inline__ vector bool short __ATTRS_o_ai vec_perm(
                  ^
/usr/lib/clang/8.0.1/include/altivec.h:80:26: error: expected identifier or '('
static __inline__ vector bool short __ATTRS_o_ai vec_perm(
                         ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:94:19: error: unknown type name 'vector'
static __inline__ vector bool int __ATTRS_o_ai
                  ^
/usr/lib/clang/8.0.1/include/altivec.h:94:26: error: expected identifier or '('
static __inline__ vector bool int __ATTRS_o_ai
                         ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:217:9: error: unknown type name 'vector'
vec_add(vector bool char __a, vector signed char __b) {
        ^
/usr/lib/clang/8.0.1/include/altivec.h:217:16: error: expected ')'
vec_add(vector bool char __a, vector signed char __b) {
               ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
/usr/lib/clang/8.0.1/include/altivec.h:217:8: note: to match this '('
vec_add(vector bool char __a, vector signed char __b) {
       ^
/usr/lib/clang/8.0.1/include/altivec.h:217:16: error: parameter name omitted
vec_add(vector bool char __a, vector signed char __b) {
               ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:218:30: error: use of undeclared identifier '__a'
  return (vector signed char)__a + __b;
                             ^
/usr/lib/clang/8.0.1/include/altivec.h:218:36: error: use of undeclared identifier '__b'
  return (vector signed char)__a + __b;
                                   ^
/usr/lib/clang/8.0.1/include/altivec.h:222:33: error: unknown type name 'vector'
vec_add(vector signed char __a, vector bool char __b) {
                                ^
/usr/lib/clang/8.0.1/include/altivec.h:222:40: error: expected ')'
vec_add(vector signed char __a, vector bool char __b) {
                                       ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
/usr/lib/clang/8.0.1/include/altivec.h:222:8: note: to match this '('
vec_add(vector signed char __a, vector bool char __b) {
       ^
/usr/lib/clang/8.0.1/include/altivec.h:222:40: error: parameter name omitted
vec_add(vector signed char __a, vector bool char __b) {
                                       ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:223:36: error: use of undeclared identifier '__b'
  return __a + (vector signed char)__b;
                                   ^
/usr/lib/clang/8.0.1/include/altivec.h:232:9: error: unknown type name 'vector'
vec_add(vector bool char __a, vector unsigned char __b) {
        ^
/usr/lib/clang/8.0.1/include/altivec.h:232:16: error: expected ')'
vec_add(vector bool char __a, vector unsigned char __b) {
               ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
/usr/lib/clang/8.0.1/include/altivec.h:232:8: note: to match this '('
vec_add(vector bool char __a, vector unsigned char __b) {
       ^
/usr/lib/clang/8.0.1/include/altivec.h:232:16: error: parameter name omitted
vec_add(vector bool char __a, vector unsigned char __b) {
               ^
/usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
#define bool    _Bool
                ^
In file included from strategies/altivec/picture-altivec.c:24:
/usr/lib/clang/8.0.1/include/altivec.h:233:32: error: use of undeclared identifier '__a'
  return (vector unsigned char)__a + __b;
                               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

If I remove include <altivec.h> from strategies/altivec/picture-altivec.c and put it above global.h in strategies/altivec/picture-altivec.h or above stdbool.h in global.h, build works.

Would it be possible replace including <stdbool.h> with:
typedef enum { false, true } bool;?

I can confirm that it works.
Comment 1 Piotr Kubaj freebsd_committer 2019-09-12 13:07:14 UTC
Created attachment 207420 [details]
v2

Change to a different fix proposed by upstream.
Comment 2 commit-hook freebsd_committer 2019-09-14 01:04:56 UTC
A commit references this bug:

Author: jbeich
Date: Sat Sep 14 01:04:17 UTC 2019
New revision: 511996
URL: https://svnweb.freebsd.org/changeset/ports/511996

Log:
  multimedia/kvazaar: unbreak with clang on powerpc64

  In file included from strategies/altivec/picture-altivec.c:24:
  /usr/lib/clang/8.0.1/include/altivec.h:69:19: error: unknown type name 'vector'
  static __inline__ vector bool char __ATTRS_o_ai
                    ^
  /usr/lib/clang/8.0.1/include/altivec.h:69:26: error: expected identifier or '('
  static __inline__ vector bool char __ATTRS_o_ai
                           ^
  /usr/include/stdbool.h:39:14: note: expanded from macro 'bool'
                  ^
  [...]

  PR:		240531
  Submitted by:	pkubaj

Changes:
  head/multimedia/kvazaar/Makefile
  head/multimedia/kvazaar/distinfo