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âŚ
# 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 :D) and ensure there are no symbol/ABI conflicts, go here:
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!