Skip to content

Commit

Permalink
Update the rpaths for the gcc specs
Browse files Browse the repository at this point in the history
  • Loading branch information
adonis0147 committed Apr 4, 2023
1 parent bfc807d commit 7006c18
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
10 changes: 5 additions & 5 deletions toolchain/generate_toolchan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ declare -r WORKSPACE_PATH

declare -r PACKAGES_PATH="${WORKSPACE_PATH}/packages"

declare -r BINUTILS_PACKAGE_URL="https://ftpmirror.gnu.org/binutils/binutils-2.39.tar.xz"
declare -r BINUTILS_PACKAGE_URL='https://ftpmirror.gnu.org/binutils/binutils-2.39.tar.xz'
declare -r BINUTILS_MD5SUM='f7e986ae9ff06405cafb2e585ee36d27'

declare -r LINUX_PACKAGE_URL="https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.0.12.tar.xz"
declare -r LINUX_MD5SUM='44933812ad926f5000f01ac108d41ee8'
declare -r LINUX_PACKAGE_URL='https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.22.tar.xz'
declare -r LINUX_MD5SUM='d889d541302da503f566f4d53a0453dc'

declare -r GLIBC_PACKAGE_URL="https://ftpmirror.gnu.org/glibc/glibc-2.36.tar.xz"
declare -r GLIBC_PACKAGE_URL='https://ftpmirror.gnu.org/glibc/glibc-2.36.tar.xz'
declare -r GLIBC_MD5SUM='00e9b89e043340f688bc93ec03239b57'

declare -r GCC_PACKAGE_URL="https://ftpmirror.gnu.org/gcc/gcc-12.2.0/gcc-12.2.0.tar.xz"
declare -r GCC_PACKAGE_URL='https://ftpmirror.gnu.org/gcc/gcc-12.2.0/gcc-12.2.0.tar.xz'
declare -r GCC_MD5SUM='73bafd0af874439dcdb9fc063b6fb069'

function log() {
Expand Down
22 changes: 18 additions & 4 deletions toolchain/setup_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,31 @@ function configure_toolchain() {
rm -rf "$(pwd)/$(uname -m)-linux-gnu"/*
find "$(pwd)" -name '*.la' -delete

# link some paths
ln -snf ../include "$(pwd)/$(uname -m)-linux-gnu/include"
ln -snf ../lib "$(pwd)/$(uname -m)-linux-gnu/lib"
ln -snf ../lib64 "$(pwd)/$(uname -m)-linux-gnu/lib64"
mkdir "$(pwd)/$(uname -m)-linux-gnu/include"
mkdir "$(pwd)/$(uname -m)-linux-gnu/lib"
ln -snf lib "$(pwd)/$(uname -m)-linux-gnu/lib64"

# Link headers
local include_path
include_path="$(pwd)/include"
pushd "$(uname -m)-linux-gnu/include" >/dev/null || exit
while read -r path; do
local absolute_path="${include_path}/${path}"
if [[ -d "${absolute_path}" ]]; then
mkdir -p "${path}"
else
ln -snf "${absolute_path}" "${path}"
fi
done < <(find "${include_path}" -mindepth 1 -printf '%P\n')
popd >/dev/null || exit

local rpaths=(
"\$ORIGIN"
"\$ORIGIN/lib"
"\$ORIGIN/lib64"
"\$ORIGIN/../lib"
"\$ORIGIN/../lib64"
"$(pwd)/$(uname -m)-linux-gnu/lib"
"$(dirname "${libc_so}")"
)
local rpaths_in_line
Expand Down

0 comments on commit 7006c18

Please sign in to comment.