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

Can't compile core for msp430 in release mode #45836

Closed
japaric opened this issue Nov 7, 2017 · 1 comment · Fixed by #47453
Closed

Can't compile core for msp430 in release mode #45836

japaric opened this issue Nov 7, 2017 · 1 comment · Fixed by #47453
Labels
C-bug Category: This is a bug.

Comments

@japaric
Copy link
Member

japaric commented Nov 7, 2017

$ rustup default nightly-2017-11-04

$ rustup component add rust-src

$ cp -r $(rustc --print sysroot)/lib/rustlib/src/rust/src .

$ cd src/libcore

$ cargo build --target msp430-none-elf --release
   Compiling core v0.0.0 (file:///home/japaric/tmp/src/libcore)
error: linking with `msp430-elf-gcc` failed: exit code: 1
  |
  = note: "msp430-elf-gcc" "-mcpu=msp430" "-c" "-o" "/home/japaric/tmp/src/libcore/target/msp430-none-elf/release/deps/core-610eca78cd1149b2.o" "/home/japaric/tmp/src/libcore/target/msp430-none-elf/release/deps/core-610eca78cd1149b2.s"
  = note: msp430-elf-gcc: error: /home/japaric/tmp/src/libcore/target/msp430-none-elf/release/deps/core-610eca78cd1149b2.s: No such file or directory
          msp430-elf-gcc: fatal error: no input files
          compilation terminated.


error: aborting due to previous error

error: Could not compile `core`.

$ ls target/msp430-none-elf/release/deps
core-610eca78cd1149b2.core0.rust-cgu.bytecode.encoded  core-610eca78cd1149b2.core0.rust-cgu.s  core-610eca78cd1149b2.crate.metadata.rust-cgu.o  core-610eca78cd1149b2.d

cc @alexcrichton seems related to the thinLTO / codegen-unit changes. Seems like the name of the intermediate .s artifact changed but the "external assembler" logic wasn't updated to match the new name.

@kennytm kennytm added the C-bug Category: This is a bug. label Nov 7, 2017
@alexcrichton
Copy link
Member

Heh yeah I'd definitely beleive that! Anything related to the "don't use the integrated assembler" breaks all the time...

pftbest added a commit to pftbest/rust that referenced this issue Jan 15, 2018
Old implementation called the assembler once per crate, but we need to call
it for each object file instead, because a single crate can now have more
than one object file.

This patch fixes issue rust-lang#45836 (Can't compile core for msp430 in release mode)
alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 25, 2018
Fix no_integrated_as option to work with new codegen architecture.

Old implementation called the assembler once per crate, but we need to call
it for each object file instead, because a single crate can now have more
than one object file.

This patch fixes issue rust-lang#45836 (Can't compile core for msp430 in release mode)

This change can be tested on x86_64 using
```sh
export RUSTFLAGS="-C no_integrated_as -C save_temps"
```

r? @alexcrichton
cc @japaric
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants