Errors in compiling FFmpeg for windows10/aarch64 using Microsoft Visual Studio 2017 Preview edition

481 Views Asked by At

I am trying to compile FFmpeg (the Chromium version) for Windows10/Aarch64 configuration using Microsoft Visual Studio 2017 Preview community edition. I am running into errors in the assembly files as copied below (highlighted few errors). I believe FFmpeg is working for Linux/Aarch64 configuration (probably using GNU assembler) already in which case the same assembly code should also work for Microsoft ARM Macro Assembler as well. Please let me know if I am missing anything here and any pointers to help resolve the errors.

D:\Work\Chromium_FFmpeg\chromium\src>ninja -C out\ARM64V8 third_party\ffmpeg ninja: Entering directory `out\ARM64V8' [2/9] ASM obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavcodec_aarch64_fft_neon.obj FAILED: obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavcodec_aarch64_fft_neon.obj D:/Work/Chromium_FFmpeg/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py asm-wrapper environment.arm64 armasm64.exe /Foobj/third_party/ffmpeg/ffmpeg_internal/autorename_libavcodec_aarch64_fft_neon.obj ../../third_party/ffmpeg/libavcodec/aarch64/autorename_libavcodec_aarch64_fft_neon.S Microsoft (R) ARM Macro Assembler Version 14.16.26926.0 for 64 bits D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\autorename_libavcodec_aarch64_fft_neon.S(1) : error A2003: improper line syntax: / // File automatically generated. See crbug.com/495833. D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\autorename_libavcodec_aarch64_fft_neon.S(2) : error A2230: Illegal preprocessor directive; only "#line [filename]" is recognized include "fft_neon.S" D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\autorename_libavcodec_aarch64_fft_neon.S(3) : warning A4045: missing END directive include "fft_neon.S" . . . [6/9] ASM obj/third_party/ffmpeg/ffmpeg_internal/mpegaudiodsp_neon.obj FAILED: obj/third_party/ffmpeg/ffmpeg_internal/mpegaudiodsp_neon.obj D:/Work/Chromium_FFmpeg/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py asm-wrapper environment.arm64 armasm64.exe /Foobj/third_party/ffmpeg/ffmpeg_internal/mpegaudiodsp_neon.obj ../../third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S Microsoft (R) ARM Macro Assembler Version 14.16.26926.0 for 64 bits D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(1) : error A2003: improper line syntax: / /* D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(2) : error A2079: improper line syntax; symbol expected * Copyright (c) 2014 Janne Grunau D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(3) : error A2079: improper line syntax; symbol expected * D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(4) : error A2079: improper line syntax; symbol expected * This file is part of FFmpeg. D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(5) : error A2079: improper line syntax; symbol expected * D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(6) : error A2079: improper line syntax; symbol expected * FFmpeg is free software; you can redistribute it and/or D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(7) : error A2079: improper line syntax; symbol expected * modify it under the terms of the GNU Lesser General Public D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(8) : error A2079: improper line syntax; symbol expected * License as published by the Free Software Foundation; either D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(9) : error A2079: improper line syntax; symbol expected * version 2.1 of the License, or (at your option) any later version. D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(10) : error A2079: improper line syntax; symbol expected * D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(11) : error A2079: improper line syntax; symbol expected * FFmpeg is distributed in the hope that it will be useful, D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(12) : error A2079: improper line syntax; symbol expected * but WITHOUT ANY WARRANTY; without even the implied warranty of D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(13) : error A2079: improper line syntax; symbol expected * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(14) : error A2079: improper line syntax; symbol expected * Lesser General Public License for more details. D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(15) : error A2079: improper line syntax; symbol expected * D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(16) : error A2079: improper line syntax; symbol expected * You should have received a copy of the GNU Lesser General Public D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(17) : error A2079: improper line syntax; symbol expected * License along with FFmpeg; if not, write to the Free Software D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(18) : error A2079: improper line syntax; symbol expected * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(19) : error A2079: improper line syntax; symbol expected */ D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(21) : error A2230: Illegal preprocessor directive; only "#line [filename]" is recognized include "libavutil/aarch64/asm.S" D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(23) : error A2230: Illegal preprocessor directive; only "#line [filename]" is recognized define FRAC_BITS 23 // fractional bits for sb_samples and dct D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(24) : error A2230: Illegal preprocessor directive; only "#line [filename]" is recognized define WFRAC_BITS 16 // fractional bits for window D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(25) : error A2230: Illegal preprocessor directive; only "#line [filename]" is recognized define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15) D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(27) : error A2034: unknown opcode: tbl_rev128_s const tbl_rev128_s, align=4 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(28) : error A2034: unknown opcode: . .byte 12, 13, 14, 15 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(29) : error A2034: unknown opcode: . .byte 8, 9, 10, 11 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(30) : error A2034: unknown opcode: . .byte 4, 5, 6, 7 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(31) : error A2034: unknown opcode: . .byte 0, 1, 2, 3 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(34) : error A2003: improper line syntax: . .macro apply_window type, st D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(35) : error A2034: unknown opcode: ff_mpadsp_apply_window_ function ff_mpadsp_apply_window_\type()_neon, export=1 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(42) : error A2034: unknown opcode: movrel movrel x15, tbl_rev128_s D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(44) : error A2003: improper line syntax: . .ifc \type, fixed D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(46) : error A2003: improper line syntax: . .else D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(48) : error A2003: improper line syntax: . .endif D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(53) : error A2173: syntax error in expression sub x5, x5, x4 // samples2 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(53) : error A2003: improper line syntax: Trouble parsing operands sub x5, x5, x4 // samples2 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(54) : error A2173: syntax error in expression neg x13, x4 // -incr D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(54) : error A2003: improper line syntax: Trouble parsing operands neg x13, x4 // -incr D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(56) : error A2003: improper line syntax: . .ifc \type, fixed D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(57) : error A2173: syntax error in expression ld1r {v16.2s}, [x2] // dither_state D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(57) : error A2003: improper line syntax: Trouble parsing operands ld1r {v16.2s}, [x2] // dither_state D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(60) : error A2061: illegal expression type; expected absolute numeric movi v30.2d, #(1<error A2034: unknown opcode: MLA2 MLA2 v17, v2, v0 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(93) : error A2034: unknown opcode: MLS2 MLS2 v19, v3, v6 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(95) : error A2034: unknown opcode: MLS2 MLS2 v17, v4, v7 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(97) : error A2034: unknown opcode: MLS2 MLS2 v19, v5, v1 D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(98) : error A2034: unknown opcode: . b.gt 2b D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(101) : error A2173: syntax error in expression sub x10, x10, #64<<5 // 64 * 8 * sizeof(int32_t) D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(101) : error A2003: improper line syntax: Trouble parsing operands sub x10, x10, #64<<5 // 64 * 8 * sizeof(int32_t) D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(103) : error A2003: improper line syntax: . .ifc \type, fixed D:\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(105) : error A2034: unknown opcode: ext ext v28.16b, v29.16b, v28.16b, #8 . . .

1

There are 1 best solutions below

0
On

I believe FFmpeg is working for Linux/Aarch64 configuration (probably using GNU assembler) already in which case the same assembly code should also work for Microsoft ARM Macro Assembler as well.

The Microsoft Arm Assembler uses a different syntax to the GNU Assembler, similar but not quite the same as the syntax used by armasm. They are not compatible.