Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miri build script: support building miri in debug mode; avoid rebuilding Miri on CI #747

Merged
merged 7 commits into from
May 29, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
tweak logic for determining rustc default target
  • Loading branch information
RalfJung committed May 29, 2019
commit 16cc5ddacbde23a71d05535f6b51298d295535df
12 changes: 9 additions & 3 deletions miri
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ EOF
)

## Preparation
# I'd love to use `jq` for parsing the JSON properly, but macOS is totally underequipped for this kind of work.
TARGET=$(rustc --print target-spec-json -Z unstable-options | grep llvm-target | cut -d '"' -f 4)
TARGET=$(rustc --version --verbose | grep "^host:" | cut -d ' ' -f 2)
SYSROOT=$(rustc --print sysroot)
LIBDIR=$SYSROOT/lib/rustlib/$TARGET/lib
if ! test -d "$LIBDIR"; then
echo "Something went wrong determining the library dir."
echo "I got $LIBDIR but that does not exist."
echo "Please report a bug at https://github.com/rust-lang/miri/issues."
exit 2
fi
# We set the rpath so that Miri finds the private rustc libraries it needs.
# We enable debug-assertions to get tracing.
# We enable line-only debuginfo for backtraces.
export RUSTFLAGS="-C link-args=-Wl,-rpath,$SYSROOT/lib/rustlib/$TARGET/lib -C debug-assertions -C debuginfo=1"
export RUSTFLAGS="-C link-args=-Wl,-rpath,$LIBDIR -C debug-assertions -C debuginfo=1"

## Helper functions

Expand Down