stressapptest: Support >4G RAM in 32-bit application

ChromeOS userspace is still 32-bits on ARM64 device, this CL changed
stressapptest implementation and compile option to achieve testing
more than 4G memory on ARM platform.

In ebuild file, we add append-lfs-flags to make ftruncate() work with
64-bits size_t.

The added patch modified:
* Use memfd_create() instead of shm_open() and shm_unlink()
  Because the use limit of /dev/shm is half the RAM (i.e. only 4G on 8G
  devices)

BUG=chromium:1184638, b:181979530
TEST=Passed build on multiple arch platform
  emerge-nyan stressapptest # ARM
  emerge-trogdor stressapptest # ARM64
  emerge-volteer stressapptest # x86/64
TEST=Passed the following stressapptest use cases on ARM64
devices (lazor) with 8G RAM SKU:
  stressapptest --cc_test -s 60
  stressapptest -W -s 60

Change-Id: I28557f6a24564a69a69724a75e28532874492906
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2756069
Tested-by: Meng-Huan Yu <menghuan@chromium.org>
Auto-Submit: Meng-Huan Yu <menghuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Meng-Huan Yu <menghuan@chromium.org>
(cherry picked from commit 126357c8938f1a8030d0936a05a2b4edf85c684c)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2760579
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Hung-Te Lin <hungte@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
3 files changed