gfxstream: guest: don't use transitional LFS64 API

musl removed the LFS64 APIs like mmap64(), which were intended to be a
transitional measure multiple decades ago, causing a build failure
here.  Since virtio-gpu sizes and offsets are 64-bit, we do still want
to make sure that we're using 64-bit mmap here, so I've added
-D_FILE_OFFSET_BITS=64, which will ensure that off_t is always 64-bit
in gfxstream guest, and which is generally the modern solution here.

With this change, I am able to build gfxstream with musl.

Fixes: fec8e296a3 ("Make VirtGpu* interfaces")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37086>
This commit is contained in:
Alyssa Ross 2025-08-29 16:32:42 +02:00 committed by Marge Bot
parent 880098158d
commit 6f8cdd8a3c
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ endif
#===============#
# Configuration #
#===============#
gfxstream_guest_args = []
gfxstream_guest_args = ['-D_FILE_OFFSET_BITS=64']
# Our internal guest build
if host_machine.system() == 'windows'

View file

@ -97,7 +97,7 @@ VirtGpuResourceMappingPtr DrmVirtGpuResource::createMapping() {
}
uint8_t* ptr = static_cast<uint8_t*>(
mmap64(nullptr, mSize, PROT_WRITE | PROT_READ, MAP_SHARED, mDeviceHandle, map.offset));
mmap(nullptr, mSize, PROT_WRITE | PROT_READ, MAP_SHARED, mDeviceHandle, map.offset));
if (ptr == MAP_FAILED) {
mesa_loge("mmap64 failed with (%s)", strerror(errno));