Summary: | =media-libs/x264-0.0.20130912 with =sys-devel/gcc-4.8.1-r1 - error: 'asm' operand has impossible constraints | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | tka <tka> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | graham, hardened, jnerin, jstein, luke-jr+gentoobugs, marcan |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
The complete build.log.
Patch register spilling mvc_max when x264_ultrahardened is defined |
Description
tka
2013-11-03 14:53:05 UTC
Created attachment 362488 [details]
The complete build.log.
Created attachment 362502 [details, diff]
Patch register spilling mvc_max when x264_ultrahardened is defined
Try to compile with the attached patch and adding -Dx264_ultrahardened to your CFLAGS then please do test the library by encoding and deconding a video and checking no artifacts are shown. If it works we can try to send it to upstream.
i686-pc-linux-gnu-gcc -Wshadow -O3 -ffast-math -march=native -mtune=native -O2 -fomit-frame-pointer -pipe -Dx264_ultrahardened -msse -mfpmath=sse -Wall -I. -I/var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245 -std=gnu99 -mpreferred-stack-boundary=5 -fPIC -fno-tree-vectorize -c -o encoder/me.o /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/encoder/me.c In file included from /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/common.h:1014:0, from /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/encoder/me.c:28: /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h: In function 'x264_predictor_clip_mmx2': /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h:135:50: warning: initialization makes integer from pointer without a cast [enabled by default] intptr_t tmp = (intptr_t)mv_limit, mvc_max = ((uint32_t *)mvc)+i_mvc, i = 0; ^ /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h: In function 'x264_predictor_roundclip_mmx2': /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h:197:50: warning: initialization makes integer from pointer without a cast [enabled by default] intptr_t tmp = (intptr_t)mv_limit, mvc_max = ((uint32_t *)mvc)+i_mvc, i = 0; ^ /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h: Assembler messages: /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h:141: Error: no instruction mnemonic suffix given and no register operands; can't size instruction /var/tmp/portage/media-libs/x264-0.0.20130912/work/x264-snapshot-20130912-2245/common/x86/util.h:203: Error: no instruction mnemonic suffix given and no register operands; can't size instruction make: *** [encoder/me.o] Error 1 x264-0.0.20140308 fails with the same error on amd64 with hardened gcc x86_64-pc-linux-gnu-4.8.2: from /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/encoder/me.c:28: /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/encoder/me.c: In function ‘x264_me_search_ref’: /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/osdep.h:261:13: error: ‘asm’ operand has impossible constraints #define asm __asm__ ^ /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/x86/util.h:130:5: note: in expansion of macro ‘asm’ asm( ^ /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/osdep.h:261:13: error: ‘asm’ operand has impossible constraints #define asm __asm__ ^ /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/x86/util.h:193:5: note: in expansion of macro ‘asm’ asm( It builds fine with x86_64-pc-linux-gnu-4.8.2-vanilla, however. It would help if you could please run this test and report the results: Add this line to the file /etc/portage/package.env (creating the file if it does not exist): media-libs/x264 Os-fomit-frame-pointer-cflags Then create the file /etc/portage/env/Os-fomit-frame-pointer-cflags with contents: CFLAGS="-Os -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -freorder-blocks-and-partition -ftree-vect-loop-version -march=native -fomit-frame-pointer -fno-stack-protector -nopie -pipe" CXXFLAGS="${CFLAGS}" Yup, those CFLAGS make it build successfully. It's worth noting that I have ABI_X86="32 64" for this package, so I was probably hitting the problem on the 32-bit build, not the 64-bit build (thus it would be the same report as tka). > CFLAGS="-Os -falign-functions -falign-jumps -falign-loops -falign-labels > -freorder-blocks -freorder-blocks-and-partition -ftree-vect-loop-version > -march=native -fomit-frame-pointer -fno-stack-protector -nopie -pipe" > > CXXFLAGS="${CFLAGS}" With these flags, gcc-4.8.2 compiles x264-0.0.20140308 without error. The only issue is: * QA Notice: The following files contain runtime text relocations * Text relocations force the dynamic linker to perform extra * work at startup, waste system resources, and may pose a security * risk. On some architectures, the code may not even function * properly, if at all. * For more information, see http://hardened.gentoo.org/pic-fix-guide.xml * Please include the following list of files in your report: * TEXTREL usr/lib/libx264.so.142 On x86 Hardened the asm code should be disable. In the build log it say it is enable. So is the disable asm check working or not? When building the x86 part on amd64 multilib the asm code should be disable. Have added the pic use flag for amd64 on hardened profile. Can some one test with newest x264 to see if works? I just tested and it works. Actually, I actually have PIC enabled manually before you set it up, but that still did not work last year when this bug is reported. Is there any other stuff you have changed? I see nothing in ChangeLog but the hardened package.use change. I also get this on x86 non-hardened... media-libs/x264-0.0.20140308 builds with (NOT LITERAL): -fomit-frame-pointer || ( -Os -O2 ) Could somebody change the title of this bug so it shows that the problem is not limited to 0.0.20130912: /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/osdep.h:261:13: error: 'asm' operand has impossible constraints #define asm __asm__ Also happens with gcc 4.8.4 and media-libs/x264-0.0.20140308 in amd64 with -m32 (abi_x86_32): x86_64-pc-linux-gnu-gcc -m32 -Wshadow -O3 -ffast-math -march=native -O2 -pipe -ggdb -fno-omit-frame-pointer -msse -mfpmath=sse -Wall -I. -I/var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245 -std=gnu99 -mpreferred-stack-boundary=5 -fPIC -fno-tree-vectorize -c -o encoder/encoder.o /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/encoder/encoder.c In file included from /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/common.h:117:0, from /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/encoder/me.c:28: /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/encoder/me.c: In function ‘x264_me_search_ref’: /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/osdep.h:261:13: error: ‘asm’ operand has impossible constraints #define asm __asm__ ^ /var/tmp/portage/media-libs/x264-0.0.20140308/work/x264-snapshot-20140308-2245/common/x86/util.h:130:5: note: in expansion of macro ‘asm’ asm( ^ I am also experiencing this issue when building media-libs/x264-0.0.20140308 for x86 (32-bit) when CFLAGS includes -fno-omit-frame-pointer. To reiterate, x264 builds for amd64 with and without -fno-omit-frame-pointer, but building for x86 fails unless -fno-omit-frame-pointer is absent. I am using GCC 4.9.3 with CFLAGS="-march=native -ggdb -O2 -pipe -fno-omit-frame-pointer". gcc-4.9.3 =media-libs/x264-0.0.20140308::gentoo if compile using CFLAGS="-g -ggdb -O0 -pipe" I get the same error if CFLAGS="-O3 -pipe" it compiles fine, just few warnings. is this still valid with x264-0.0.20160712? (In reply to Pacho Ramos from comment #18) > is this still valid with x264-0.0.20160712? Yes, the same happens for media-libs/x264-0.0.20160712 when ABI_X86 has "32": 'asm' operand has impossible constraints. Creating special package.env as described in comment #5 helps, but I has less falgs in CFLAGS, only those: CFLAGS="-march=native -fomit-frame-pointer -fno-stack-protector" After that x264 compiles fine with only QA notice about runtime text relocations. Add, gcc version is 4.9.4 |