Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on Raspberry Pi 4 #34202

Closed
YuGiOhJCJ opened this issue Jul 4, 2020 · 3 comments
Closed

Build failure on Raspberry Pi 4 #34202

YuGiOhJCJ opened this issue Jul 4, 2020 · 3 comments
Labels
build Issues and PRs related to build files or the CI. v8 engine Issues and PRs related to the V8 dependency.

Comments

@YuGiOhJCJ
Copy link

  • Version: node-v12.18.2.tar.xz
  • Platform: Linux rpi4 5.4.47-v7l+ #1322 SMP Wed Jun 17 17:58:52 BST 2020 armv7l BCM2711 GNU/Linux
  • Subsystem: ...

What steps will reproduce the bug?

$ ./configure --prefix=/usr --shared-zlib --without-ssl
$ make CFLAGS="-O2 -march=armv8-a -mtune=cortex-a53 -mfloat-abi=softfp -mfpu=neon-vfpv4" CXXFLAGS="-O2 -march=armv8-a -mtune=cortex-a53 -mfloat-abi=softfp -mfpu=neon-vfpv4"
[...]
g++ -o /tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o ../deps/v8/src/codegen/arm/assembler-arm.cc '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DV8_EMBEDDER_STRING="-node.39"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_MINOR_MC' '-DV8_INTL_SUPPORT' '-DV8_USE_SNAPSHOT' '-DV8_CONCURRENT_MARKING' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_EMBEDDED_BUILTINS' '-DV8_USE_SIPHASH' '-DDISABLE_UNTRUSTED_CODE_MITIGATIONS' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/v8 -I../deps/v8/include -I/tmp/build/firefox/node-v12.18.2/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/tmp/build/firefox/node-v12.18.2/out/Release/obj/gen/torque-output-root -I/tmp/build/firefox/node-v12.18.2/out/Release/obj/gen/generate-bytecode-output-root -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common  -pthread -Wno-unused-parameter -Wno-return-type -fno-strict-aliasing -mfpu=vfp -marm -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF /tmp/build/firefox/node-v12.18.2/out/Release/.deps//tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o.d.raw   -c
../deps/v8/src/codegen/arm/assembler-arm.cc:177:2: error: #error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
 #error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
  ^~~~~
tools/v8_gypfiles/v8_base_without_compiler.target.mk:636: recipe for target '/tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o' failed
make[1]: *** [/tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o] Error 1
rm 6908e42a15dc3bb9aee07f6cbf9fe349bac7daed.intermediate 3bc3356d0f5836f07b2a45cd6a026ed30cd8e758.intermediate
Makefile:101: recipe for target 'node' failed
make: *** [node] Error 2

How often does it reproduce? Is there a required condition?

It reproduces always.
The condition is to use the Raspberry Pi 4 machine with the Slackware ARM 14.2 operating system.

What is the expected behavior?

No error while building.

What do you see instead?

An error while building.

Additional information

Slackware ARM 14.2 is a soft-float operating system whereas the Raspberry Pi 4 is a hard-float capable machine.

@addaleax addaleax added build Issues and PRs related to build files or the CI. v8 engine Issues and PRs related to the V8 dependency. labels Jul 4, 2020
@addaleax
Copy link
Member

addaleax commented Jul 4, 2020

I’m not an exert, but guessing from the error message, I assume that V8 doesn’t like the mismatch between -march=armv8-a -mfpu=neon-fvpv4 and -mfloat-abi=softfp? Can you try dropping the latter?

@YuGiOhJCJ
Copy link
Author

YuGiOhJCJ commented Jul 6, 2020

I’m not an exert, but guessing from the error message, I assume that V8 doesn’t like the mismatch between -march=armv8-a -mfpu=neon-fvpv4 and -mfloat-abi=softfp? Can you try dropping the latter?

I tried without -mfloat-abi=softfp:

$ ./configure --prefix=/usr --shared-zlib --without-ssl
$ make CFLAGS="-O2 -march=armv8-a -mtune=cortex-a53 -mfpu=neon-vfpv4" CXXFLAGS="-O2 -march=armv8-a -mtune=cortex-a53 -mfpu=neon-vfpv4"
[...]
g++ -o /tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o ../deps/v8/src/codegen/arm/assembler-arm.cc '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DV8_EMBEDDER_STRING="-node.39"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_MINOR_MC' '-DV8_INTL_SUPPORT' '-DV8_USE_SNAPSHOT' '-DV8_CONCURRENT_MARKING' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_EMBEDDED_BUILTINS' '-DV8_USE_SIPHASH' '-DDISABLE_UNTRUSTED_CODE_MITIGATIONS' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' '-DUCONFIG_NO_SERVICE=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=1' '-DUCONFIG_NO_BREAK_ITERATION=0' -I../deps/v8 -I../deps/v8/include -I/tmp/build/firefox/node-v12.18.2/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/tmp/build/firefox/node-v12.18.2/out/Release/obj/gen/torque-output-root -I/tmp/build/firefox/node-v12.18.2/out/Release/obj/gen/generate-bytecode-output-root -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common  -pthread -Wno-unused-parameter -Wno-return-type -fno-strict-aliasing -mfpu=vfp -marm -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++1y -MMD -MF /tmp/build/firefox/node-v12.18.2/out/Release/.deps//tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o.d.raw   -c
../deps/v8/src/codegen/arm/assembler-arm.cc:177:2: error: #error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
 #error "CAN_USE_ARMV7_INSTRUCTIONS should match CAN_USE_VFP3_INSTRUCTIONS"
  ^~~~~
tools/v8_gypfiles/v8_base_without_compiler.target.mk:636: recipe for target '/tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o' failed
make[1]: *** [/tmp/build/firefox/node-v12.18.2/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/codegen/arm/assembler-arm.o] Error 1
rm 6908e42a15dc3bb9aee07f6cbf9fe349bac7daed.intermediate 3bc3356d0f5836f07b2a45cd6a026ed30cd8e758.intermediate
Makefile:101: recipe for target 'node' failed
make: *** [node] Error 2

However, I found this similar problem with a fix: openwrt/packages#6064
The idea is to pass some additional ARM specific options to the configure script, like that:

$ ./configure --prefix=/usr --shared-zlib --without-ssl --dest-cpu=arm --with-arm-float-abi=softfp --with-arm-fpu=neon
$ make CFLAGS="-O2 -march=armv8-a -mtune=cortex-a53 -mfloat-abi=softfp -mfpu=neon-vfpv4" CXXFLAGS="-O2 -march=armv8-a -mtune=cortex-a53 -mfloat-abi=softfp -mfpu=neon-vfpv4"
[...]

This time, the build is a success!
So, I really need to use the --dest-cpu=arm --with-arm-float-abi=softfp --with-arm-fpu=neon options for the configure script.
It is not usual to require that in a build system.
Usually, when I build a program for ARM, only the CFLAGS and CXXFLAGS variable values have to be changed.
It is a bit redundant but I guess that there is a reason to force using these options.

@bnoordhuis
Copy link
Member

It sounds like this is resolved? I'll go ahead and close out the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

3 participants