Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #574 - Revert "Improve compatibility of binfmt-bypass with really old Docker images" #662

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
33 changes: 13 additions & 20 deletions src/binfmt-bypass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,6 @@ function(make_preload_lib_target target_name)
# hide all symbols by default
-fvisibility=hidden
)

# a bit of a hack, but it seems to make binfmt bypass work in really old Docker images (e.g., CentOS <= 7)
add_custom_command(
TARGET ${target_name}
POST_BUILD
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/fix-preload-library.sh $<TARGET_FILE_NAME:${target_name}>
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
VERBATIM
)
endfunction()

make_preload_lib_target(${preload_lib})
Expand Down Expand Up @@ -95,21 +86,23 @@ endif()
# this is a workaround to existing issues using AppImages in Docker with AppImageLauncher installed on the host system
check_program(NAME xxd)

function(generate_preload_lib_header target_name)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${preload_lib}.h
COMMAND xxd -i $<TARGET_FILE_NAME:${preload_lib}> ${preload_lib}.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${preload_lib}
VERBATIM
)

# same story for 32-bit lib
if (build_32bit_preload_library)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target_name}.h
COMMAND xxd -i $<TARGET_FILE_NAME:${target_name}> ${target_name}.h
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${preload_lib_32bit}.h
COMMAND xxd -i $<TARGET_FILE_NAME:${preload_lib_32bit}> ${preload_lib_32bit}.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${target_name}
DEPENDS ${preload_lib_32bit}
VERBATIM
)
endfunction()

generate_preload_lib_header(${preload_lib})

# same story for 32-bit lib
if (build_32bit_preload_library)
generate_preload_lib_header(${preload_lib_32bit})
endif()

# the lib provides an algorithm to extract the runtime, patch it and launch it, preloading our preload lib to make the
Expand Down
35 changes: 0 additions & 35 deletions src/binfmt-bypass/fix-preload-library.sh

This file was deleted.

Loading