Ogeon / rust-on-raspberry-pi

[OUTDATED] Instructions for how to cross compile Rust projects for the Raspberry Pi
292 stars 15 forks source link

Can't find crate 'std' #9

Closed 5nyper closed 8 years ago

5nyper commented 8 years ago

I asked a question on Stack Overflow regarding an error I'm getting white cross-compiling after following your instructions:

http://stackoverflow.com/questions/34793607/cant-find-crate-for-std-while-cross-compiling-rust-project-for-arm

Any idea?

Ogeon commented 8 years ago

Hmm... Did you modify the script? Are you 100% sure the std library files are in $HOME/pi-rust?

5nyper commented 8 years ago

I did not, however I'm not exactly sure how to check if those files exist in $HOME/pi-rustbecause cding to that said that the directory did not exist.

also doing find $HOME/pi-rust returns that it does not exist

5nyper commented 8 years ago

a fellow rustacean on IRC suggested to mkdir the pi-rust dir before doing ./configure and so I did that and ran make install, everything was going fine until I got this:

g++: internal compiler error: Killed (program cc1plus)                                                                                                               
Please submit a full bug report,       
with preprocessed source if appropriate.                                                                                                                             
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.                                                                                                    
/bin/rm: cannot remove '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/IR/Release/Function.d.tmp': No such file or directory                                   
/home/vikaton/rust/src/llvm/Makefile.rules:1521: recipe for target '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/IR/Release/Function.o' failed               
make[3]: *** [/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/IR/Release/Function.o] Error 1                                                                    
make[3]: Leaving directory '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/IR'                                                                                 
/home/vikaton/rust/src/llvm/Makefile.rules:880: recipe for target 'all' failed                                                                                       
make[2]: *** [all] Error 1                                                                                                                                           
make[2]: Leaving directory '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm'                                                                                        
/home/vikaton/rust/mk/llvm.mk:95: recipe for target '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/Release/bin/llvm-config' failed                                
make[1]: *** [/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/Release/bin/llvm-config] Error 2                                                                      
make[1]: Leaving directory '/home/vikaton/rust'                                                                                                                      
/home/vikaton/rust/mk/install.mk:22: recipe for target 'install' failed                                                                                              
make: *** [install] Error 2                                      
Ogeon commented 8 years ago

Looks like it either died because of a missing temp file or the temp file was to be removed after it died. Are there no other error explanation above the g++: line?

Also, it's important that you pass --target=arm-unknown-linux-gnueabihf --prefix=$HOME/pi-rust to ./configure each time. Otherwise it will most likely reconfigure it for your host system.

I'm currently running the build myself, so we'll see how that goes...

Ogeon commented 8 years ago

My build just finished and the library files were placed in ~/pi-rust/lib/, as expected.

I see that you have a 64 bit system. I would recommend that you use the 64 bit everything for this. Try to open a new shell and run in the rust dir:

  1. make clean
  2. git reset --hard 1.5.0
  3. export PATH=~/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH
  4. ./configure --target=arm-unknown-linux-gnueabihf --prefix=$HOME/pi-rust
  5. make -j4 && make install
  6. ls ~/pi-rust/lib
5nyper commented 8 years ago

did as you said (except git resting to 1.5.0, I need nightly) and got another g++ compiler error:

g++: internal compiler error: Killed (program cc1plus)                                                                                               
Please submit a full bug report,                                                                                                                     
with preprocessed source if appropriate.                                                                                                             
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.                                                                                    
/bin/rm: cannot remove '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support/Release+Asserts/CommandLine.d.tmp': No such file or directory   
/home/vikaton/rust/src/llvm/Makefile.rules:1514: recipe for target '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support/Release+Asserts/Comm
andLine.o' failed                                                                                                                                    
make[2]: *** [/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support/Release+Asserts/CommandLine.o] Error 1                                    
make[2]: *** Waiting for unfinished jobs....                                                                                                         
make[2]: Leaving directory '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support'                                                            
/home/vikaton/rust/src/llvm/Makefile.rules:873: recipe for target 'all' failed                                                                       
make[1]: *** [all] Error 1                                                                                                                           
make[1]: Leaving directory '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm'                                                                        
/home/vikaton/rust/mk/llvm.mk:61: recipe for target '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/Release+Asserts/bin/llvm-config' failed        
make: *** [/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/Release+Asserts/bin/llvm-config] Error 2                                                 
ls: cannot access /home/vikaton/pi-rust/lib: No such file or directory         
Ogeon commented 8 years ago

Do you mind trying it anyway, just to be on the safe side?

On Fri, Jan 15, 2016, 15:42 Sinatra notifications@github.com wrote:

did as you said (except git resting to 1.5.0, I need nightly) and got another g++ compiler error:

g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.

9/README.Bugs> for instructions. /bin/rm: cannot remove '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support/Release+Asserts/CommandLine.d.tmp': No such file or directory /home/vikaton/rust/src/llvm/Makefile.rules:1514: recipe for target '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support/Release+Asserts/Comm andLine.o' failed make[2]: * [/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support/Release+Asserts/CommandLine.o] Error 1 make[2]: * Waiting for unfinished jobs.... make[2]: Leaving directory '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/lib/Support' /home/vikaton/rust/src/llvm/Makefile.rules:873: recipe for target 'all' failed make[1]: * [all] Error 1 make[1]: Leaving directory '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm' /home/vikaton/rust/mk/llvm.mk:61: recipe for target '/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/Release+Asserts/bin/llvm-config' failed make: * [/home/vikaton/rust/x86_64-unknown-linux-gnu/llvm/Release+Asserts/bin/llvm-config] Error 2 ls: cannot access /home/vikaton/pi-rust/lib: No such file or directory

— Reply to this email directly or view it on GitHub https://github.com/Ogeon/rust-on-raspberry-pi/issues/9#issuecomment-171977730 .

5nyper commented 8 years ago

When I try resetting I get a git error

Unable to checkout '3564439515985dc1cc0d77057ed00901635a80ad' in submodule path 'src/llvm'                                                                           
configure: error: git failed                                                                                                                                         
/home/vikaton/rust/mk/reconfig.mk:42: recipe for target 'config.stamp' failed                                                                                        
make: *** [config.stamp] Error 1                                                    

This is saddening :(

Ogeon commented 8 years ago

Something seems really off... I did the exact thing I described before, without any problem. The only difference was that I ran git fetch master first.

On Fri, Jan 15, 2016, 18:14 Sinatra notifications@github.com wrote:

When I try resetting I get a git error

Unable to checkout '3564439515985dc1cc0d77057ed00901635a80ad' in submodule path 'src/llvm' configure: error: git failed /home/vikaton/rust/mk/reconfig.mk:42: recipe for target 'config.stamp' failed make: *\ [config.stamp] Error 1

This is saddening :(

— Reply to this email directly or view it on GitHub https://github.com/Ogeon/rust-on-raspberry-pi/issues/9#issuecomment-172019409 .

5nyper commented 8 years ago

Are you able to get on IRC anytime soon?

Ogeon commented 8 years ago

Sure, I'll be on #rust in a moment.

On Fri, Jan 15, 2016, 18:24 Sinatra notifications@github.com wrote:

Are you able to get on IRC anytime soon?

— Reply to this email directly or view it on GitHub https://github.com/Ogeon/rust-on-raspberry-pi/issues/9#issuecomment-172023871 .

Ogeon commented 8 years ago

For any future visitors: We discussed the problem on IRC and messed around with it a lot. What we, finally, arrived at was that libstd was missing because Rust couldn't be compiled, and Rust couldn't be compiled because of some internal error in g++. This internal error may or may not have been an out-of-memory thing. There was no error in these instructions and that's why we decided to close this issue.