yuvi / gas-preprocessor Goto Github PK
View Code? Open in Web Editor NEWPerl script that implements a subset of the GNU as preprocessor that Apple's as doesn't
Perl script that implements a subset of the GNU as preprocessor that Apple's as doesn't
In svn release 22404 of ffmpeg, a .macro defined inside another .macro has been added to libavcodec/arm/asm.S
After parsing the first and second .macro, then the inner .endm, gas-preprocessor dies with "ERROR: .endm without .macro" when it encounters the second .endm.
.macro function name, export=0
.macro endfunc
# some code for endfunc
.endm
# some code for function
.endm
Self-contained build script to reproduce:
https://gist.github.com/swisspol/8498104
Build script output:
https://gist.github.com/swisspol/8498120
And where it fails:
jsimd_arm_neon.S:270:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))]
^
jsimd_arm_neon.S:276:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))]
^
jsimd_arm_neon.S:283:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))]
^
jsimd_arm_neon.S:291:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))]
^
jsimd_arm_neon.S:299:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))]
^
jsimd_arm_neon.S:306:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))]
^
jsimd_arm_neon.S:313:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))]
^
jsimd_arm_neon.S:321:16: error: invalid operand for instruction
ldrd r4, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))]
I asked about the issue on the libjpeg-turbo mailing list and someone suggested to ask here:
http://sourceforge.net/p/libjpeg-turbo/mailman/message/31870599/
Hy guys,
there is an issue compiling ffmpeg for ios with asm and neon support.
I tried with SDK 4.3, 5.0 and 5.1, but I always get the message "error: invalid operand in inline asm".
I know this error is related to the new GNU assembler.
Disabling asm is no option, because it will slow down the performance massivly.
I already read the related post (#16), but there is no solution.
PLEASE HELP!
Here is my building script:
BASEPATH=$PWD
PLATFORMPATH="/Applications/Xcode.app/Contents/Developer/Platforms"
IOSSDK=4.3
./configure \
--cc=${PLATFORMPATH}/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \
--as='gas-preprocessor.pl ${PLATFORMPATH}/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2'
--sysroot="${PLATFORMPATH}/iPhoneOS.platform/Developer/SDKs/iPhoneOS${IOSSDK}.sdk" \
--target-os=darwin \
--arch=arm \
--cpu=cortex-a8 \
--extra-cflags="-w -arch armv7 -mfpu=neon " \
--extra-ldflags="-L${PLATFORMPATH}/iPhoneOS.platform/Developer/SDKs/iPhoneOS${IOSSDK}.sdk/usr/lib/system -arch armv7 -mfpu=neon -isysroot ${PLATFORMPATH}/iPhoneOS.platform/Developer/SDKs/iPhoneOS${IOSSDK}.sdk" \
--extra-cxxflags='-mno-apcs-stack-check -mfpu=neon -mvectorize-with-neon-quad' \
--disable-bzlib \
--disable-yasm \
--disable-vdpau \
--disable-vaapi \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--disable-ffprobe \
--disable-filters \
--disable-bsfs \
--disable-doc \
--disable-debug \
--disable-encoders \
--disable-muxers \
--disable-protocols \
--disable-parsers \
--disable-demuxers \
--disable-decoders \
--enable-protocol=rtp \
--enable-protocol=udp \
--enable-parser=mpegvideo \
--enable-demuxer=rawvideo \
--enable-demuxer=mpegvideo \
--enable-demuxer=rtp \
--enable-demuxer=mpegts \
--enable-decoder=rawvideo \
--enable-decoder=mpeg1video \
--enable-decoder=mpeg2video \
--enable-decoder=mpegvideo \
--enable-cross-compile \
--enable-nonfree \
--enable-gpl \
--enable-version3 \
--enable-pic \
--enable-neon
Hi,
When I running the
./configure --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/iPhoneOS3.0.sdk --cpu=arm1176jzf-s --extra-cflags='-arch
armv6' --extra-ldflags='-arch armv6'
script I getting the error: “Unrecognized input filetype at /bin/sh line 23″
Pls help me.
Thanks,
Eyal.
How do you know about all of this stuff? I went through Computer Science but my knowledge of Compiling for difference architectures is weak.
I'm trying to get this working with pixman so I can compile it for iPhone. I'm getting errors when trying to compile all 3 of these files:
http://cgit.freedesktop.org/pixman/tree/pixman/pixman-arm-neon-asm.S
http://cgit.freedesktop.org/pixman/tree/pixman/pixman-arm-neon-asm-bilinear.S
http://cgit.freedesktop.org/pixman/tree/pixman/pixman-arm-simd-asm.S
For pixman-arm-neon-asm.S, I get this error: "Too many arguments to macro pixld_a at ./gas-preprocess.pl line 317, line 1128."
For pixman-arm-simd-asm.S I get:
pixman-arm-simd-asm.S:37Unknown pseudo-op: .altmacro
pixman-arm-simd-asm.S:150:FATA:Symbol fname already defined
And finally for pixman-arm-neon-asm-bilinear.S, I get these:
pixman-arm-neon-asm-bilinear.S:61:Unknown pseudo-op: .eabi_attribute
pixman-arm-neon-asm-bilinear.S:61:Rest of line ignored. 1st junk
character valued 49 (1).
pixman-arm-neon-asm-bilinear.S:62:Unknown pseudo-op: .eabi_attribute
pixman-arm-neon-asm-bilinear.S:62:Rest of line ignored. 1st junk
character valued 49 (1).
pixman-arm-neon-asm-bilinear.S:64:Unknown pseudo-op: .altmacro
pixman-arm-neon-asm-bilinear.S:629:Unknown pseudo-op: .error
pixman-arm-neon-asm-bilinear.S:629:Rest of line ignored. 1st junk
character valued 117 (u).
pixman-arm-neon-asm-bilinear.S:673:Can't relocate expression. Absolute
0 assumed.
pixman-arm-neon-asm-bilinear.S:677:bad instruction bilinear_process_last_pixel' pixman-arm-neon-asm-bilinear.S:686:Can't relocate expression. Absolute 0 assumed. pixman-arm-neon-asm-bilinear.S:688:bad instruction
bilinear_process_two_pixels'
pixman-arm-neon-asm-bilinear.S:694:bad instruction
bilinear_process_pixblock_head' pixman-arm-neon-asm-bilinear.S:698:bad instruction
bilinear_process_pixblock_tail_head'
pixman-arm-neon-asm-bilinear.S:702:bad instruction
bilinear_process_pixblock_tail' pixman-arm-neon-asm-bilinear.S:707:bad instruction
bilinear_process_two_pixels'
pixman-arm-neon-asm-bilinear.S:711:bad instruction `bilinear_process_last_pixel'
pixman-arm-neon-asm-bilinear.S:628:FATAL:Symbol fname already defined.
All of these files compile just for using GCC for arm on other platforms (like Android). Could anyone suggest how to fix this tool, or suggest fixes to the source files to make them work with this tool?
Probably it could be fold into the macro support but I'm having an hard time to properly do that myself.
(irpc usage had been recently introduced in libav)
In 0.7.x and 0.8.x, if you use avcodec_decode_audio3 for decoding audio, you may get wrong audio data.
I can't find this solution. I don't know why building wrong or bug.
Do you know this solution and reason?
Maybe I use it in a wrong way but I get this error:
unhandled .if varient at /usr/bin/gas-preprocessor.pl line 199, line 145.
make: *** [libavcodec/arm/mpegaudiodsp_fixed_armv6.o] Error 29
using this configure:
./configure --enable-cross-compile --arch=arm --target-os=darwin --cc='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk --cpu=cortex-a8 --enable-pic
I was compiling Mplayer(uses mmpeg) for iPhone. Thanks for your gas-prepocessor. Its a life saver.
I think that in the comment removing section instead of
s/$comm.//x;
should be
s/$comm./$comm/x;
It will remove the comment text but leave the @ mark for the sake of things like
and stuff. I did it in my local copy.
Thanks,
[email protected]
P.S
I also commented out the eabi_atribute again. Is that Ok?
Hi,
I am trying to run ./configure for version iOS5.1 like this:
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/applications/xcode.app/contents/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /applications/xcode.app/contents/Developer/usr/bin/gcc' --sysroot=/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk' --enable-pic
And I am getting this error:
/applications/xcode.app/contents/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
Could somebody please indicate the right parameters?, thanks in advance.
Hi,
When I try to configure with latest gas-prepocessor.pl with latest ffmpeg source, it is giving the following error at line 35
Unable to identify target architecture
I guess, what you are comparing with /arm/ is wrong.
($gcc_cmd[0] =~ /arm/) , as here the gcc_com[0] is coming as "/developer/..../gcc"
The -MT option is used to specify the name of the make target that will be written to the file indicated by -MF. "-" is not a proper make target, thus "-MT anything.o" should not be changed to "-MT -".
A fix for this problem may look like this:
remove this line:
@preprocess_c_cmd = map { /.o$/ ? "-" : $_ } @preprocess_c_cmd;
add these lines:
my $i;
my $o_flag = 0;
for ($i = 1; $i < @preprocess_c_cmd; $i++) {
if ($preprocess_c_cmd[$i] eq "-o") {
$o_flag = 1;
} elsif ($o_flag) {
$o_flag = 0;
if ($preprocess_c_cmd[$i] =~ /.o$/) {
$preprocess_c_cmd[$i] = "-";
}
}
}
full command used was:
gas-preprocessor.pl arm-linux-androideabi-gcc -I. -I./ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -O3 -Wall -mthumb -pipe -fpic -fasm -finline-limit=300 -ffast-math -fstrict-aliasing -Werror=strict-aliasing -fmodulo-sched -fmodulo-sched-allow-regmoves -Wno-psabi -Wa,--noexecstack -DANDROID -DNDEBUG -march=armv7-a -mthumb -mthumb-interwork -mfpu=neon -mfloat-abi=softfp -mvectorize-with-neon-quad -march=armv7-a -fPIC -g -MMD -MF libavcodec/arm/aacpsdsp_neon.d -MT libavcodec/arm/aacpsdsp_neon.o -c -o libavcodec/arm/aacpsdsp_neon.o libavcodec/arm/aacpsdsp_neon.S
Error was:
libavcodec/arm/aacpsdsp_neon.S: Assembler messages:
libavcodec/arm/aacpsdsp_neon.S:320: Error: junk at end of line, first unrecognized character is f' libavcodec/arm/aacpsdsp_neon.S:321: Error: junk at end of line, first unrecognized character is
f'
libavcodec/arm/aacpsdsp_neon.S:322: Error: junk at end of line, first unrecognized character is f' libavcodec/arm/aacpsdsp_neon.S:323: Error: junk at end of line, first unrecognized character is
f'
libavcodec/arm/aacpsdsp_neon.S:324: Error: junk at end of line, first unrecognized character is `f'
make: *** [libavcodec/arm/aacpsdsp_neon.o] Error 1
Unfortunately not a lot of usage for this tool exists. Is this still working? What am i doing wrong?
libavcodec/arm/mpegaudiodsp_fixed_armv6.S:126:bad instruction strh_post r10,r3,r4' libavcodec/arm/mpegaudiodsp_fixed_armv6.S:236:bad instruction
strh_post r10,r3,r12'
libavcodec/arm/mpegaudiodsp_fixed_armv6.S:243:bad instruction `strh_dpost r11,r5,r12'
If gas-preprocessor.pl is invoked with a gcc command line that includes the -fastf option the assembled object file will have a mach-o header but no code, and there will be no error message.
It is possible other gcc options will be discovered to be incompatible with the -E option.
A possible fix may look like this:
@preprocess_c_cmd = grep(!/-fastf/, @preprocess_c_cmd);
CC libavcodec/audioconvert.o
error: invalid operand in inline asm: 'adds
mvnne $1, #1<<31
eorne $0,
'
make: *** [libavcodec/audioconvert.o] Error 1
iOS5 sdk, LION-10.7.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.