Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion toolchain/cc_wrapper.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@ dirname_shim() {
echo "${path:-/}"
}

script_dir=$(dirname_shim "${BASH_SOURCE[0]}")
if [[ "${BASH_SOURCE[0]}" == "/"* ]]; then
bash_source_abs="$(realpath "${BASH_SOURCE[0]}")"
pwd_abs="$(realpath ".")"
bash_source_rel=${bash_source_abs#"${pwd_abs}/"}
else
bash_source_rel="${BASH_SOURCE[0]}"
fi
script_dir=$(dirname_shim "${bash_source_rel}")
toolchain_path_prefix="%{toolchain_path_prefix}"

# Sometimes this path may be an absolute path in which case we dont do anything because
Expand Down
9 changes: 8 additions & 1 deletion toolchain/osx_cc_wrapper.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ dirname_shim() {
echo "${path:-/}"
}

script_dir=$(dirname_shim "${BASH_SOURCE[0]}")
if [[ "${BASH_SOURCE[0]}" == "/"* ]]; then
bash_source_abs="$(realpath "${BASH_SOURCE[0]}")"
pwd_abs="$(realpath ".")"
bash_source_rel=${bash_source_abs#"${pwd_abs}/"}
else
bash_source_rel="${BASH_SOURCE[0]}"
fi
script_dir=$(dirname_shim "${bash_source_rel}")
toolchain_path_prefix="%{toolchain_path_prefix}"
# Sometimes this path may be an absolute path in which case we dont do anything because
# This is using the host toolchain to build.
Expand Down