Skip to content
Permalink
Browse files

meson: port arena options from cmake and add sane macos defaults

MacOS still silently fails mmap on inherited shm file descriptors, and
we have to reopen the file itself.
  • Loading branch information
Snaipe committed Oct 20, 2019
1 parent c8d1dcd commit ae525ca6c31cd2a0bd2a21af25454fba0848700f
Showing with 14 additions and 0 deletions.
  1. +12 −0 meson.build
  2. +2 −0 meson_options.txt
@@ -88,13 +88,25 @@ else
error('Architecture "@0@" is not supported.'.format(arch))
endif

if get_option('arena_reopen_shm')
config.set('BXF_ARENA_REOPEN_SHM', 1)
endif
if get_option('arena_file_backed')
config.set('BXF_ARENA_FILE_BACKED', 1)
endif

binfmt = 'elf'
os_family = 'posix'
if os == 'windows'
binfmt = 'pe'
os_family = 'windows'
elif os == 'darwin'
binfmt = 'mach-o'

# This is mandatory because OS X fails silently when mmap'ing an inherited
# shm file descriptor
config.set('BXF_ARENA_REOPEN_SHM', 1)
config.set('BXF_ARENA_FILE_BACKED', 1)
endif

config.set('BXF_EXE_FORMAT', binfmt)
@@ -0,0 +1,2 @@
option('arena_reopen_shm', type: 'boolean', value: false, description: 'Reopen shared memory file in worker process rather than just inherit a file descriptor')
option('arena_file_backed', type: 'boolean', value: false, description: 'Use a file in tempfs to store the arena rather than using shm facilities')

0 comments on commit ae525ca

Please sign in to comment.
You can’t perform that action at this time.