Would it be possible to have v8 for armv6z -> RaspberryPi 0[W]

109 views
Skip to first unread message

Gérard Vidal

unread,
Feb 2, 2022, 11:31:09 AM2/2/22
to v8-dev
Hi,
I am a newcommer here and please don't flame if the answer is somewhere in the galaxy. I googled a little bit but did not find anything recent on that topic.

I am using v8 and nodejs successfully on raspberriesPi armv7 an armv8, some year(s) ago I have been able to install properly a v8 and nodeJS on a PiZero  but it does not seem any more possible.
Is there somewhere a magic combination of compilation parameters that would pass thtough the tests and yields an operational binary from cross-compilation, or is there an hidden branch that did not incorporate the need of armv7 ressources, webassembly constraints and accept the combination armv6 +VFP (arm1176jzf-s configuration).

The PiZero is still on the market and it is a nice and usfull piece of hardware. Thanks in advance

Camillo Bruni

unread,
Feb 2, 2022, 12:48:20 PM2/2/22
to v8-...@googlegroups.com
Hi,

If I'm not mistaken, v8 on it's own supports armv6 + VFPv2.
You could try compiling d8 on your armv6 device (if you're patient):

gn args:

is_component_build = false
is_debug = false
target_os = "linux"
target_cpu = "arm"
v8_target_cpu = "arm"
arm_version = 6

We currently have a misconfiguration for the latest chrome version that doesn't compile under armv6 (and only under armv6k), so you would have to change
 armv6 to armv6k in build/config/arm.gni.

I currently don't have an arm device to compile on, so I get some linker errors, which hopefully are resolved when compiling in the right environment.

cheers,
Camillo

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/d78ab39a-4614-42e3-b3ec-118af492f62bn%40googlegroups.com.
Camillo Bruni | Software Engineer, V8 | Google Germany GmbH | Erika-Mann Str. 33, 80636 München 

Registergericht und -nummer: Hamburg, HRB 86891 | Sitz der Gesellschaft: Hamburg | Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Diese E-Mail ist vertraulich. Falls Ssie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.  This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

Gérard Vidal

unread,
Feb 4, 2022, 2:18:38 AM2/4/22
to v8-dev
Many thanks for your quick and precise answer.
I'll try the parameters you have proposed but I am not sure that v8 supports armv6 out of the box because the error  when compilation  fails  send messages about some assembler instructions that are not  compatible with the processor (I am sorry, I have erased all my traces I'll compile again and provide them ASAP).
There is also another problem deriving from the fact that  v8 considers that if  vfp is choosen the architecture is armv7 which is untrue for armv6z (the PiZero processor). If the test is removed the compilation continues

You are right about the necessary patience to compile on a PiZero, I have built a toolchain  to compile on my desktop which is much more convenient. I have tested my toolchain with the classic "hello world" that works on the PiZero

From your message I undertand that giving precise cpu target armv6z will not work  and the message on assembler instructions not compatible may arise for the same reason, am I right ?
I'll run another compilation and provide decent information.

best

Camillo Bruni

unread,
Feb 7, 2022, 2:25:31 PM2/7/22
to v8-...@googlegroups.com
On Fri, 4 Feb 2022 at 08:18, Gérard Vidal <gerard....@gmail.com> wrote:
Many thanks for your quick and precise answer.
I'll try the parameters you have proposed but I am not sure that v8 supports armv6 out of the box because the error  when compilation  fails  send messages about some assembler instructions that are not  compatible with the processor (I am sorry, I have erased all my traces I'll compile again and provide them ASAP).
There is also another problem deriving from the fact that  v8 considers that if  vfp is choosen the architecture is armv7 which is untrue for armv6z (the PiZero processor). If the test is removed the compilation continues

I've prepared a minor change for chrome (https://crrev.com/c/3432486) but if you have some additional fixes that make V8 work, feel free to send them along.
 

You are right about the necessary patience to compile on a PiZero, I have built a toolchain  to compile on my desktop which is much more convenient. I have tested my toolchain with the classic "hello world" that works on the PiZero

From your message I undertand that giving precise cpu target armv6z will not work  and the message on assembler instructions not compatible may arise for the same reason, am I right ?
I'll run another compilation and provide decent information.

I don't really have am armv6 toolchain ready on my machine, and I've cross compiled successfully but got a linker failure.
So, I think the chances are rather high that this actually will work (sorry that I can't be of more help right now).
 
best

Le mercredi 2 février 2022 à 17:31:09 UTC+1, Gérard Vidal a écrit :
Hi,
I am a newcommer here and please don't flame if the answer is somewhere in the galaxy. I googled a little bit but did not find anything recent on that topic.

I am using v8 and nodejs successfully on raspberriesPi armv7 an armv8, some year(s) ago I have been able to install properly a v8 and nodeJS on a PiZero  but it does not seem any more possible.
Is there somewhere a magic combination of compilation parameters that would pass thtough the tests and yields an operational binary from cross-compilation, or is there an hidden branch that did not incorporate the need of armv7 ressources, webassembly constraints and accept the combination armv6 +VFP (arm1176jzf-s configuration).

The PiZero is still on the market and it is a nice and usfull piece of hardware. Thanks in advance

--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.

Gérard Vidal

unread,
Feb 10, 2022, 9:29:58 AM2/10/22
to v8-dev
Again thanks for your answer and your time but sadly I am giving up without succeeding. My only goal il to get an operational nodeJS on a raspberryPiZero. I think I have overestimated my ability  to  cross-compile out of the tracks. I am bouncing from one error to another  and I have spent too much frustrating time on this topic.
It is really a pitty that node developpers have abandonned the Pizero which benefits a lot of v8 and nodejs. I hope somebody with sufficient skills will spend the required time  to compileV8 indside  node for the arm1176jzf-s = armv6z (or maybe a google summer code ?).

I am not used to gn, I have spend some time to understand and resched the stage 137/......  in building V8  with the cross-compiler but no more. I have kept your advice and will try to compile on the PiZero  but at the moment  I cannot get an operational WIFI  which prevents a lot of things.

Do not hesitate to forward news on the compilation of V8 on armv6z  and if you have any contact in node push on them!
best....

Leszek Swirski

unread,
Feb 10, 2022, 9:35:09 AM2/10/22
to v8-...@googlegroups.com

Camillo Bruni

unread,
Feb 10, 2022, 12:16:45 PM2/10/22
to v8-...@googlegroups.com
Sorry to hear.  The only good news is that my arm6k CL landed in the meantime :).
Cross-compiling can be quite tricky :/

Gérard Vidal

unread,
Feb 15, 2022, 5:38:21 AM2/15/22
to v8-dev
Thanks for the link I did not know that site. It seems that it is  armv6l  I cannot find it [here](https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures) and RaspberryPi Zero is armv6z  bearing the VFP capability which is not common in arm11 procs. Is there a way to ask for somebody to compile for armv6z or to share the configuration that succeeded for armv6l.
 I'll check anyway and report  here but  I am struggling  with  problems to  connect to the net with raspberryPizero theinterface does not appear because of a boot problem on regulatory.db it may take some time

Gérard Vidal

unread,
Feb 15, 2022, 5:38:23 AM2/15/22
to v8-dev

From what I read [here](https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures)armv6k seems to be a multithread armv6z , am I right ? In that case hope is back !!

Gérard Vidal

unread,
Feb 16, 2022, 11:28:43 AM2/16/22
to v8-dev
Unfortunately it fails :
* either with  `/usr/local/lib/node/nodejs/bin/node  no such file or directory ` Which is due to the fact that node-armv6l is using ld -linux-armhf.so.3  while my image is compiled for armv6 (armel) ld -linux-armgnueabi/ld-2.31.so
* or when I try any ugly trick by soft linking gnueabi to gnueabihf

There is still a remaining hope the toolchain I have built  is on top of gnueabihf  but with ld-2.35. I wil rebuild the toolchain with ld-2.31 and check again (and if it works that will mean I not wasted all my time building an Ad-Hoc toolchain...) ;-)

Le jeudi 10 février 2022 à 15:35:09 UTC+1, les...@chromium.org a écrit :

Gérard Vidal

unread,
Feb 20, 2022, 8:01:30 PM2/20/22
to v8-dev
Hi @Camillo,
I have launched a compilation on my PiZeroon the source dowloaded from the nodejs site, without any modification  and after one day and a half it fails  in v8 compilationon this command  :
```shell
g++ -o /home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/regexp/regexp-compiler.o ../deps/v8/src/regexp/regexp-compiler.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-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' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.13"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_MINOR_MC' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ATOMIC_MARKING_STATE' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_SNAPSHOT_COMPRESSION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-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/home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj/gen -I/home/ens-ife/Logiciels/Node/node-v17.5.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 -mfpu=vfp -marm -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF /home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/.deps//home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/regexp/regexp-compiler.o.d.raw   -c
```
With the following error message repeated 7 times :
```shell
/tmp/ccNNHBJE.s: Messages de l'assembleur:
/tmp/ccNNHBJE.s:1956: Erreur: le processeur choisi ne supporte pas « usat r3,#8,r3 » en mode ARM
```
I think that there might be a combination of parameters in the v8 configuration that would enable to overcome this error, if you may have any suggestion I will make the modifications, start again compilation and let you know what happens.
Thanks for your help !

Ben Noordhuis

unread,
Feb 25, 2022, 6:18:24 AM2/25/22
to v8-...@googlegroups.com
On Mon, Feb 21, 2022 at 2:01 AM Gérard Vidal <gerard....@gmail.com> wrote:
>
> Hi @Camillo,
> I have launched a compilation on my PiZeroon the source dowloaded from the nodejs site, without any modification and after one day and a half it fails in v8 compilationon this command :
> ```shell
> g++ -o /home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/regexp/regexp-compiler.o ../deps/v8/src/regexp/regexp-compiler.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-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' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.13"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DENABLE_MINOR_MC' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ATOMIC_MARKING_STATE' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_SNAPSHOT_COMPRESSION' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-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/home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj/gen -I/home/ens-ife/Logiciels/Node/node-v17.5.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 -mfpu=vfp -marm -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF /home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/.deps//home/ens-ife/Logiciels/Node/node-v17.5.0/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/regexp/regexp-compiler.o.d.raw -c
> ```
> With the following error message repeated 7 times :
> ```shell
> /tmp/ccNNHBJE.s: Messages de l'assembleur:
> /tmp/ccNNHBJE.s:1956: Erreur: le processeur choisi ne supporte pas « usat r3,#8,r3 » en mode ARM
> ```
> I think that there might be a combination of parameters in the v8 configuration that would enable to overcome this error, if you may have any suggestion I will make the modifications, start again compilation and let you know what happens.
> Thanks for your help !

Hi Gérard, I've been the maintainer of Node's ARM port for its first
10 years. I don't want to discourage you but I don't remember Node
having run on armv6z since... I don't know, 2014, 2015? Not in recent
times anyway.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages