Go to Post Excuse me while I rant on your comment here a bit. - Andrew Remmers [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 17-09-2014, 12:44
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by yash101 View Post
Thanks! I'm quite new to cross-compiling. I want to have a cross compiler ready for the RoboRIO so I can push my software as soon as possible!
Patrick has been working hard to make gcc 4.9 available on all platforms (mac, linux, windows). Unless you have some specific needs that aren't met by that, you are better off using the provided and supported compiler. 971 is looking forwards to the opposite. Not having to build a custom cross-compiler to get our code to work.
  #17   Spotlight this post!  
Unread 18-09-2014, 00:31
bb010g's Avatar
bb010g bb010g is offline
User, Registered
AKA: Brayden
FRC #3223 (POKER Robotics)
Team Role: Programmer
 
Join Date: Nov 2013
Rookie Year: 2014
Location: United States
Posts: 5
bb010g is an unknown quantity at this point
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by AustinSchuh View Post
One of my eventual goals is to set up Clang as well.
As a Functional Freak™ (Haskell) I'd be more than willing to work with you on getting a LLVM backend working. Are you planning on putting or currently have a GitHub repo up?
  #18   Spotlight this post!  
Unread 18-09-2014, 12:39
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by bb010g View Post
As a Functional Freak™ (Haskell) I'd be more than willing to work with you on getting a LLVM backend working. Are you planning on putting or currently have a GitHub repo up?
I've got enough projects lined up, ignoring my day job, that it will probably be next year before I mess with a clang cross compiler. The roboRIO isn't a very arcane backend. It probably just requires the correct compiler options when building the compiler. (softfp ARM backend with NEON)
  #19   Spotlight this post!  
Unread 19-09-2014, 12:48
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by AustinSchuh View Post
I've got enough projects lined up, ignoring my day job, that it will probably be next year before I mess with a clang cross compiler. The roboRIO isn't a very arcane backend. It probably just requires the correct compiler options when building the compiler. (softfp ARM backend with NEON)
If I had infinite time I would be trying to get a Rust compiler going for the roboRIO (also if I still had access to hardware). If it was stable, it would be a cool fit with all of its compile-time memory safety guarantees.

It would be insanely useless due to Rust's lack of c++ interop at the current moment, so WPILib wouldn't work, but it would still be a fun project.

EDIT: Actually, with existing toolchains, this might not be all that hard. See ya on the flipside, I'm going in.

EDIT 2: @Patrick:
  1. Where did you get those linux headers?
  2. How did you compile those libc6 binaries? Bootstrapped GCC?

EDIT 3: Homebrew formulae for OSX folks. https://github.com/mcoffin/homebrew-frc

EDIT 4: Is there a way to make it so I don't have to pass the -B option at runtime to the compile to get it to use the correct binutils instead of my system binutils?

EDIT 5: Rust compiler added to homebrew formulae.
__________________
Team 662 - Student/Programming VP/Driver - (2011-2013) - 43-31-2
Team 662 - Mentor - (2015-present) - 0-0-0

Last edited by CodeYeti : 19-09-2014 at 22:44. Reason: EDIT 5
  #20   Spotlight this post!  
Unread 20-09-2014, 18:02
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,171
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Anyone know if we can get the project files or options NI/WPI used to configure the busybox build? Might be nice to build a new version and add some features here and there.
__________________
Fast, cheap or working - pick any two!
  #21   Spotlight this post!  
Unread 20-09-2014, 19:42
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,756
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Are you looking for this? https://github.com/ni

Greg McKaskle
  #22   Spotlight this post!  
Unread 20-09-2014, 22:48
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by CodeYeti View Post
If I had infinite time I would be trying to get a Rust compiler going for the roboRIO (also if I still had access to hardware). If it was stable, it would be a cool fit with all of its compile-time memory safety guarantees.

It would be insanely useless due to Rust's lack of c++ interop at the current moment, so WPILib wouldn't work, but it would still be a fun project.

EDIT: Actually, with existing toolchains, this might not be all that hard. See ya on the flipside, I'm going in.

EDIT 2: @Patrick:
  1. Where did you get those linux headers?
  2. How did you compile those libc6 binaries? Bootstrapped GCC?

EDIT 3: Homebrew formulae for OSX folks. https://github.com/mcoffin/homebrew-frc

EDIT 4: Is there a way to make it so I don't have to pass the -B option at runtime to the compile to get it to use the correct binutils instead of my system binutils?

EDIT 5: Rust compiler added to homebrew formulae.
Oooh... Rust! I though about that awhile ago also...

linux headers and libc6 are from my download script in https://bitbucket.org/byteit101/tool...ilder/src/tip/

Also please update the homebrew formula with my latest updates on the mac folder in the above link. Not sure about the B, but my sources work without that. If you get the headers and libc and gdb all mirroring my mac folder, we might be able to make it official. (Note: I am not the Mouth of Sauron)

Also not Mouth of Sauron: Beta teams should be expecting 4.9 to land sometime early next week if all goes well. Currently migrating our jenkins server to use 4.9.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #23   Spotlight this post!  
Unread 21-09-2014, 03:13
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by byteit101 View Post
Oooh... Rust! I though about that awhile ago also...

linux headers and libc6 are from my download script in https://bitbucket.org/byteit101/tool...ilder/src/tip/

Also please update the homebrew formula with my latest updates on the mac folder in the above link. Not sure about the B, but my sources work without that. If you get the headers and libc and gdb all mirroring my mac folder, we might be able to make it official. (Note: I am not the Mouth of Sauron)

Also not Mouth of Sauron: Beta teams should be expecting 4.9 to land sometime early next week if all goes well. Currently migrating our jenkins server to use 4.9.
Yea I fixed that option. It's actually a known problem with both Homebrew's default GCC formula (and also mine). I build a workaround by symlinking the target tuple directory (that should be in /usr/local) between the two kegs.

Updating now (spend the whole day skydiving).

Note that the rust build is currently broken as GYP doesn't correctly detect non-clang compilers on OSX when passed with just the CC environment variable. Looking at workarounds now.
__________________
Team 662 - Student/Programming VP/Driver - (2011-2013) - 43-31-2
Team 662 - Mentor - (2015-present) - 0-0-0
  #24   Spotlight this post!  
Unread 22-09-2014, 17:24
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Well, it took many acts of god, but I've gotten the Rust compiler seemingly operational. Now, I don't have any hardware yet (I'm looking for accommodations), but here's an executable that should print "Hello FRC!" for the brave. It would be nice to hear whether it works or not. I've included source, but until I come up with a nice way to build the rust toolchain (I was interrupting the build and calling some targets manually) then I won't bother writing up a guide on how to do so.

A zip file with the source of the executable (and the executable itself so you don't have to build the toolchain) is attached.
Attached Files
File Type: zip rustbot.zip (459.8 KB, 13 views)
__________________
Team 662 - Student/Programming VP/Driver - (2011-2013) - 43-31-2
Team 662 - Mentor - (2015-present) - 0-0-0
  #25   Spotlight this post!  
Unread 22-09-2014, 17:41
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by CodeYeti View Post
It would be nice to hear whether it works or not.
Code:
roboRIO:/tmp# ./frc_user_program 
Hello FRC!
roboRIO:/tmp#
  #26   Spotlight this post!  
Unread 22-09-2014, 17:48
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by AustinSchuh View Post
Code:
roboRIO:/tmp# ./frc_user_program 
Hello FRC!
roboRIO:/tmp#
Holy crap. Thanks. I didn't expect that at all because that's including all of the rust standard libraries (I was expecting to have to strip the standard libraries out due to the way rust's stdlib depends on thread-local storage in weird ways).

Great great great news. I'm going to start looking for hardware I can play around with.

EDIT: I'm getting pretty darn excited by the possibilities with this.
__________________
Team 662 - Student/Programming VP/Driver - (2011-2013) - 43-31-2
Team 662 - Mentor - (2015-present) - 0-0-0

Last edited by CodeYeti : 22-09-2014 at 17:51.
  #27   Spotlight this post!  
Unread 22-09-2014, 21:06
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by CodeYeti View Post
Holy crap. Thanks. I didn't expect that at all because that's including all of the rust standard libraries (I was expecting to have to strip the standard libraries out due to the way rust's stdlib depends on thread-local storage in weird ways).

Great great great news. I'm going to start looking for hardware I can play around with.

EDIT: I'm getting pretty darn excited by the possibilities with this.
FYI following the instructions on the rust wiki worked flawlessly (after changing the triplet) for me, though my compiler command is obscene:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/patrick/code/frc-rust/lib bin/rustc --target=arm-unknown-linux-gnueabi -C linker=arm-frc-linux-gnueabi-g++ test.rs

I did go to the WPI ACM's language lab and ran all the rust code on the RoboRIO. Haven't encountered any errors so far...
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #28   Spotlight this post!  
Unread 22-09-2014, 22:10
CodeYeti's Avatar
CodeYeti CodeYeti is offline
FRC Addict
AKA: Matt Coffin
FRC #0662 (Rocky Mountain Robotics)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Colorado
Posts: 81
CodeYeti is an unknown quantity at this point
Re: GCC 4.9 arm-nilrt-linux-gnueabi toolchain

Quote:
Originally Posted by byteit101 View Post
FYI following the instructions on the rust wiki worked flawlessly (after changing the triplet) for me, though my compiler command is obscene:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/patrick/code/frc-rust/lib bin/rustc --target=arm-unknown-linux-gnueabi -C linker=arm-frc-linux-gnueabi-g++ test.rs

I did go to the WPI ACM's language lab and ran all the rust code on the RoboRIO. Haven't encountered any errors so far...
Yea the acts of god were all caused by the external build system of the libuv component. It uses gyp, which doesn't play very nicely when your host compiler is clang and target compiler is GNU. It starts mixing up the flags in different areas.

EDIT: Also for some reason the cross compiler envirionment varibales weren't getting passed correctly to GYP. https://github.com/rust-lang/rust/pull/17449

EDIT 2: You need not have multiple rustc installations for all your toolchains, just build one with all your targets, then pass --target at runtime when not building for your host. So you can install frc-rust as just rustc under /usr/local if you want.
__________________
Team 662 - Student/Programming VP/Driver - (2011-2013) - 43-31-2
Team 662 - Mentor - (2015-present) - 0-0-0

Last edited by CodeYeti : 22-09-2014 at 22:14. Reason: formatting
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi