Skip to content

Commit

Permalink
bin/xcompile: set more paths/variables appropriately
Browse files Browse the repository at this point in the history
Cargo apparently needs to be told explicitly what linker to use now (it
doesn't automatically look for a linker prefixed with the target
triple), and the root path needs to be absolute for some various C
dependencies' build scripts to work correctly.
  • Loading branch information
benesch committed Apr 18, 2020
1 parent 9e52887 commit 5af08de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/xcompile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

set -euo pipefail

root=$(dirname "$0")/..
root=$(cd "$(dirname "$0")/.." && pwd)

# shellcheck source=SCRIPTDIR/../misc/shlib/shlib.bash
. "$root/misc/shlib/shlib.bash"
Expand Down Expand Up @@ -61,6 +61,7 @@ do_cargo() {
export TARGET_CXX=$CXX
export TARGET_CFLAGS=$CFLAGS
export TARGET_CXXFLAGS=$CXXFLAGS
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=$CC

cargo "$subcommand" --target=x86_64-unknown-linux-gnu "$@"
}
Expand Down

0 comments on commit 5af08de

Please sign in to comment.