Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ jobs:
- name: Build
run: cmake --build build-native --parallel $(sysctl -n hw.ncpu)

- name: Native package contract
run: tools/bundles/verify-native-shims.sh --eac-only app/native

- name: Runtime tests
run: ctest --test-dir build-native --output-on-failure -E '^(metal_device|dxbc|format_translation|phase17)$'

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ jobs:
- name: Build
run: cmake --build build-native --parallel $(sysctl -n hw.ncpu)

- name: Native package contract
run: tools/bundles/verify-native-shims.sh --eac-only app/native

- name: Runtime tests
run: ctest --test-dir build-native --output-on-failure -E '^(metal_device|dxbc|format_translation|phase17)$'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ jobs:
cp libd3d11.dylib libd3d12.dylib libdxgi.dylib libxaudio2_9.dylib libxinput1_4.dylib libopengl32.dylib ../app/native/ 2>/dev/null || true
cp metalsharp metalsharp_launcher MetalSharpMigrator ../app/native/ 2>/dev/null || true
cd ..
tools/bundles/verify-native-shims.sh app/native
METALSHARP_BUILD_DIR="$PWD/build" tools/package/create-host-runtime.sh

- name: Install Electron deps
Expand Down
45 changes: 45 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,51 @@ add_custom_command(TARGET metalsharp_native POST_BUILD
COMMENT "Copying $<TARGET_FILE_NAME:metalsharp_native> to app/native/"
)

# Linux user-space compatibility substrate for the protected EAC launcher.
# This is built for the same x86_64/Rosetta lane as Wine 11.5 and is inserted
# into that already-built Wine process only by the explicit EAC proof/launch
# path. It is not a second Wine runtime, a graphics backend, or a vendor
# module shim: the source implements the Linux ELF/syscall/TSD boundary on
# Darwin and maps the real downloaded EAC module without modifying it.
add_library(metalsharp_eac_substrate SHARED
src/anticheat/linux_substrate.c
)
target_include_directories(metalsharp_eac_substrate PRIVATE include)
target_compile_options(metalsharp_eac_substrate PRIVATE -Wno-deprecated-declarations)
target_link_options(metalsharp_eac_substrate PRIVATE "-Wl,-undefined,dynamic_lookup")
set_target_properties(metalsharp_eac_substrate PROPERTIES
OUTPUT_NAME "metalsharp_eac_substrate"
PREFIX ""
)
metalsharp_wine_target(metalsharp_eac_substrate)

# The Linux loader reads a real ET_DYN symbol image from its procfs view; it
# never asks dyld to load Linux libc. Generate that MetalSharp-owned image
# beside the substrate so packaged/runtime proofs do not depend on a machine's
# /tmp state. It contains no vendor or protected-module bytes.
find_package(Python3 COMPONENTS Interpreter REQUIRED)
set(METALSHARP_EAC_SYMBOL_IMAGE
"${CMAKE_SOURCE_DIR}/app/native/metalsharp_eac_libc.so.6")
add_custom_command(
OUTPUT "${METALSHARP_EAC_SYMBOL_IMAGE}"
COMMAND ${Python3_EXECUTABLE}
"${CMAKE_SOURCE_DIR}/tools/anticheat/generate_linux_libc_elf.py"
"${METALSHARP_EAC_SYMBOL_IMAGE}"
DEPENDS "${CMAKE_SOURCE_DIR}/tools/anticheat/generate_linux_libc_elf.py"
COMMENT "Generating MetalSharp EAC Linux symbol image"
VERBATIM
)
add_custom_target(metalsharp_eac_symbol_image
DEPENDS "${METALSHARP_EAC_SYMBOL_IMAGE}"
)
add_dependencies(metalsharp_eac_substrate metalsharp_eac_symbol_image)
add_custom_command(TARGET metalsharp_eac_substrate POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:metalsharp_eac_substrate>"
"${CMAKE_SOURCE_DIR}/app/native/$<TARGET_FILE_NAME:metalsharp_eac_substrate>"
COMMENT "Copying metalsharp_eac_substrate.dylib to app/native/"
)

# OpenGL 2.1-4.6 bridge. Delegates GL 2.1 to macOS native OpenGL framework.
# GL 3.x+ shader translation via SPIRV-Cross is scaffolded for Phase 4c.
add_library(metalsharp_opengl32 SHARED
Expand Down
Loading
Loading