From 0c19a6885c04221263f9f9cac6eb659fb1d4b659 Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Mon, 20 Jun 2022 16:38:34 +0200 Subject: [PATCH 1/3] dl_dep script: Allow multiple patch files per dependency --- scripts/dl_dep.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/dl_dep.sh b/scripts/dl_dep.sh index b802ff968..88b7f5a21 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 } -- GitLab From 48beba1f0435d1a4d80ef3510ee09d71a5040ba4 Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Mon, 20 Jun 2022 19:02:00 +0200 Subject: [PATCH 2/3] Adding syscall intercept patch for supporting the clone3() syscall --- scripts/patches/syscall_intercept_clone3.patch | 14 ++++++++++++++ scripts/profiles/0.9.1/default.specs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 scripts/patches/syscall_intercept_clone3.patch diff --git a/scripts/patches/syscall_intercept_clone3.patch b/scripts/patches/syscall_intercept_clone3.patch new file mode 100644 index 000000000..25c7df239 --- /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 c65bf556e..afc567273 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 -- GitLab From eab9887e2802f79a4cd2bd63f449ba8124f4d19f Mon Sep 17 00:00:00 2001 From: Marc Vef Date: Mon, 20 Jun 2022 19:05:17 +0200 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a5655c4..568438ff6 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 -- GitLab