Opened by Jose V Beneyto - 2013-11-19
Last edited by Victor Martinez - 2017-11-26
FS#65 - chromium: failed to build on efikamx devices
I only tried with optimized CFLAGS="-O2 -pipe -mfloat-abi=hard -march=armv7-a -mfpu=vfpv3-d16", maybe generic flags could work but anyway we should fix that.
When developing the first overlay port for chromium I found a similar problem with neon when compiling webrtc/common_audio component and I created a patch[1]. This was the error log[2].
Now the problem sounds similar as reported here[3]. This is the current error log[4]. So we can try to create a patch for it.
[2] - error log for webrtc/common_audio:
cc '-DANGLE_DX11' '-DWEBRTC_SVNREVISION="Unavailable(issue687)"' '-D_FILE_OFFSET_BITS=64' '-DDISABLE_NACL' '-DCHROMIUM_BUILD' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_NSS=1' '-DUSE_X11=1' '-DENABLE_ONE_CLICK_SIGNIN' '-DGTK_DISABLE_SINGLE_INCLUDES=1' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DUSE_PROPRIETARY_CODECS' '-DENABLE_PEPPER_CDMS' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DENABLE_GPU=1' '-DENABLE_EGLIMAGE=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_BACKGROUND=1' '-DENABLE_AUTOMATION=1' '-DENABLE_GOOGLE_NOW=1' '-DENABLE_FULL_PRINTING=1' '-DENABLE_PRINTING=1' '-DENABLE_SPELLCHECK=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DENABLE_MANAGED_USERS=1' '-DENABLE_MDNS=1' '-DWEBRTC_CHROMIUM_BUILD' '-DWEBRTC_ARCH_ARM' '-DWEBRTC_ARCH_ARM_V7' '-DWEBRTC_DETECT_ARM_NEON' '-DWEBRTC_LINUX' '-D__STDC_CONSTANT_MACROS' '-D__STDC_FORMAT_MACROS' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0' '-D_FORTIFY_SOURCE=2' -Ithird_party/webrtc -Ithird_party -I. -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-exceptions -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -mfpu=neon -flax-vector-conversions -march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mthumb -O2 -fno-ident -fdata-sections -ffunction-sections -O2 -pipe -mfloat-abi=hard -march=armv7-a -I/usr/include/nspr -MMD -MF out/Release/.deps/out/Release/obj.target/common_audio_neon/third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.o.d.raw -O2 -pipe -mfloat-abi=hard -march=armv7-a -mfpu=vfpv3-d16 -I/usr/include/nspr -c -o out/Release/obj.target/common_audio_neon/third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.o third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S: Assembler messages:
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:51: Error: selected FPU does not support instruction – `vmov.i32 q9,#0'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:52: Error: selected FPU does not support instruction – `vmov.i32 q14,#0'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:62: Error: selected processor does not support ARM mode `vmull.s16 q12,d20,d22'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:63: Error: selected processor does not support ARM mode `vmull.s16 q13,d21,d23'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:64: Error: selected processor does not support ARM mode `vpadal.s32 q9,q12'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:65: Error: selected processor does not support ARM mode `vpadal.s32 q14,q13'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:84: Error: selected FPU does not support instruction – `vadd.i64 d18,d19'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:85: Error: selected FPU does not support instruction – `vadd.i64 d28,d29'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:86: Error: selected FPU does not support instruction – `vadd.i64 d18,d28'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:89: Error: selected FPU does not support instruction – `vadd.i64 d17,d18'
third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.S:90: Error: selected processor does not support ARM mode `vshl.s64 d17,d16'
make: * [out/Release/obj.target/common_audio_neon/third_party/webrtc/common_audio/signal_processing/cross_correlation_neon.o] Error 1
make: * Waiting for unfinished jobs....
In file included from third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:16:0:
/usr/lib/gcc/arm-unknown-linux-gnueabihf/4.7.3/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc: In static member function 'static float webrtc::SincResampler::Convolve_NEON(const float*, const float*, const float*, double)':
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:23:3: error: 'float32x4_t' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:23:15: error: expected ';' before 'm_input'
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:24:15: error: expected ';' before 'm_sums1'
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:25:15: error: expected ';' before 'm_sums2'
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:29:5: error: 'm_input' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:29:34: error: 'vld1q_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:31:5: error: 'm_sums1' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:31:56: error: 'vmlaq_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:33:5: error: 'm_sums2' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:38:3: error: 'm_sums1' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:39:71: error: 'vmovq_n_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:39:72: error: 'vmulq_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:40:7: error: 'm_sums2' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:40:56: error: 'vmlaq_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:43:3: error: 'float32x2_t' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:43:15: error: expected ';' before 'm_half'
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:44:34: error: 'm_half' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:44:48: error: 'vpadd_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:44:52: error: 'vget_lane_f32' was not declared in this scope
third_party/webrtc/common_audio/resampler/sinc_resampler_neon.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [out/Release/obj.target/common_audio_neon/third_party/webrtc/common_audio/resampler/sinc_resampler_neon.o] Error 1
[3] - https://code.google.com/p/chromium/issues/detail?id=154107
[4] - error log for webrtc/commom_audio:
g++ '-DANGLE_DX11' '-D_FILE_OFFSET_BITS=64' '-DDISABLE_NACL' '-DCHROMIUM_BUILD' '-DUSE_DEFAULT_RENDER_THEME=1' '-DUSE_LIBJPEG_TURBO=1' '-DUSE_NSS=1' '-DUSE_X11=1' '-DENABLE_ONE_CLICK_SIGNIN' '-DGTK_DISABLE_SINGLE_INCLUDES=1' '-DENABLE_REMOTING=1' '-DENABLE_WEBRTC=1' '-DUSE_PROPRIETARY_CODECS' '-DENABLE_PEPPER_CDMS' '-DENABLE_CONFIGURATION_POLICY' '-DENABLE_INPUT_SPEECH' '-DENABLE_NOTIFICATIONS' '-DENABLE_GPU=1' '-DENABLE_EGLIMAGE=1' '-DENABLE_TASK_MANAGER=1' '-DENABLE_EXTENSIONS=1' '-DENABLE_PLUGIN_INSTALLATION=1' '-DENABLE_PLUGINS=1' '-DENABLE_SESSION_SERVICE=1' '-DENABLE_THEMES=1' '-DENABLE_BACKGROUND=1' '-DENABLE_AUTOMATION=1' '-DENABLE_GOOGLE_NOW=1' '-DENABLE_FULL_PRINTING=1' '-DENABLE_PRINTING=1' '-DENABLE_SPELLCHECK=1' '-DENABLE_CAPTIVE_PORTAL_DETECTION=1' '-DENABLE_MANAGED_USERS=1' '-DENABLE_MDNS=1' '-DGOOGLE_PROTOBUF_NO_RTTI' '-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER' '-DNDEBUG' '-DNVALGRIND' '-DDYNAMIC_ANNOTATIONS_ENABLED=0' -Ithird_party/protobuf -Ithird_party/protobuf/src -fstack-protector --param=ssp-buffer-size=4 -pthread -fno-exceptions -fno-strict-aliasing -Wno-unused-parameter -Wno-mis...skipping...
aecm_core.c:(.text.WebRtcAecm_InitCore+0x212): undefined reference to `WebRtc_GetCPUFeaturesARM'
aecm_core.c:(.text.WebRtcAecm_InitCore+0x278): undefined reference to `WebRtcAecm_StoreAdaptiveChannelNeon'
aecm_core.c:(.text.WebRtcAecm_InitCore+0x27c): undefined reference to `WebRtcAecm_ResetAdaptiveChannelNeon'
aecm_core.c:(.text.WebRtcAecm_InitCore+0x280): undefined reference to `WebRtcAecm_CalcLinearEnergiesNeon'
out/Release/obj.target/third_party/webrtc/modules/../../../audio_processing/third_party/webrtc/modules/audio_processing/aecm/aecm_core.o: In function `WebRtcAec
m_ProcessBlock':
aecm_core.c:(.text.WebRtcAecm_ProcessBlock+0x990): undefined reference to `WebRtcAecm_kSqrtHanning'
out/Release/obj.target/third_party/webrtc/common_audio/../../../common_audio/third_party/webrtc/common_audio/resampler/sinc_resampler.o: In function `webrtc::Si
ncResampler::InitializeCPUSpecificFeatures()':
sinc_resampler.cc:(.text._ZN6webrtc13SincResampler29InitializeCPUSpecificFeaturesEv+0x4): undefined reference to `WebRtc_GetCPUFeaturesARM'
sinc_resampler.cc:(.text._ZN6webrtc13SincResampler29InitializeCPUSpecificFeaturesEv+0x34): undefined reference to `webrtc::SincResampler::Convolve_NEON(float const*, float const*, float const*, double)'
out/Release/obj.target/third_party/webrtc/common_audio/../../../common_audio/third_party/webrtc/common_audio/signal_processing/spl_init.o: In function `InitFunctionPointers':
spl_init.c:(.text.InitFunctionPointers+0x2): undefined reference to `WebRtc_GetCPUFeaturesARM'
spl_init.c:(.text.InitFunctionPointers+0x18c): undefined reference to `WebRtcSpl_MaxAbsValueW16Neon'
spl_init.c:(.text.InitFunctionPointers+0x194): undefined reference to `WebRtcSpl_MaxAbsValueW32Neon'
spl_init.c:(.text.InitFunctionPointers+0x19c): undefined reference to `WebRtcSpl_MaxValueW16Neon'
spl_init.c:(.text.InitFunctionPointers+0x1a4): undefined reference to `WebRtcSpl_MaxValueW32Neon'
spl_init.c:(.text.InitFunctionPointers+0x1ac): undefined reference to `WebRtcSpl_MinValueW16Neon'
spl_init.c:(.text.InitFunctionPointers+0x1b4): undefined reference to `WebRtcSpl_MinValueW32Neon'
spl_init.c:(.text.InitFunctionPointers+0x1bc): undefined reference to `WebRtcSpl_CrossCorrelationNeon'
spl_init.c:(.text.InitFunctionPointers+0x1c4): undefined reference to `WebRtcSpl_DownsampleFastNeon'
spl_init.c:(.text.InitFunctionPointers+0x1cc): undefined reference to `WebRtcSpl_ScaleAndAddVectorsWithRoundNeon'
out/Release/obj.target/third_party/webrtc/modules/../../../iSACFix/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/isacfix.o: In function `WebRtcIsacfix_EncoderInit':
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x110): undefined reference to `WebRtc_GetCPUFeaturesARM'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1c8): undefined reference to `WebRtcIsacfix_AutocorrNeon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1cc): undefined reference to `WebRtcIsacfix_FilterMaLoopNeon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1d0): undefined reference to `WebRtcIsacfix_Spec2TimeNeon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1d4): undefined reference to `WebRtcIsacfix_Time2SpecNeon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1d8): undefined reference to `WebRtcIsacfix_CalculateResidualEnergyNeon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1dc): undefined reference to `WebRtcIsacfix_AllpassFilter2FixDec16Neon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1e0): undefined reference to `WebRtcIsacfix_MatrixProduct1Neon'
isacfix.c:(.text.WebRtcIsacfix_EncoderInit+0x1e4): undefined reference to `WebRtcIsacfix_MatrixProduct2Neon'
out/Release/obj.target/third_party/webrtc/modules/../../../iSACFix/third_party/webrtc/modules/audio_coding/codecs/isac/fix/source/transform.o: In function `WebRtcIsacfix_Time2SpecC':
transform.c:(.text.WebRtcIsacfix_Time2SpecC+0x320): undefined reference to `WebRtcIsacfix_kCosTab1'
transform.c:(.text.WebRtcIsacfix_Time2SpecC+0x324): undefined reference to `WebRtcIsac
We can also try the last development version for chromium instead of the stable one. This version should have merged last webrtc code where should be fixed.
I'll try to improve the Pkgfile to parse environment CFLAGS and assign those values to available gypi variables.
For now we can play with -Darm_arch, -Darm_tune, -Darm_fpu, ... directly in the Pkgfile, then if the build works we can start to improve the Pkgfile as I said.
This is the section from build/common.gypi:
This comment is also valid for ticket
FS#66, so I'll marked as related to this task.ARM flags should be detected by chromium, but the fact is that I have tried to don't use the sysroot value because we are not crosscompiling which is the default way for chromium
https://chromium.googlesource.com/native_client/pnacl-clang/+/upstream/master/test/Driver/arm-mfpu.c
From the link above:
RUN: %clang -target arm-linux-eabi %s -### -o %t.o 2>&1 \
RUN: | FileCheck –check-prefix=CHECK-DEFAULT %s
CHECK-DEFAULT-NOT: "-target-feature" "+vfp2"
CHECK-DEFAULT-NOT: "-target-feature" "+vfp3"
CHECK-DEFAULT-NOT: "-target-feature" "+d16"
CHECK-DEFAULT-NOT: "-target-feature" "+neon"
* By default they use all the target features, then if tests failed for a expecific fpu they assign the right flags.
symbol + for features they keep in flags
symbol - for features dropped from flags
The most importants for us are that:
RUN: %clang -target arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \
RUN: | FileCheck –check-prefix=CHECK-VFP3-D16 %s
RUN: %clang -target arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \
RUN: | FileCheck –check-prefix=CHECK-VFP3-D16 %s
CHECK-VFP3-D16: "-target-feature" "+vfp3"
CHECK-VFP3-D16: "-target-feature" "+d16"
CHECK-VFP3-D16: "-target-feature" "-neon" * if fpu=vfp3-d16 worked then neon is dissabled RUN: %clang -target arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \
RUN: | FileCheck –check-prefix=CHECK-VFP3 %s
RUN: %clang -target arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \
RUN: | FileCheck –check-prefix=CHECK-VFP3 %s
CHECK-VFP3: "-target-feature" "+vfp3"
CHECK-VFP3: "-target-feature" "-neon" * if fpu=vfpv3 worked then neon is dissabled RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
RUN: | FileCheck –check-prefix=CHECK-NEON %s
CHECK-NEON: "-target-feature" "+neon"
* if fpu=neon worked then neon is enabled
ATM we are using these flags from pkgmk.conf:
CFLAGS="-O2 -pipe -mfloat-abi=hard -march=armv7-a -mfpu=vfpv3-d16"
And on the other side for the efikamx we have:
$ grep Features /proc/cpuinfo
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
I tried some text to verify these cpu features:
$ cat > conftest.c « EOF int main(void) { return 0; }
EOF
$ gcc -o conftest conftest.c -Wall -mfpu=vfpv3
$ ./conftest
$ echo $?
0
$ readelf -A conftest | grep -v Tag_ABI
Attribute Section: aeabi
File Attributes
$ gcc -o conftest conftest.c -Wall -mfpu=vfpv3-d16
$ ./conftest
$ echo $?
0
$ readelf -A conftest | grep -v Tag_ABI
Attribute Section: aeabi
File Attributes
$ gcc -o conftest conftest.c -Wall -mfpu=neon
$ ./conftest
$ echo $?
0
$ readelf -A conftest | grep -v Tag_ABI
Attribute Section: aeabi
File Attributes
I'm wondering if -mfpu=vfpv3-d16 for our flags could be invalid, so in our /proc/cpuinfo is listed as vfpv3 only.
Maybe I'm wrong but IMHO we should use -mfpu=vfpv3 from our CFLAGS or try to use -mfpu=neon which also should be right.
Please if you have more info about the -d16 feature let me know ;D
When building the first times for chromium port on efikamx I remember that it failed with fpu sometimes and manually worked if I use -fpu=neon, so I'll try to build chromium with these gyp defines:
I hope this works :D
Currently, only the following flags are defined, for the ARM CPU Family:
from: http://docs.huihoo.com/android/ndk/r5/CPU-FEATURES.html