Bug 216162 - multimedia/x265: fails to build with clang 4.0 (3 ports skipped)
Summary: multimedia/x265: fails to build with clang 4.0 (3 ports skipped)
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: Mikhail Teterin
URL:
Keywords: needs-patch
Depends on:
Blocks: 216008
  Show dependency treegraph
 
Reported: 2017-01-17 08:27 UTC by Jan Beich
Modified: 2017-01-19 05:40 UTC (History)
3 users (show)

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


Attachments
Possible fix (347 bytes, patch)
2017-01-17 21:14 UTC, Mikhail Teterin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2017-01-17 08:27:17 UTC
In file included from source/test/testbench.cpp:29:
In file included from source/test/pixelharness.h:28:
source/test/testharness.h:74:24: error:
      static declaration of '__rdtsc' follows non-static declaration
static inline uint32_t __rdtsc(void)
                       ^
source/test/testharness.h:74:24: note:
      previous implicit declaration is here

build log: http://sprunge.us/TFVf
Comment 1 Jan Beich freebsd_committer 2017-01-17 08:32:26 UTC
Probably a Clang bug.

  $ cat a.c
  void __rdtsc(void) {}

  $ cc -fno-builtin -c a.c
  a.c:1:6: error: conflicting types for '__rdtsc'
  void __rdtsc(void) {}
       ^
  a.c:1:6: note: '__rdtsc' is a builtin with type 'unsigned long long (void)'
  a.c:1:6: error: definition of builtin function '__rdtsc'
  void __rdtsc(void) {}
       ^
  2 errors generated.
Comment 2 Mikhail Teterin freebsd_committer 2017-01-17 20:29:52 UTC
I'm curious, where the reporter obtained clang-4.0 to begin with... I don't see such a thing under lang/ at all -- the lang/clang-devel installs 5.x
Comment 3 commit-hook freebsd_committer 2017-01-17 20:44:09 UTC
A commit references this bug:

Author: mi
Date: Tue Jan 17 20:43:11 UTC 2017
New revision: 431774
URL: https://svnweb.freebsd.org/changeset/ports/431774

Log:
  Upgrade from 1.9 to 2.2.

  Spurred into action by
  PR:		216162

Changes:
  head/multimedia/x265/Makefile
  head/multimedia/x265/distinfo
  head/multimedia/x265/pkg-plist
Comment 4 Jan Beich freebsd_committer 2017-01-17 20:54:45 UTC
(In reply to Mikhail Teterin from comment #2)
> where the reporter obtained clang-4.0 to begin with...

https://svnweb.freebsd.org/base/projects/clang400-import/?view=log

$ poudriere jail -cj clang40-i386 -a i386 -v projects/clang400-import -m svn

(In reply to commit-hook from comment #3)
> Upgrade from 1.9 to 2.2.

Have you tested consumers aren't broken? At least bump their PORTREVISION since SOVERSION has changed.

https://abi-laboratory.pro/tracker/timeline/x265/
Comment 5 Dimitry Andric freebsd_committer 2017-01-17 20:57:19 UTC
Yeah, Brooks will probably setup a clang40 port, once the upstream branch gets its first release candidate.

But does x265 2.2 fix the build problem reported by Jan?
Comment 6 Mikhail Teterin freebsd_committer 2017-01-17 21:05:07 UTC
(In reply to Jan Beich (mail not working) from comment #4)
> Have you tested consumers aren't broken?

This reminds me of the old Soviet joke about a bureaucrat demanding, an applicant proves his "single" status by presenting an affidavit from ALL WOMEN stating, she is not his wife.

I tested with the vendor's own test-harness.

> But does x265 2.2 fix the build problem reported by Jan?

No, most likely not. I'm still working on that. May need to wait for lang/clang4...
Comment 7 Mikhail Teterin freebsd_committer 2017-01-17 21:14:31 UTC
Created attachment 179007 [details]
Possible fix

Jan could you, please, try again with this file dropped into files/ subdirectory? Thanks!
Comment 8 Jan Beich freebsd_committer 2017-01-17 21:23:31 UTC
Comment on attachment 179007 [details]
Possible fix

Builds fine with the patch: http://sprunge.us/XgWH
Also tested locally on amd64 (haven't created poudriere jail yet).
Comment 9 commit-hook freebsd_committer 2017-01-18 00:32:16 UTC
A commit references this bug:

Author: mi
Date: Wed Jan 18 00:31:11 UTC 2017
New revision: 431776
URL: https://svnweb.freebsd.org/changeset/ports/431776

Log:
  Add a patch to avoid providing our own implementation of __rtdsc
  when built with clang version 4 or higher (which has its own).

  PR:		216162

Changes:
  head/multimedia/x265/files/patch-rdtsc
Comment 10 Mikhail Teterin freebsd_committer 2017-01-18 00:33:52 UTC
The likely fix has been committed. Tested with clang-4 by jbeich (the reporter) and clang-5 by myself (the maintainer).

Please, reopen if anything is still broken. Thanks!
Comment 11 commit-hook freebsd_committer 2017-01-19 05:40:05 UTC
A commit references this bug:

Author: jbeich
Date: Thu Jan 19 05:39:23 UTC 2017
New revision: 431851
URL: https://svnweb.freebsd.org/changeset/ports/431851

Log:
  MFH: r431776 by mi

  Add a patch to avoid providing our own implementation of __rtdsc
  when built with clang version 4 or higher (which has its own).

  PR:		216162
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2017Q1/
  branches/2017Q1/multimedia/x265/files/patch-rdtsc