Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 562208

Summary: media-video/cinelerra-20140710 with sys-devel/gcc-5.2.0 - mmx.h:118:2: error: ‘asm’ operand has impossible constraints
Product: Gentoo Linux Reporter: Markus Walter <gentoo>
Component: Current packagesAssignee: Gentoo Media-video project <media-video>
Status: RESOLVED FIXED    
Severity: normal CC: toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 536984    
Attachments: emerge --info
build log

Description Markus Walter 2015-10-04 09:50:10 UTC
Created attachment 413678 [details]
emerge --info

On my hardened ~amd64 machine with gcc-5.2.0 I see the following failure for cinelerra.

ibtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I../libmpeg3 -D__STDC_CONSTANT_MACROS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_MMX -DUSE_MMX -DX86_CPU -I/usr/include/mjpegtools -I/usr/include/mjpegtools/mpeg2enc -I/usr/include/mjpegtools/mplex -DENCORE_INCLUDE=\"encore50/encore.h\" -I/usr/include/libavcodec -I/usr/include/libswscale -DHAVE_SWSCALER -O2 -pipe -march=native -ggdb -floop-interchange -floop-strip-mine -floop-block -finline-functions -Wformat -Werror=format-security -c libdv.c  -fPIC -DPIC -o .libs/libdv.o
In file included from libdv.c:13:0:
mmx.h: In function ‘mm_support’:
mmx.h:118:2: error: ‘asm’ operand has impossible constraints
  __asm__ __volatile__ (
  ^
Comment 1 Markus Walter 2015-10-04 09:50:35 UTC
Created attachment 413680 [details]
build log
Comment 2 Alexis Ballier gentoo-dev 2015-10-09 13:54:26 UTC
it'd be worth to report a minimal test case upstream.

clobber list is: "eax", "ebx", "ecx", "edx"

which seems plenty enough to be able to solve it; but since, basically, inline asm is defined by what gcc supports, they might reply some of these registers are reserved, which means it'd have to be patched here, but before that I'd like to have a clear statement on what's wrong.
Comment 3 Alexis Ballier gentoo-dev 2015-10-09 14:00:21 UTC
Hmmm:

/*
 * Drop mm_support() and mmx_ok() as these do not build with clang and
 * are unused by Cinelerra CV.  Inspired by change found in
 * <URL: http://hg.libsdl.org/SDL/file/32f0f603a0c8/src/video/mmx.h >
 */


So, it might be even simpler by ifdefing that stuff out (but maybe still worth reporting to gcc upstream so that they can have a look at it)
Comment 4 Magnus Granberg gentoo-dev 2015-10-09 18:56:26 UTC
You may be hit by -fstack-check it need one registers to work
and it is default on hardened.
check if it works if you pass -fstack-check=no
Comment 5 Alexis Ballier gentoo-dev 2015-10-10 08:37:59 UTC
(In reply to Magnus Granberg from comment #4)
> You may be hit by -fstack-check it need one registers to work
> and it is default on hardened.
> check if it works if you pass -fstack-check=no

no, that's not it, I have it without hardened too, and clobbering only "eax" makes it fail the same way. anyway, this asm seems very wrong, and I'm not even sure "eax" is valid on amd64.
Comment 6 Alexis Ballier gentoo-dev 2015-10-10 09:06:08 UTC
commit cc1aa656e022d809b2e9d2ef64c2c4360c75a9d3
Author: Alexis Ballier <aballier@gentoo.org>
Date:   Sat Oct 10 11:04:52 2015 +0200

    media-video/cinelerra: Fix build with gcc 5.2 by disabling old useless code. Bug #562208.



this code was definitely buggy and useless, so I went the simple way :)