Go to Post Someone once said, "I know what finished is, and I know what a robot is, but what is this finished robot you speak of?" - EricH [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

 
 
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 04-11-2012, 00:29
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Alternate GCC Toolchain

Hi all,

Just an update as everyone starts thinking about the 2013 FRC season, the patches that I and several others wrote have now been officially integrated into the GCC mainline.

Now, having undergone the sad ordeal of graduating from high school and FRC last year, I am faced with not being able to test anything beyond compile time. So, I leave it open to everyone else to test out

Between college and working with the GCC devs I haven't had time to update the whole buildsystem yet, but EXPECT TO SEE BINARY PACKAGES SOON

For those of you who can't wait, here's how you can build GCC for vxworks on your very own:

NOTE: Lines starting with # must be run as root, and you need to have gcc, flex, bison, libmpfr-dev, libgmp-dev, libmpc-dev (or whatever the equivalents are for your distro) installed

NOTE2: If someone wants to mirror the snapshot of GCC that would be awesome as github has to dynamically regenerate it every time someone downloads it (though this is still faster than checking out on cvs...). I'd do it but my school doesn't like people tunneling out of their network...

Code:
# mkdir -p /usr/powerpc-wrs-vxworks/wind_base
# mkdir -p /usr/powerpc-wrs-vxworks/include
# echo 'export WIND_BASE=/usr/powerpc-wrs-vxworks/wind_base' >> /etc/profile
$ source /etc/profile
$ wget https://github.com/mirrors/gcc/archive/master.zip
$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2
$ wget ftp://ftp.ni.com/pub/devzone/tut/updated_vxworks63gccdist.zip
$ unzip gcc-master.zip
$ tar -jxf binutils-2.22.tar.bz2
$ unzip updated_vxworks63gccdist.zip
# mkdir -p $WIND_BASE/target
# cp -r gccdist/WindRiver/vxworks-6.3/host/. $WIND_BASE/host
# ln -s /usr/powerpc-wrs-vxworks/sys-include $WIND_BASE/target/h
# cp -r gccdist/WindRiver/vxworks-6.3/target/h/. /usr/powerpc-wrs-vxworks/sys-include
# ln -s sys-include/wrn/coreip /usr/powerpc-wrs-vxworks/include
$ mkdir binutils-build
$ cd binutils-build
$ ../binutils-2.22/configure --prefix=/usr --target=powerpc-wrs-vxworks --disable-nls
$ make -j4
# make install
$ cd ..
$ mkdir gcc-build
$ cd gcc-build
$ ../gcc-master/configure --prefix=/usr --target=powerpc-wrs-vxworks --with-gnu-as --with-gnu-ld --with-headers --disable-shared --disable-libssp --disable-multilib --with-float=hard --enable-languages=c,c++ --enable-threads=vxworks --without-gconv --disable-libgomp --disable-nls --disable-libmudflap --with-cpu-PPC603 --disable-symvers
$ make -j4
# make install
AND YOU'RE DONE!

That was a mouthful. This is why I will work to get those binaries out to you all soon . Let me know if I made a typo. I haven't tested this as rigorously as I usually do for my builds, and I haven't rebuilt binutils in a while, but I wanted to get this out to you all early so that I could see if there's any runtime issues people run into.

HOW TO BUILD:

You can manually hack a UCPP makefile, OR, you can use cmake. Links:

https://github.com/rbmj/cmake_vxworks

and, to build a better WPILib (I mean, they had to make the compiler's optimizations better since 3.x ) and ensure there are no symbol/ABI conflicts, go here:

https://github.com/rbmj/wpilib

I submitted the necessary patches to firstforge at the end of last season, but they have a pretty closed development model... Also, I'm not sure how much they are into supporting unofficial toolchains, though technically all of the changes are necessary for standards compliance as old GCC accepts stuff it shouldn't... but I digress.

Lobby FIRST/WRS/NI to use a compiler that *isn't* ten years old!

[BUGS/TODO]:

Also, a very broken build of fortran can be made by using --enable-languages=c,c++,fortran. However, this misconfigures itself horribly, so you'll need to go in and edit the config.h file by hand *bleh*. Go support is also in the works. However, at least for me, these are both lower priorities unless people here say they're really interested in these, as they aren't currently used by FRC. Also know, that the best way to get this done faster if you care is to do it yourself Just share with everyone else too!

The entire C++11 standard library (as it is/will be known by GCC 4.8 - freeze should be this week, so no major changes) *should* work. There might be one minor bug in thread-specific data corner cases, but other than that, please test all of the new features you can think of! And then use them so we don't have spaghetti code! TEST TEST TEST TEST PLEASE!

Last edited by rbmj : 04-11-2012 at 23:23.
 


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:08.

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