Commit 22064ffa authored by Ramon Nou's avatar Ramon Nou
Browse files

RISC-V integration

parent 7b71f18c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### New

- Add RISC-V profile ([!220](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/220))

### Changed

- Unify dependency scripts (dl and compile): Unify `-d` and `-p` flags ([!174](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/174)).
+5 −0
Original line number Diff line number Diff line
@@ -66,6 +66,11 @@ pkg_install() {
    if [[ ${EXTRA_INSTALL_ARGS} == "ARM64" ]]; then
        cp "${CURR}"/arch/aarch64/include/libsyscall_intercept_hook_point.h ${INSTALL_DIR}/include
    fi

    # patch for riscv syscall_intercept version to fit other implementations
    # it replaces line 91 only if there is the struct wrapper_ret of riscv
    sed -i '91s/struct wrapper_ret/long/g' \
      ${INSTALL_DIR}/include/libsyscall_intercept_hook_point.h
}

pkg_check() {
+74 −0
Original line number Diff line number Diff line
################################################################################
# Copyright 2018-2024, Barcelona Supercomputing Center (BSC), Spain            #
# Copyright 2015-2024, Johannes Gutenberg Universitaet Mainz, Germany          #
#                                                                              #
# This software was partially supported by the                                 #
# EC H2020 funded project NEXTGenIO (Project ID: 671951, www.nextgenio.eu).    #
#                                                                              #
# This software was partially supported by the                                 #
# ADA-FS project under the SPPEXA project funded by the DFG.                   #
#                                                                              #
# This file is part of GekkoFS.                                                #
#                                                                              #
# GekkoFS is free software: you can redistribute it and/or modify              #
# it under the terms of the GNU General Public License as published by         #
# the Free Software Foundation, either version 3 of the License, or            #
# (at your option) any later version.                                          #
#                                                                              #
# GekkoFS is distributed in the hope that it will be useful,                   #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with GekkoFS.  If not, see <https://www.gnu.org/licenses/>.            #
#                                                                              #
# SPDX-License-Identifier: GPL-3.0-or-later                                    #
################################################################################

# vi: ft=bash

# Variables to be imported into the scripts
declare -A wgetdeps clonedeps clonedeps_args clonedeps_patches extra_install_args
declare -a order

# Comment that should be displayed when printing the profile
comment="All dependencies"

# Dependencies that must be downloaded directly
wgetdeps=(
    ["lz4"]="1.9.4"
    ["capstone"]="6.0.0-Alpha2"
    ["argobots"]="1.2"
    ["rocksdb"]="8.10.0"
    ["json-c"]="0.17-20230812"
)

# Dependencies that must be cloned.
clonedeps=(
    ["libfabric"]="HEAD@v1.20.1"
    ["mercury"]="v2.4.0"
    ["margo"]="v0.18.3"
    ["syscall_intercept"]="2a25b21926ab115d667e135389458a7a159e8bb1"
)

# Extra arguments for git clone
clonedeps_args=(
    ["mercury"]="--recurse-submodules"
)

# Ordering that MUST be followed when downloading
order=(
    "lz4" "capstone" "json-c" "libfabric" "mercury" "argobots" "margo" "rocksdb" "syscall_intercept"
)

# Extra arguments passed to the installation script. As such, they can
# reference the following variables:
#  - CMAKE: a variable that expands to the cmake binary
#  - SOURCE_DIR: the directory where the sources for the package were
#               downloaded
#  - INSTALL_DIR: the directory where the package should be installed
#  - CORES: the number of cores to use when building
#  - PERFORM_TEST: whether tests for the package should be executed
extra_install_args=(
)
+4 −2
Original line number Diff line number Diff line
@@ -775,20 +775,22 @@ hook(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4,
                    reinterpret_cast<const char*>(arg1), 0);
            break;
#endif
#ifdef SYS_renameat
        case SYS_renameat:
            *result = gkfs::hook::hook_renameat(
                    static_cast<int>(arg0), reinterpret_cast<const char*>(arg1),
                    static_cast<int>(arg2), reinterpret_cast<const char*>(arg3),
                    0);
            break;

#endif
#ifdef SYS_renameat2
        case SYS_renameat2:
            *result = gkfs::hook::hook_renameat(
                    static_cast<int>(arg0), reinterpret_cast<const char*>(arg1),
                    static_cast<int>(arg2), reinterpret_cast<const char*>(arg3),
                    static_cast<unsigned int>(arg4));
            break;

#endif
        case SYS_fstatfs:
            *result = gkfs::hook::hook_fstatfs(
                    static_cast<unsigned int>(arg0),
+4 −0
Original line number Diff line number Diff line
@@ -472,7 +472,9 @@ SYSCALL(getpmsg, 5, S_RET(rdec), S_NARG(arg, "arg0"),
#endif
    SYSCALL(newfstatat,              4,  S_RET(rdec),    S_NARG(atfd, "dfd"),           S_NARG(cstr, "pathname"),        S_NARG(ptr, "statbuf"),           S_NARG(arg, "flag")),
    SYSCALL(unlinkat,                3,  S_RET(rdec),    S_NARG(atfd, "dfd"),           S_NARG(cstr, "pathname"),        S_NARG(arg, "flag")),
#ifdef SYS_renameat
    SYSCALL(renameat,                4,  S_RET(rdec),    S_NARG(atfd, "olddfd"),        S_NARG(cstr, "oldname"),         S_NARG(atfd, "newdfd"),           S_NARG(cstr, "newname")),
#endif
    SYSCALL(linkat,                  5,  S_RET(rdec),    S_NARG(atfd, "olddfd"),        S_NARG(cstr, "oldpath"),         S_NARG(atfd, "newdfd"),           S_NARG(cstr, "newpath"),     S_NARG(arg, "flags")),
    SYSCALL(symlinkat,               3,  S_RET(rdec),    S_NARG(cstr, "oldname"),       S_NARG(atfd, "newdfd"),          S_NARG(cstr, "newname")),
    SYSCALL(readlinkat,              4,  S_RET(rdec),    S_NARG(atfd, "dfd"),           S_NARG(cstr, "pathname"),        S_NARG(ptr, "buf"),               S_NARG(arg, "bufsiz")),
@@ -1132,7 +1134,9 @@ const struct named_syscall_entry syscalls_by_name[] = {
#ifdef SYS_rename
    SYSCALL_BY_NAME(rename),
#endif
#ifdef SYS_renameat
    SYSCALL_BY_NAME(renameat),
#endif
    SYSCALL_BY_NAME(renameat2),
    SYSCALL_BY_NAME(request_key),
    SYSCALL_BY_NAME(restart_syscall),
Loading