build fails on ARM7 ---> asm-primitives.cpp.o
ENVIRONMENT: RPi3, ARM Slackware 14.2 (4.4.16-v7+), x265 2.0
BUILD ERROR: [ 1%] Building CXX object common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o Error in `/usr/bin/c++': double free or corruption (!prev): 0x015a8b50 /bin/sh: line 1: 1095 Aborted /usr/bin/c++ -DEXPORT_C_API=1 -DHAVE_ARMV6=1 -DHAVE_INT_TYPES_H=1 -DHAVE_NEON -DHIGH_BIT_DEPTH=0 -DX265_ARCH_ARM=1 -DX265_DEPTH=8 -DX265_NS=x265 -D__STDC_LIMIT_MACROS=1 -I/tmp/SBo/multicoreware-x265-960c9991d0dc/source/. -I/tmp/SBo/multicoreware-x265-960c9991d0dc/source/common -I/tmp/SBo/multicoreware-x265-960c9991d0dc/source/encoder -I/tmp/SBo/multicoreware-x265-960c9991d0dc/build/linux -O2 -O3 -DNDEBUG -Wall -Wextra -Wshadow -std=gnu++98 -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC -Wno-array-bounds -ffast-math -fno-exceptions -o CMakeFiles/common.dir/arm/asm-primitives.cpp.o -c /tmp/SBo/multicoreware-x265-960c9991d0dc/source/common/arm/asm-primitives.cpp make[2]: [common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o] Error 134 common/CMakeFiles/common.dir/build.make:62: recipe for target 'common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o' failed make[1]: [common/CMakeFiles/common.dir/all] Error 2 CMakeFiles/Makefile2:317: recipe for target 'common/CMakeFiles/common.dir/all' failed make: *** [all] Error 2 Makefile:127: recipe for target 'all' failed
Comments (8)
-
Account Deleted -
Account Deactivated Can you please give details on what your platform is? I am assuming that you are trying a native compilation?
-
Account Deleted Hardware: Raspberry Pi 3
OS: Slackware ARM 14.2
Kernel: 4.4.16-v7+
Building with a SlackBuild script: https://slackbuilds.org/repository/14.2/multimedia/x265/?search=x265
-
Account Deactivated We've only tested builds of the ARM on ubuntu 14.04 so I don't have any experience with slackware to comment on what may be causing this. Looks like the slackbuild script that you shared is maintained by someone else; perhaps try with them?
-
similar problem on Raspbian Jessie:
Scanning dependencies of target common [ 1%] Building CXX object common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o Error in `/usr/bin/c++': double free or corruption (top): 0x015c17f0 Aborted common/CMakeFiles/common.dir/build.make:54: recipe for target 'common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o' failed make[2]: [common/CMakeFiles/common.dir/arm/asm-primitives.cpp.o] Error 134 CMakeFiles/Makefile2:294: recipe for target 'common/CMakeFiles/common.dir/all' failed make[1]: [common/CMakeFiles/common.dir/all] Error 2 Makefile:117: recipe for target 'all' failed make: *** [all] Error 2
Raspi 3 with: CPU: ARMv7 Processor rev 4 (v7l)
OS: 4.4.17-v7+ #901 SMP Fri Aug 12 17:57:27 BST 2016 armv7l GNU/Linux
This might be a compiler bug - look at:
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=139091
They say:
The code that gcc uses to determine what native means doesn't recognise the a53 and any cpu it doesn't recognise causes the crash on ARM platforms.
So - if this is still not fixed, -march=native or -mcpu=native could be the problem.
For Raspberry 3 these compiler options are suggested:
-mcpu=cortex-a53 -mfpu=neon-vfpv4
--
--
Ok, got it!
The problem is -mcpu=native - the compiler doesn't like that option:
gcc -mcpu=native -E - < /dev/null
Error in `gcc': double free or corruption (top): 0x0013bc30
Abgebrochen
Looks like the bug is still unfixed...I'm using:
c++ (Raspbian 4.9.2-10) 4.9.2
I changed this line of CMakeLists.txt:
set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
to:
set(ARM_ARGS -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-vfpv4 -marm -fPIC)
... and voilĂ - it works...
-
Account Deactivated @arfonrg - could you try by changing -mcpu=native to the correct version of cortex on your board? Maybe that will help?
-
Account Deactivated Did this work for you, or are you still having trouble?
-
Raspberry Pi 3 B + with Slackware 14.2 do the following:
Download slackbuild (https://slackbuilds.org/) x265.tar.gz
# tar zxf x265.tar.gz
# cd x265
# hg clone https://bitbucket.org/multicoreware/x265
# cd x265
# hg update 11991
# vi ./source/CMakeLists.txtif (ARM AND CROSS_COMPILE_ARM)
set (ARM_ARGS -march = armv6 -mfloat-abi = soft -mfpu = vfp -marm -fPIC)
elseif (ARM)
find_package (Neon)
if (CPU_HAS_NEON)
# modify (native=> cortex-a53, hard=> soft neon=> neon-vfpv4)
# set (ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
set (ARM_ARGS -mcpu=cortex-a53 -mfloat-abi=soft -mfpu=neon-vfpv4 -marm -fPIC)
add_definitions (-DHAVE_NEON)
else ()
set (ARM_ARGS -mcpu = native -mfloat-abi = hard -mfpu = vfp -marm)
endif ()
# cd ../
# mv x265 multicoreware-x265-72188bd2f034 (corroborate the name with the slackbuild)
# tar -c multicoreware-x265-72188bd2f034 / | bzip2> 3.0.tar.bz2 (in case of being version 3)
# ./x265.SlackBuild - Log in to comment
Let me reformat the errors-