Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612370 - media-video/mpv-0.24.0: pre-merge check (tc-has-tls) fails
Summary: media-video/mpv-0.24.0: pre-merge check (tc-has-tls) fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All OS X
: Normal minor (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-11 22:09 UTC by *
Modified: 2017-03-20 00:53 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description * 2017-03-11 22:09:49 UTC
My system is macOS Sierra (10.12.3) built from the latest bootstrap-prefix.sh. I haven't looked into this but the precheck for mpv-0.24.0 fails:

>>> Running pre-merge checks for media-video/mpv-0.24.0
 * ERROR: media-video/mpv-0.24.0::gentoo_prefix failed (pretend phase):
 *   Your compiler lacks C++11 TLS support. Use GCC>=4.8 or Clang>=3.3.
 *
 * Call stack:
 *           ebuild.sh, line 115:  Called __call-ebuildshell 'pkg_pretend'
 *           ebuild.sh, line 529:  Called pkg_pretend
 *   mpv-0.24.0.ebuild, line 156:  Called mpv_check_compiler
 *   mpv-0.24.0.ebuild, line 147:  Called die
 * The specific snippet of code:
 *   			die "Your compiler lacks C++11 TLS support. Use GCC>=4.8 or Clang>=3.3."
 
Just commenting out the check seems to fix the issue, and mpv builds and works fine (but it does require a more recent version of ffmpeg than is in the tree).

Reproducible: Always
Comment 1 Coacher 2017-03-12 13:44:33 UTC
Please use the supported compiler as told by the error message. Also provide your 'emerge --info' output.

There is some generic code (see video/out/opengl/context.c) that benefits from TLS support and I am not interested in either tracking down every possible situation where it's used or creating a separate USE flag in this case.
Comment 2 * 2017-03-12 16:22:04 UTC
Already using a supported compiler:
clang version 3.9.1 (tags/RELEASE_391/final)

Which thinks it has TLS support:
Checking for C11 TLS support                                      : yes

I suspect it's an issue with tc-has-tls on macOS. Since this ebuild will fail for anyone compiling on macOS, hopefully they will find this ticket (or more likely, just override it as I did).
Comment 3 Fabian Groffen gentoo-dev 2017-03-12 16:28:00 UTC
Reopening, pulling to Prefix area.
Comment 4 Coacher 2017-03-12 16:36:17 UTC
(In reply to * from comment #2)
> Already using a supported compiler:
> clang version 3.9.1 (tags/RELEASE_391/final)
> 
> Which thinks it has TLS support:
> Checking for C11 TLS support                                      : yes
> 
> I suspect it's an issue with tc-has-tls on macOS. Since this ebuild will
> fail for anyone compiling on macOS, hopefully they will find this ticket (or
> more likely, just override it as I did).
Ok, I see. This bugreport should be against toolchain-funcs eclass as it has nothing to do with mpv specifically.
Comment 5 Fabian Groffen gentoo-dev 2017-03-19 19:59:44 UTC
I've synced toolchain-funcs.eclass, but found no changes to the tc-has-tls function.

running the function manually reveals this:

clang -fPIC -shared -Wl,-z,defs y.c -o y 
ld: unknown option: -z
clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)

IOW tc-has-tls uses GNU binutils specifics to establish whether or not tls works.
Comment 6 Fabian Groffen gentoo-dev 2017-03-19 20:02:57 UTC
Darwin ld uses -undefined error by default (to match the -z defs) so, will add a conditional to the prefix version of the eclass there.
Comment 7 Fabian Groffen gentoo-dev 2017-03-19 20:07:25 UTC
I've added the fix (seems to make the check work for me).

I'll close this bug now, should you find new problems with mpv itself, please report a new bug.

Thanks!
Comment 8 Coacher 2017-03-20 00:53:50 UTC
(In reply to Fabian Groffen from comment #7)
> I've added the fix (seems to make the check work for me).
> 
> I'll close this bug now, should you find new problems with mpv itself,
> please report a new bug.
> 
> Thanks!
Nice, thank you.