Revision a462c5ab3d414a6c52fcbc70f45dfa7f21665451 authored by Jakob Nybo Nissen on 29 August 2022, 09:16:56 UTC, committed by Kristoffer on 30 August 2022, 15:15:43 UTC
The docs on multithreading still warns that the default scheduler for @threads
uses static scheduling. However, since #44136, dynamic scheduling has been the
default. This commit removes the warning.

(cherry picked from commit 72222d6dbaf7fd726b38bc3b6baddd51032d1cca)
1 parent 9db7f85
Raw File
fixup-rpath.sh
#!/bin/sh
# This file is a part of Julia. License is MIT: https://julialang.org/license

# Usage: fixup-rpath.sh <patchelf path> <dir to process> <build libdir>

if [ $# -ne 3 ]; then
    echo "Incorrect number of arguments: Expected 3, got $#"
    echo "Usage: fixup-rpath.sh <patchelf path> <directory to process> <build libdir>"
    exit 1
fi

patchelf="$1"
executable_dir="$2"
build_libdir="$3"

for lib in $(find ${executable_dir} -type f -perm -111); do
    # First get the current RPATH
    rpath="$(${patchelf} --print-rpath ${lib})"

    # If it doesn't contain the build's libdir, we don't care about it
    if [ -z "$(echo ${rpath} | grep -F ${build_libdir})" ]; then
        continue
    fi

    # Remove build_libdir from the RPATH, retaining the rest
    new_rpath="$(echo ${rpath} | tr : \\n | grep -vF ${build_libdir} | tr \\n :)"
    # Drop the trailing :
    new_rpath="${new_rpath%?}"

    echo "  Setting RPATH for ${lib} to '${new_rpath}'"

    # Now set the new RPATH
    ${patchelf} --set-rpath "${new_rpath}" ${lib}
done
back to top