diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2023-06-28 21:56:08 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-06-28 13:53:12 -0700 |
commit | 33c96b7ed85045e3d5bc169908fc25c03efcf9a5 (patch) | |
tree | 3949c2c76bc35ddcd9ff1e08f1e0cb82198b3e89 /meta-python/recipes-devtools/python/python3-matplotlib/0001-removed-RandomNumberGenerator-class-included-random-.patch | |
parent | ca6cc464eddac9ac0048b27316f119d1f6f0b8ba (diff) | |
download | meta-openembedded-33c96b7ed85045e3d5bc169908fc25c03efcf9a5.tar.gz |
nodejs: use PIE for host binaries
* mksnapshot is built as host binary, but then gets executed under
qemu-arm, because for 32bit target we need to run 32bit mksnapshot
even when building on x86-64 host
* unfortunately since upgrade to qemu-8 in:
https://git.openembedded.org/openembedded-core/commit/?id=fe8125565af07b73f9b29db2188ecb6e884bcc70
the mksnapshot fails to execute with:
LD_LIBRARY_PATH=/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/lib.host:/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/obj.target/v8_snapshot/geni; "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/v8-qemu-wrapper.sh" "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/mksnapshot" --turbo_instruction_scheduling "--target_os=linux" "--target_arch=arm" --startup_src "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc" --embedded_variant Default --embedded_src "/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/obj.target/v8_snapshot/geni/embedded.S" --no-native-code-counters
#
# Fatal process OOM in Failed to reserve virtual memory for CodeRange
#
/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/node-v18.16.0/out/Release/v8-qemu-wrapper.sh: line 7: 669880 Trace/breakpoint trap (core dumped) PSEUDO_UNLOAD=1 qemu-arm -r 5.15 -L /OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/recipe-sysroot -E LD_LIBRARY_PATH=/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/recipe-sysroot/usr/lib:/OE/build/oe-core/tmp-glibc/work/cortexa8t2hf-neon-oe-linux-gnueabi/nodejs/18.16.0-r0/recipe-sysroot/lib "$@"
It was failing only in some of my builds first, in the end
I was able to narrow the difference between the build where
it fails and where it doesn't fail to
require conf/distro/include/security_flags.inc
then
GCCPIE = "--enable-default-pie"
and lastly this PIE enabled just for nodejs to work around
this issue without downgrading qemu-native.
* using -strace with qemu doesn't help much, just confirms that
the OOM error message is really caused by failed mmap2:
--- SIGPROF {si_signo=SIGPROF, si_code=SI_TKILL, si_pid=2908258, si_uid=1026} ---
clock_gettime64(CLOCK_MONOTONIC,0x407ef640) = 0 ({tv_sec=20187,tv_nsec=678404286})
rt_sigreturn(0x407efb70) = -1 errno=513 (Successful exit from sigreturn)
write(3,0x141e538,28) = 28
write(3,0x141e538,28) = 28
write(3,0x141e538,32) = 32
mmap2(0x0097a000,33554432,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,-1,0) = -1 errno=12 (Cannot allocate memory)
mmap2(0x0097a000,33554432,PROT_NONE,MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,-1,0) = -1 errno=12 (Cannot allocate memory)
* diffoscope on this 1.7G binary didn't really help as it got killed by OOMK after a while
Out of memory: Killed process 1136999 (diffoscope) total-vm:404300108kB, anon-rss:122594688kB, file-rss:512kB, shmem-rss:0kB, UID:1026 pgtables:764240kB oom_score_adj:0
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-matplotlib/0001-removed-RandomNumberGenerator-class-included-random-.patch')
0 files changed, 0 insertions, 0 deletions