Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: invalid operand in inline asm: 'adds $1, ${2:R}, ${2:Q}, lsr #31 #16

Open
hsleedevelop opened this issue Nov 1, 2011 · 30 comments

Comments

@hsleedevelop
Copy link

CC libavcodec/audioconvert.o
error: invalid operand in inline asm: 'adds $1, ${2:R}, ${2:Q}, lsr #31
mvnne $1, #1<<31
eorne $0, $1, ${2:R}, asr #31
'
make: *** [libavcodec/audioconvert.o] Error 1

iOS5 sdk, LION-10.7.2

@hsleedevelop
Copy link
Author

using LLVM-GCC4.2 compiler,,

@wobbals
Copy link

wobbals commented Nov 7, 2011

@shengbinmeng
Copy link

I now have exactly the same problem!
evercry, have you figured it out? I'll appreciate it if you share your solution.
I googled, but found no answer.

@wobbals
Copy link

wobbals commented Nov 15, 2011

Edwin- have you tried disabling asm support when configuring ffmpeg? This was sufficient to solve the issue for me, and the ffmpeg libraries still work fine without it.

@shengbinmeng
Copy link

Thank you, wobbles, disabling asm does work fine. But I should mention that I want to use NEON optimization of ffmpeg, so if disable-asm, the neon support is not possible.

@ghost
Copy link

ghost commented Nov 17, 2011

Hi Edwin, any luck with this issue ?

I have also the same problem with Lion and iOS 5.0.

Looking for fix ....

@shengbinmeng
Copy link

Well, just for a quick work, I did this:

  1. find the error source, that is "av_clipl_int32_arm" in libavutil/arm/intmath.h;
  2. avoid it. (I simply comment out "#define av_clipl_int32 av_clipl_int32_arm", so don't use NEON for just that one function)

Hope to know a more professional fix :-)

@ghost
Copy link

ghost commented Nov 18, 2011

Hi Edwin,

Thanks for the fix. That error gone away but unfortunately, I got another error,

libavformat/asfcrypt.o
error: invalid operand in inline asm: 'ldr ${0:Q}, $1
ldr ${0:R}, $2

What is the ffmpeg version you are using ?

Thanks

@shengbinmeng
Copy link

I am using kind of old version - 0.6.1, and have disabled a lot of encoders/decoders (in my application).

Anyway, what I did is only "扬汤止沸", we may all need a better fix.

@ghost
Copy link

ghost commented Nov 18, 2011

Yes, we may need a proper fix.

If you don't mind, can I have the ffmpeg configure command options that you are using at terminal ?

I also don't want a lot of encoders and decoders.

Thanks,

@shengbinmeng
Copy link

It should be all right. myconfig.sh:

#!/bin/bash

./configure
--disable-doc
--disable-ffmpeg
--disable-ffplay
--disable-ffprobe
--disable-ffserver
--disable-avdevice
--disable-avfilter

--disable-everything
--enable-decoder=h264
--enable-decoder=mp3
--enable-decoder=mp2
--enable-decoder=mpegaudio
--enable-parser=h264
--enable-parser=mpegaudio
--enable-demuxer=h264
--enable-demuxer=rtsp
--enable-demuxer=rtp
--enable-protocol=rtsp
--enable-protocol=rtp
--enable-protocol=udp
--enable-protocol=tcp

--enable-cross-compile
--arch=arm
--target-os=darwin
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
--as="gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc"
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
--extra-cflags="-w -arch armv7 -mfpu=neon "
--extra-ldflags="-arch armv7 -mfpu=neon -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk"
--enable-pic \

@ghost
Copy link

ghost commented Nov 18, 2011

Thanks A lot :)

@ghost
Copy link

ghost commented Nov 19, 2011

Hi Edwin,

Have you built librtmp with ffmpeg and arm ?

I am having trouble with building ffmpeg with librtmp :(

I am always getting "librtmp" not found. I set the PKG_PATH to point librtmp.c but no luck.

any Idea ?

Thanks

@shengbinmeng
Copy link

No, I know little about using librtmp.
I googled and it seems some one has the similar problem with you. you can go do more searching.

Good luck!

@lu-zero
Copy link

lu-zero commented Dec 15, 2011

@ciphor
Copy link

ciphor commented Dec 22, 2011

I met this problem too.

@davidcairns
Copy link

So… any update on a fix for this?

@ciphor
Copy link

ciphor commented Feb 17, 2012

This error is due to that current version of gnu assembler does not support
64bit instructions.
My suggestion is to replace those 64bit assembly functions to 32bit.

2012/2/17 David Cairns <
reply@reply.github.com

So any update on a fix for this?


Reply to this email directly or view it on GitHub:
#16 (comment)

@zebeurton
Copy link

I had also this issue. How can we replace 64 bit assembly functions to 32bit ones?

@IronSight87
Copy link

Is there meanwhile a solution for that problem?

@wobbals
Copy link

wobbals commented Apr 24, 2012

Yes; turn the optimizations off for your target architecture. ffmpeg runs just fine without them.

@IronSight87
Copy link

But this will slow down the performance. Other solutions?

@zebeurton
Copy link

I confirm it slown down performances. Impossible to decode correctly a 1080p video encoded in H264 on a iPad 2... It runs at two or three frame by seconds.

Any solution?

@wobbals
Copy link

wobbals commented Apr 25, 2012

If you feel you must have optimizations turned on, simply disable the defines for all 64-bit inline assembly declarations, as per the instructions I linked early in the thread. Here's a diff to get you started:

danger:FFmpeg charley$ git diff
diff --git a/libavutil/arm/intmath.h b/libavutil/arm/intmath.h
index 52af66e..219e18f 100644
--- a/libavutil/arm/intmath.h
+++ b/libavutil/arm/intmath.h
@@ -97,7 +97,7 @@ static av_always_inline av_const int FASTDIV(int a, int b)

 #endif /* HAVE_ARMV6 */

-#define av_clipl_int32 av_clipl_int32_arm
+//#define av_clipl_int32 av_clipl_int32_arm
 static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
 {
     int x, y;
diff --git a/libavutil/arm/intreadwrite.h b/libavutil/arm/intreadwrite.h
index 0292aab..3e19cf3 100644
--- a/libavutil/arm/intreadwrite.h
+++ b/libavutil/arm/intreadwrite.h
@@ -52,7 +52,7 @@ static av_always_inline void AV_WN32(void *p, uint32_t v)
     __asm__ ("str  %1, %0" : "=m"(*(uint32_t *)p) : "r"(v));
 }

-#define AV_RN64 AV_RN64
+//#define AV_RN64 AV_RN64
 static av_always_inline uint64_t AV_RN64(const void *p)
 {
     uint64_t v;
@@ -63,7 +63,7 @@ static av_always_inline uint64_t AV_RN64(const void *p)
     return v;
 }

-#define AV_WN64 AV_WN64
+//#define AV_WN64 AV_WN64
 static av_always_inline void AV_WN64(void *p, uint64_t v)
 {
     __asm__ ("str  %Q2, %0  \n\t"

@IronSight87
Copy link

Does anybody found a better fix?
Disable the defines, will also disable neon optimizations!
I tried configure with llvm-gcc, but ended with the same result.

@mansr
Copy link
Contributor

mansr commented Aug 8, 2012

@IronSight87
Copy link

Thanks mansr!
Works like a charm.

@germangda
Copy link

It seems that another issue happens after applying libav fix :S I'm using this configuration

./configure --extra-ldflags=-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/system --disable-bzlib --disable-doc --enable-cross-compile --arch=arm --target-os=darwin --cc='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7' --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7' --enable-pic --disable-zlib --disable-bzlib --enable-decoder=h264 --enable-demuxer=h264 --enable-parser=h264

Already did the Libavcodec fixes (thanks mansr) but still shows me this error (copy/paste of the last lines in console)
CC libavcodec/arm/aacpsdsp_init_arm.o
AS libavcodec/arm/aacpsdsp_neon.o
AS libavcodec/arm/ac3dsp_arm.o
AS libavcodec/arm/ac3dsp_armv6.o
./libavutil/arm/asm.S:178:garbage following instruction -- ldr r4,.Lpicoff\' ./libavutil/arm/asm.S:179:Unknown pseudo-op: .Lpic ./libavutil/arm/asm.S:179:Rest of line ignored. 1st junk character valued 92 (\). ./libavutil/arm/asm.S:181:Unknown pseudo-op: .altmacro ./libavutil/arm/asm.S:182:Unknown pseudo-op: .noaltmacro ./libavutil/arm/asm.S:185:Unknown pseudo-op: .Lpic ./libavutil/arm/asm.S:185:Rest of line ignored. 1st junk character valued 92 (\). ./libavutil/arm/asm.S:178:garbage following instruction --ldr lr,.Lpicoff'
./libavutil/arm/asm.S:179:Unknown pseudo-op: .Lpic
./libavutil/arm/asm.S:179:Rest of line ignored. 1st junk character valued 92 ().
./libavutil/arm/asm.S:181:Unknown pseudo-op: .altmacro
./libavutil/arm/asm.S:182:Unknown pseudo-op: .noaltmacro
./libavutil/arm/asm.S:185:Unknown pseudo-op: .Lpic
./libavutil/arm/asm.S:185:Rest of line ignored. 1st junk character valued 92 ().
make: *** [libavcodec/arm/ac3dsp_armv6.o] Error 1

I can only make it using --disable-asm flag, do you have any guess what could happen with this error?

@IronSight87
Copy link

Use the following gas-preprocessor and it will work:
https://github.com/xbmc/xbmc/tree/master/tools/darwin/depends/gas-preprocessor

@germangda
Copy link

Woooo! It works!
Thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants