Set libc versioning to GLIBC 2.2.5 ot add support to inject custom headers to generated runtime-headers.h
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cmake, cpp
- Domain
- build-system, compilers
Research direction
Start with CMakeLists.txt and runtime/runtime.cmake, then review how the generated runtime-headers.h and dependency builds receive compiler flags. Clarify the target GLIBC version and the supported mechanism for custom headers, including the compiler-cache concern and rebuilt dependencies. Done means the versioning and header injection work consistently without relying on patchelf.
Written by the indexing model from the issue text.
Description
Problem:
- When we create commercial software we need build application for all Linux-based distros.
- We can't build static binary because because some GLIBC features does not support it. (related to authorization, change permissions)
Solution.
- Build KPHP runtime with using version headers https://github.com/wheybags/glibc_version_header
- Provide CMake flags for including custom headers to build sequence and runtime-header.h
Current my way:
Fix functions version for runtime library:
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,10 @@ include(cmake/external-libraries.cmake)
# TODO: use FetchContent_Declare instead of include_directories
include_directories(.)
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${BASE_DIR}/../glibc_version_header/version_headers/x64/force_link_glibc_2.25.h")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${BASE_DIR}/../glibc_version_header/version_headers/x64/force_link_glibc_2.25.h")
+
Fix functions version for application:
--- a/runtime/runtime.cmake
+++ b/runtime/runtime.cmake
@@ -167,6 +167,9 @@ file(WRITE ${AUTO_DIR}/runtime/runtime-headers.h "\
#ifndef MERGED_RUNTIME_HEADERS_H
#define MERGED_RUNTIME_HEADERS_H
+#include \"${BASE_DIR}/../glibc_version_header/version_headers/x64/force_link_glibc_2.5.h\"
${MERGED_RUNTIME_HEADERS}
#endif
Note:
Option -include breaks compiler caching when KPHP build it.
Also: I rebuilt all dependencies with this headers: libh3, libsqlite, libcurl, libkphp-timelib
Note: patchelf utility does not work very good for fixing symbols version.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 116
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 11
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from VKCOM/kphp
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Khan Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
.github/CODEOWNERS Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·