Files
meta-openembedded/meta-oe/recipes-devtools
Hongxu Jia d483bcbc30 nodejs: support cross compile without qemu user conditionally
Due to the scope of supported BSPs by qemu-user is limited, such
as a segment fault on armv9 after qemu apply commit [target/arm:
Convert LDAPR/STLR (imm) to decodetree][1]
```
|tmp-glibc/work/neoversen2-crypto-wrs-linux/nodejs/20.5.1/node-v20.5.1/out/
Release/v8-qemu-wrapper.sh: line 7: 3179613 Segmentation fault      (core dumped)
PSEUDO_UNLOAD=1 qemu-aarch64 -r 5.15 -L tmp-glibc/work/neoversen2-crypto-wrs-linux/
nodejs/20.5.1/recipe-sysroot -E LD_LIBRARY_PATH=tmp-glibc/work/neoversen2-crypto-wrs-linux/
nodejs/20.5.1/recipe-sysroot/usr/lib64:tmp-glibc/work/neoversen2-crypto-wrs-linux/
nodejs/20.5.1/recipe-sysroot/usr/lib64 "$@"
```

Upstream nodejs have cross compile support, but it needs host and target
have same bit width (e.g. a x86_64 host targeting arrch64 to produce a
64-bit binary). So:
1. If host and target have different bit width, build with QEMU user as usual;

2. If host and target have same bit width, enable notejs cross compile support:
- The build tools of nodejs is GYP[2], set CC_host, CFLAGS_host,
  CXX_host, CXXFLAGS_host, LDFLAGS_host, AR_host for host build
  which is separated with target build [3]
- Satisfy layer compatibility, set GYP variables in prefuncs of do_configure,
  do_compile and do_install other than in recipe parsing
- Add missing native packages to fix library missing on host build
- Rework libatomic.patch, explicitly link to libatomic for clang
  conditionally

[1] https://github.com/qemu/qemu/commit/2521b6073b7b4b505533a941d4f9600f7585dc78
[2] https://github.com/nodejs/node-gyp
[3] https://github.com/nodejs/node-gyp/blob/main/gyp/docs/UserDocumentation.md#cross-compiling

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2025-02-04 15:04:40 -08:00
..
2024-02-09 09:52:12 -08:00
2024-08-21 16:43:25 -04:00
2023-11-17 11:38:25 -08:00
2024-02-03 22:03:04 -08:00
2020-01-09 14:05:37 -08:00
2023-02-01 09:28:47 -08:00
2025-01-20 19:45:24 -05:00
2025-01-20 19:45:30 -05:00
2024-02-09 09:52:12 -08:00
2024-06-24 07:37:16 -04:00
2023-12-29 09:04:17 -08:00
2021-11-09 20:57:14 -08:00
2022-08-23 10:04:07 -07:00
2023-12-21 08:20:34 -08:00
2023-11-11 09:26:41 -08:00
2024-02-09 09:52:12 -08:00
2024-02-09 09:52:12 -08:00
2024-02-09 09:52:12 -08:00
2023-11-17 11:38:27 -08:00
2023-03-17 07:06:55 -07:00
2023-06-14 09:41:35 -07:00
2023-09-07 10:31:19 -07:00
2024-04-30 10:59:05 -07:00
2022-06-30 13:39:27 -04:00
2023-08-11 09:36:03 -07:00
2025-01-20 19:25:38 -05:00
2024-02-09 09:52:12 -08:00
2024-12-15 14:00:50 -05:00
2023-10-04 13:09:38 -07:00
2024-02-09 09:52:12 -08:00
2024-12-27 09:24:48 -05:00
2024-01-08 19:54:41 -08:00
2021-08-03 10:21:25 -07:00
2023-12-21 08:00:40 -08:00
2023-12-29 09:04:18 -08:00
2024-10-15 16:59:45 -04:00
2024-04-21 10:52:49 -07:00