Stream: general

Topic: rustc debug

Jethro (Dec 11 2018 at 13:21, on Zulip):

Are there any Linux rustc builds with debug symbols available or will I have to build my own?

RalfJ (Dec 11 2018 at 13:29, on Zulip):

@Jethro there are the alt builds, AFAIK they have debug symbols. you can install them via

simulacrum (Dec 11 2018 at 13:30, on Zulip):

I don't believe they do but would be happy to be wrong -- they exist primarily to enable LLVM asserts

Jethro (Dec 11 2018 at 13:31, on Zulip):

you mean to disable?

simulacrum (Dec 11 2018 at 13:32, on Zulip):

LLVM asserts are not enabled on regular builds; alt builds enable those

RalfJ (Dec 11 2018 at 13:33, on Zulip):

oh was it just LLVM asserts? dang, I thought it was all sorts of debug asserts

simulacrum (Dec 11 2018 at 13:36, on Zulip):

Looks like verify-llvm-ir and llvm-asserts are the only two options enabled by alt builds

Jethro (Dec 11 2018 at 13:37, on Zulip):

did that change? it used to be other other way around

simulacrum (Dec 11 2018 at 13:38, on Zulip):

A while back, yeah

Jethro (Dec 11 2018 at 14:16, on Zulip):

so I built the compiler with ./ build --stage=0 src/rustc, but I can't quite figure out how to run it

RalfJ (Dec 11 2018 at 14:17, on Zulip):

@Jethro first, build it with ./ build --stage 1 src/libtest (EDIT: should have been libtest, sorry)

RalfJ (Dec 11 2018 at 14:17, on Zulip):

or else you got yourself a nice compiler without a libstd, which is not very useful :P

RalfJ (Dec 11 2018 at 14:18, on Zulip):

second, add the stage 1 sysroot to rustup. that'd be using rustup toolchain link, and the sysroot lives in build/*/stage1

RalfJ (Dec 11 2018 at 14:20, on Zulip):

then you can use that toolchain like any other. it is not 100% feature complete (compiler plugins and things needing rustc_private won't work, but as of recently, proc macros should work) but should get you quite far

Jethro (Dec 11 2018 at 14:22, on Zulip):

nevermind, @Alex Crichton saves the day and frees me from having to build the compiler :)

Jethro (Dec 11 2018 at 14:45, on Zulip):

@RalfJ just for future reference, I only cared about the frontend, I only wanted to use rustc --print, would've that been possible with just the stage0?

RalfJ (Dec 11 2018 at 14:57, on Zulip):

@Jethro I would be surprised but I don't know

RalfJ (Dec 11 2018 at 14:58, on Zulip):

and anyway, libtest adds just ~90s to the build time (if you don't need proc_macros or libtest, you can use libstd which takes just ~60s)

Jethro (Dec 11 2018 at 15:01, on Zulip):

no it was starting to build LLVM, which it wasn't doing before

RalfJ (Dec 11 2018 at 15:02, on Zulip):

oh, I keep forgetting about the codegen backends

Jethro (Dec 11 2018 at 15:03, on Zulip):

actually I guess --print cfg needs the codegen backend to properly interpret the features, so probably no deal

Last update: Jun 04 2020 at 16:30UTC