diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a5655c40a73199ec65feb29a5c865faa811c82..568438ff6519cc4aebbc4b3ec5e97b7ad383403e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Removed ### Fixed - Using `unlink` now fails if it is a directory unless the `AT_REMOVEDIR` flag is used (POSIX compliance) ([!139](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/139)). +- Support glibc-2.34 or newer with syscall_intercept [!146](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/146)). ## [0.9.1] - 2022-04-29 diff --git a/scripts/dl_dep.sh b/scripts/dl_dep.sh index b802ff968b9e335e3e7353ba19bbaed280ecf8c5..88b7f5a21cf28c1571e53afef1b8d8c2c909c9cf 100755 --- a/scripts/dl_dep.sh +++ b/scripts/dl_dep.sh @@ -269,7 +269,10 @@ clonedeps() { # apply patch if provided if [[ -n "${PATCH}" ]]; then - [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git apply --verbose "${PATCH_DIR}/${PATCH}" ) + for PATCH_FILE in ${PATCH}; do + echo "Applying patch '${PATCH_DIR}/${PATCH_FILE}'..." + [[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git apply --verbose "${PATCH_DIR}/${PATCH_FILE}" ) + done fi } diff --git a/scripts/patches/syscall_intercept_clone3.patch b/scripts/patches/syscall_intercept_clone3.patch new file mode 100644 index 0000000000000000000000000000000000000000..25c7df239087846d599034f6a608f61ec994f9a4 --- /dev/null +++ b/scripts/patches/syscall_intercept_clone3.patch @@ -0,0 +1,14 @@ +diff --git a/src/intercept.c b/src/intercept.c +index 41fd95d..c0cd865 100644 +--- a/src/intercept.c ++++ b/src/intercept.c +@@ -689,7 +689,8 @@ intercept_routine(struct context *context) + * the clone_child_intercept_routine instead, executing + * it on the new child threads stack, then returns to libc. + */ +- if (desc.nr == SYS_clone && desc.args[1] != 0) ++ if ((desc.nr == SYS_clone || desc.nr == SYS_clone3) && ++ desc.args[1] != 0) + return (struct wrapper_ret){ + .rax = context->rax, .rdx = 2 }; + else diff --git a/scripts/profiles/0.9.1/default.specs b/scripts/profiles/0.9.1/default.specs index c65bf556ee555e7c4980317908da48cd7527524b..afc567273e8c5d77fc3e73e604677a0c8a0ebe4a 100644 --- a/scripts/profiles/0.9.1/default.specs +++ b/scripts/profiles/0.9.1/default.specs @@ -60,7 +60,7 @@ clonedeps_args=( # Patches that should be applied post-clone clonedeps_patches=( - ["syscall_intercept"]="syscall_intercept.patch" + ["syscall_intercept"]="syscall_intercept.patch syscall_intercept_clone3.patch" ) # Ordering that MUST be followed when downloading