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

ARMv6, On compiling string.cc: Error: selected processor does not support `yield' in ARM mode #44357

Closed
skythe83 opened this issue Aug 23, 2022 · 8 comments
Labels
arm Issues and PRs related to the ARM platform.

Comments

@skythe83
Copy link

skythe83 commented Aug 23, 2022

Version

18.7.0

Platform

Linux pi 5.15.56+ #1575 Fri Jul 22 20:26:40 BST 2022 armv6l GNU/Linux

Subsystem

string

What steps will reproduce the bug?

Unpack the source file to /root/temp/node-v18.7.0, cd node-v18.7.0/test and execute the following excerpt from the make process (you might actually have to make the whole thing once up to the error, which takes 2 days, afterwards the line can be repeated on its own):

g++ -o /root/temp/node-v18.7.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/objects/string.o ../deps/v8/src/objects/string.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_HAS_QUIC' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DV8_TARGET_ARCH_ARM' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.9"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_SNAPSHOT_COMPRESSION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_SCRIPTORMODULE_LEGACY_LIFETIME' '-DV8_ADVANCED_BIGINT_ALGORITHMS' '-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/root/temp/node-v18.7.0/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/root/temp/node-v18.7.0/out/Release/obj/gen -I/root/temp/node-v18.7.0/out/Release/obj/gen/generate-bytecode-output-root -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common -I../deps/v8/third_party/zlib -I../deps/v8/third_party/zlib/google  -pthread -Wno-unused-parameter -Wno-return-type -fno-strict-aliasing -mfloat-abi=hard -marm -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF /root/temp/node-v18.7.0/out/Release/.deps//root/temp/node-v18.7.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/objects/string.o.d.raw   -c

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

No response

What is the expected behavior?

Module compiles

What do you see instead?

g++ -o /root/temp/node-v18.7.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/objects/string.o ../deps/v8/src/objects/string.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_HAS_QUIC' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DV8_TARGET_ARCH_ARM' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.9"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_SNAPSHOT_COMPRESSION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_SCRIPTORMODULE_LEGACY_LIFETIME' '-DV8_ADVANCED_BIGINT_ALGORITHMS' '-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/root/temp/node-v18.7.0/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/root/temp/node-v18.7.0/out/Release/obj/gen -I/root/temp/node-v18.7.0/out/Release/obj/gen/generate-bytecode-output-root -I../deps/icu-small/source/i18n -I../deps/icu-small/source/common -I../deps/v8/third_party/zlib -I../deps/v8/third_party/zlib/google  -pthread -Wno-unused-parameter -Wno-return-type -fno-strict-aliasing -mfloat-abi=hard -marm -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF /root/temp/node-v18.7.0/out/Release/.deps//root/temp/node-v18.7.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/objects/string.o.d.raw   -c
In file included from ../deps/v8/src/objects/string.cc:28:
../deps/v8/src/strings/string-stream.h: In member function ‘void v8::internal::String::PrintUC16(v8::internal::StringStream*, int, int)’:
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:166:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  166 |     Add(format, base::ArrayVector(elems));
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:166:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h: In member function ‘void v8::internal::String::StringShortPrint(v8::internal::StringStream*)’:
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:166:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  166 |     Add(format, base::ArrayVector(elems));
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:166:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
  155 |     Add(format, base::Vector<FmtElm>());
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/v8/src/strings/string-stream.h:155:8: note: parameter passing for argument of type ‘v8::base::Vector<v8::internal::StringStream::FmtElm>’ changed in GCC 7.1
/tmp/ccUTz9KM.s: Assembler messages:
/tmp/ccUTz9KM.s:1868: Error: selected processor does not support `yield' in ARM mode
/tmp/ccUTz9KM.s:2052: Error: selected processor does not support `yield' in ARM mode

Additional information

# cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 797.66
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2835
Revision        : 000e
Serial          : 00000000b73adb7e
Model           : Raspberry Pi Model B Rev 2
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/10/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Raspbian 10.2.1-6+rpi1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Raspbian 10.2.1-6+rpi1)
# cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
@skythe83 skythe83 changed the title ARMv6: On compiling string.cc, Error: selected processor does not support `yield' in ARM mode ARMv6, On compiling string.cc: Error: selected processor does not support `yield' in ARM mode Aug 23, 2022
@VoltrexKeyva VoltrexKeyva added the arm Issues and PRs related to the ARM platform. label Aug 23, 2022
@bnoordhuis
Copy link
Member

Node.js hasn't supported ARMv6 since, I don't know, 2013 or 2014. You should target ARMv7.

@skythe83
Copy link
Author

skythe83 commented Aug 23, 2022

Node.js hasn't supported ARMv6 since, I don't know, 2013 or 2014. You should target ARMv7.

I did consider that, even though my PI 1 B+ is doing a great job and is more than capable of handling node-red, mqtt, pi-hole, webserver and other small things.
If you look at the prices of RasPIs, you will notice that all of them have doubled or tripled in price since release. Pi Zero 2 even went from 17 EUR to 90 EUR. I'm off cheaper converting an old android phone with lineageos + linux deploy into a home server, than buying a raspi at this point in time.
All in all, nodejs is the only thing that will not compile / update on this device, and if I understood correctly 'yield' has got to do with multi-processor systems, so I assume it's easy to make an exception for ARMv6 and other single processor systems.

I'm also not a fan of putting a perfectly working device into trash, because some exotic & avoidable c++ code will not compile.

@bnoordhuis
Copy link
Member

You can find unofficial builds for armv6l here but they're unsupported, i.e., you're on your own when stuff breaks. (Same goes for building from source.)

@kapouer
Copy link
Contributor

kapouer commented Aug 29, 2022

To target the minimal arm version supported by v8 (armv6k + vfpv2) one has to

  • set arm_version = 6 in configure.py
  • add -march=armv6k -mfpu=vfpv2 to CFLAGS, CPPFLAGS

@skythe83
Copy link
Author

To target the minimal arm version supported by v8 (armv6k + vfpv2) one has to

  • set arm_version = 6 in configure.py
  • add -march=armv6k -mfpu=vfpv2 to CFLAGS, CPPFLAGS

Wow thanks, I will try this soon. I'm still compiling the LTS v16 since 4 days.

@kapouer
Copy link
Contributor

kapouer commented Aug 29, 2022

Maybe this issue should be reopened and a PR made to close it. After all, if node runs on armv6k/vfp2 it's too bad not to update configure.py to allow it.

@skythe83
Copy link
Author

I agree, for me experimental status means that it is at least compiling in most versions rather than none. Maybe let me test if it compiles and is able to run node-red with your settings, then reopening makes more sense. It will take me at least 5-10 more days to finish compiling both 16.x and 18.x

@kapouer
Copy link
Contributor

kapouer commented Sep 2, 2022

For the record, debian has now an armel version of nodejs 18 for those processors that support armv6k, vfpv2.
It passes at least the test-ci-js suite, and we'll track regressions against the other modules as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform.
Projects
None yet
Development

No branches or pull requests

4 participants