Go to file
Martin Jansa 33c96b7ed8 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>
2023-06-28 13:53:12 -07:00
contrib contrib: oe-stylize: Use Python3 explicitly 2023-06-04 22:29:46 -07:00
meta-filesystems libburn: upgrade 1.5.4 -> 1.5.6 2023-06-27 13:44:47 -07:00
meta-gnome libtimezonemap: rename downloaded file name 2023-06-28 13:53:12 -07:00
meta-initramfs *.patch: add Upstream-Status to all patches 2023-06-21 09:15:20 -07:00
meta-multimedia pipewire: upgrade 0.3.71 -> 0.3.72 2023-06-27 13:44:47 -07:00
meta-networking mbedtls: upgrade 2.28.2 -> 2.28.3 2023-06-28 13:53:12 -07:00
meta-oe nodejs: use PIE for host binaries 2023-06-28 13:53:12 -07:00
meta-perl layers: Move READMEs to markdown format 2023-06-17 08:30:01 -07:00
meta-python python3-pyroute2: upgrade 0.5.19 -> 0.7.9 2023-06-28 13:53:12 -07:00
meta-webserver nginx: Add stream Signed-off-by: Luke Schaefer <lukeschafer17@gmail.com> 2023-06-27 13:44:47 -07:00
meta-xfce ristretto: Upgrade to 0.13.1 release 2023-06-22 07:49:59 -07:00
.gitignore .gitignore: add *.pyc and *.pyo 2019-06-15 16:45:33 -07:00
COPYING.MIT add README and license for this layer 2011-02-13 16:47:32 +01:00
README.md layers: Move READMEs to markdown format 2023-06-17 08:30:01 -07:00

Collection of layers for the OE-core universe

Main layer maintainer: Khem Raj raj.khem@gmail.com

This repository is a collection of layers to suppliment OE-Core with additional packages, Each layer have designated maintainer Please see the respective READMEs in the layer subdirectories