Question - how to build for Android arm64-v8
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.3k
- Forks
- 808
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I'm trying to compile Opus for Android arm64 (and ultimately other arch's) using the CMakeLists.txt file available in the repository.
My cmake commands are like this:
https://gist.github.com/kvasilye/9004332a5f3f90f2a6e868090d004d7b
This produces an error:
ld: error: undefined symbol: celt_pitch_xcorr_neon
>>> referenced by pitch.c:347 (/home/[ANT.AMAZON.COM/kvasilye/opus/celt/pitch.c:347](http://ant.amazon.com/kvasilye/opus/celt/pitch.c:347))
>>> CMakeFiles/opus.dir/celt/pitch.c.o:(pitch_search)
>>> referenced by celt_lpc.c:314 (/home/[ANT.AMAZON.COM/kvasilye/opus/celt/celt_lpc.c:314](http://ant.amazon.com/kvasilye/opus/celt/celt_lpc.c:314))
>>> CMakeFiles/opus.dir/celt/celt_lpc.c.o:(_celt_autocorr)
>>> referenced by burg_modified_FIX.c:98 (/home/[ANT.AMAZON.COM/kvasilye/opus/silk/fixed/burg_modified_FIX.c:98](http://ant.amazon.com/kvasilye/opus/silk/fixed/burg_modified_FIX.c:98))
>>> CMakeFiles/opus.dir/silk/fixed/burg_modified_FIX.c.o:(silk_burg_modified_c)
>>> referenced 2 more times
Next, I tried to write my own CMakeLists.txt and got stuck too - the undefined symbol above is defined in celt_pitch_xcorr_arm.s which as I understand uses ARM assembler syntax.
I converted the file to GNU syntax using the provided Perl script.
Trying to compile the output with aarch64-linux-gnu-as gives a whole bunch of errors like:
third_party/cmake-build-opus-android-arm64-v8a-Debug/celt_pitch_xcorr_arm_gnu.S: Assembler messages:
third_party/cmake-build-opus-android-arm64-v8a-Debug/celt_pitch_xcorr_arm_gnu.S:1: Error: unknown pseudo-op: `.syntax'
third_party/cmake-build-opus-android-arm64-v8a-Debug/celt_pitch_xcorr_arm_gnu.S:2: Error: junk at end of line, first unrecognized character is `@'
third_party/cmake-build-opus-android-arm64-v8a-Debug/celt_pitch_xcorr_arm_gnu.S:3: Error: junk at end of line, first unrecognized character is `@'
third_party/cmake-build-opus-android-arm64-v8a-Debug/celt_pitch_xcorr_arm_gnu.S:4: Error: junk at end of line, first unrecognized character is `@'
third_party/cmake-build-opus-android-arm64-v8a-Debug/celt_pitch_xcorr_arm_gnu.S:5: Error: junk at end of line, first unrecognized character is `@'
So it looks unhappy with the syntax.
Questions:
1 - What is the right way to compile Opus for Android on arm64-v8a?
2 - If I wanted to compile the asm file, how can I do that?
3 - Is this asm file for both armeabi-v7a and arm64-v8a or just for armeabi-v7a? The symbol is required for arm64-v8a, but there is a directive ".arch armv7-a" at the top of the file so I'm confused.
I really don't know anything about arm assembly to figure these out on my own, any help would be appreciated!
PS - I am able to compile the generated GNU .S file using arm-linux-gnueabi-as on Linux or armv7a-linux-androideabi21-clang which is included in the Android SDK. But that again is for arm7 - and the symbol is missing for arm64-v8a.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the repository's CMakeLists.txt and the celt_pitch_xcorr_arm.s source, then review the provided Perl conversion script and the Android arm64-v8a commands in the issue. Reproduce the undefined-symbol and assembler errors; done means identifying a reproducible arm64-v8a build path and clarifying which assembly source and syntax apply to each ARM target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, c
- Domain
- build-system, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100