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

Output of an --emit dependent on other outputs present #12992

Closed
cceckman opened this issue Mar 18, 2014 · 6 comments · Fixed by #13074
Closed

Output of an --emit dependent on other outputs present #12992

cceckman opened this issue Mar 18, 2014 · 6 comments · Fixed by #13074

Comments

@cceckman
Copy link

Passing rustc the --emit=bc flag and passing --emit=bc,link may produce different .bc files (that is, outputs). This is true of rust-core (see below), though was not the case for a simpler ("Hello, world!") test file.

Test script:

#!/bin/bash

mkdir bc
mkdir bclink
git clone git@github.com:thestinger/rust-core

rustc --emit=bc --out-dir=bc rust-core/core/lib.rs
rustc --emit=bc,link --out-dir=bclink rust-core/core/lib.rs

diff bc/core.bc bclink/core.bc

Diff output indicates binary files differ.

Tested with rustc 0.10-pre (0a181a8 2014-03-17 09:57:06 -0700), rust-core on dd0584450. rustc compiled from master on Arch Linux.

If this is, in fact, expected behavior- sorry for the trouble, unexpected to me.

cceckman referenced this issue in cceckman/ironkernel Mar 18, 2014
Updated the UART implementation and modified the 926 to use it. Also
have updated to use rust's master branch, will try to maintain
compatibilty therewith. Some odd fixes to do so (instance: extracting
core.bc from libcore*.rlib doesn't work, so compiling core.bc on its
own.)
@alexcrichton
Copy link
Member

Can you provide a diff between the outputs? This is likely a known issue, but I would like to be sure.

@cceckman
Copy link
Author

.bc is a binary format, so diff just gives "Binary files bc/core.bc and bclink/core.bc differ" as its output. On my machine, bclink/core.bc is 19K and bc/core.bc is 62K.

I'm not familiar enough with the format to extract much more data.

@cceckman
Copy link
Author

I note the difference persists when the second line is

rustc  --emit=bc --emit=link --out-dir=bclink rust-core/core/lib.rs

(two separate --emit flags), though both produce both artifacts.

@alexcrichton
Copy link
Member

Can you pass emit=ir and diff those outputs?

@cceckman
Copy link
Author

With emit flags as --emit=ir and --emit=ir,link respectively, there is no difference in bc/core.ll and bclink/core.ll (according to diff.)

@pczarn
Copy link
Contributor

pczarn commented Mar 18, 2014

It seems that every bytecode is invalid only when a rlib is produced.

It stopped working between rust-git-0.9.1301 and 1362 (shortly before 329fcd4 2014-02-23 15:37:05 -0800).

Going back thorugh the log, I found #12448.

I believe that --emit=bc,link --crate-type=rlib creates deflated bytecode. Perhaps *.rlib(*.bc) should be stored with extension .bc.flate or flate.bc.

bors added a commit that referenced this issue Mar 23, 2014
Fixes #12992

I tried to increase the number of deflate's probes. Reduction of 0.5% or 2% is not enough.
@bors bors closed this as completed in f0f5072 Mar 23, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Aug 16, 2022
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 27, 2024
bump strip-ansi-escapes

This bumps `strip-ansi-escapes` to remove arrayvec from it's deps (luser/strip-ansi-escapes#8)

Should Cargo.lock be commited too to track it's working state?

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants