Skip to content

[liblzma] Add feature to disable sandbox #49986

Description

@bansan85

Is your feature request related to a problem? Please describe.

I want to build with thread sanitize. liblzma complains that thread sanitize and sandbox can't be enabled at the same time.

-- Performing Test HAVE_LINUX_LANDLOCK
-- Performing Test HAVE_LINUX_LANDLOCK - Success
CMake Error at CMakeLists.txt:1095 (message):
  CMAKE_C_FLAGS or the environment variable CFLAGS contains '-fsanitize='
  which is incompatible with Landlock sandboxing.  Use -DENABLE_SANDBOX=OFF
  as an argument to 'cmake' when using '-fsanitize'.

Proposed solution

In liblzma port, add sandbox feature and set ENABLE_SANDBOX CMake option according to,

Describe alternatives you've considered

In triplet, set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DENABLE_SANDBOX:BOOL=OFF) if PORT is liblzma

Additional context

My triplet:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CXX_FLAGS "-fsanitize=thread")
set(VCPKG_C_FLAGS "-fsanitize=thread")
set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DCMAKE_CUDA_FLAGS="-fsanitize=thread")
set(VCPKG_LINKER_FLAGS "-fsanitize=thread")

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_FIXUP_ELF_RPATH ON)

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:port-featureThe issue is with a library, which is requesting new capabilities that didn’t exist

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions