Skip to content

Commit

Permalink
Fix #574 - Revert "Improve compatibility of binfmt-bypass with really…
Browse files Browse the repository at this point in the history
… old Docker images"

This reverts commit c810e70.

Notes:

- [CentOS 7 reached End of Life][1] on June 30, 2024
- [RedHat moved CentOS Stream 8 & 9 upstream of RHEL][2]
- Arch Linux & Manjaro unstable channel have GlibC with symbol version `2.14`:

    U memcpy@GLIBC_2.14

[1]: https://www.redhat.com/en/topics/linux/centos-linux-eol
[2]: https://www.theregister.com/2023/06/23/red_hat_centos_move/
  • Loading branch information
trinitronx committed Sep 15, 2024
1 parent 0013516 commit 9768162
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 55 deletions.
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.

0 comments on commit 9768162

Please sign in to comment.