[x264-devel] [PATCH] - Fix for failing build on Aarch64
libx286onaarch64 at 3space.xyz
libx286onaarch64 at 3space.xyz
Mon Apr 6 15:51:37 UTC 2020
Hi there,
I am new to the list, so pardon me if I make any faux-pas. I ran
into an issue while building libx264 on Aarch64 (in my case,
SlackwareARM for Aarch64). The build would fail during the config stage
(part of a larger build, VICE in this case), and would end here:
[...]
Making all in vc_solution
Making all in libx264
no NEON support, try adding -mfpu=neon to CFLAGS
If you really want to run on such a CPU, configure with --disable-asm.
Makefile:3: config.mak: No such file or directory
make[4]: *** [Makefile:433: config.mak] Error 1
make[3]: *** [Makefile:789: all-recursive] Error 1
make[2]: *** [Makefile:2018: all-recursive] Error 1
make[1]: *** [Makefile:1773: all] Error 2
make: *** [Makefile:508: all-recursive] Error 1
I searched around and found others had run into this error, but I could
find nobody that had come up with a good solution. Most were trying to
figure out what NEON and/or --disable-asm had to do with this. I think
those warnings are a red herring of sorts.
There is a typo in the configure script for libx264 that causes the
build to stop, and the error message is a bit misleading. Looking at
config.log, I saw it complaining aobut the "-arch arm64" bit, after
which it throws the suggestion about NEON. This is only visible in the
config.log, it does not get printed out to the screen at all, as you can
see.
Switching that piece to "-march armv8-a" (as suggested in one iteration
of config.log as I was debugging this) seemed to do the trick.
Oh, and config.log also complained that "-mpfu=neon" was an unrecognized
option, so I removed that as well:
" gcc: error: unrecognized command line option â-mfpu=neonâ "
The attached patch to the file in libx264/configure allows the build to
complete without the above warnings on Aarch64. Things seem to run fine
as well I see no specific errors related to libx264 while running VICE.
YMMV.
--- configure 2020-04-05 15:32:41.969332210 -0600
+++ configure.fixed 2020-04-05 21:09:58.516772130 -0600
@@ -830,7 +830,7 @@
if [ $asm = auto -a $ARCH = AARCH64 ] ; then
# set flags so neon is built by default
- echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' ||
CFLAGS="$CFLAGS -arch arm64 -mfpu=neon"
+ echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' ||
CFLAGS="$CFLAGS -march=armv8-a"
if cc_check '' '' '__asm__("cmeq v0.8h, v0.8h, #0");' ; then
define HAVE_NEON
ASFLAGS="$ASFLAGS -c"
I hope this possible helps someone else with this issue.
thank you very much,
- shelldweller
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libx264_on_aarch64.patch
Type: text/x-diff
Size: 530 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20200406/4900c41c/attachment.patch>
More information about the x264-devel
mailing list