|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
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 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. |
|
#2
|
||||
|
||||
|
Re: Alternate GCC Toolchain
Why ? Having a C compiler that is ten years old should be solid, reliable, and mature.
Just like all those old mentors that volunteer for FIRST !! |
|
#3
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Why doesn't everyone just use 6 wheel tank drive, which is arguably more solid and reliable?
|
|
#4
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Quote:
![]() |
|
#5
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Yeah, I can't even get it to compile. It looks like it fails with:
Code:
/bin/bash: MULTIDIR: command not found Would it be possible to just zip the /usr/powerpc-wrs-vxworks folder so I wouldn't have to worry about it? Last edited by agartner01 : 04-11-2012 at 15:48. |
|
#6
|
||||
|
||||
|
Re: Alternate GCC Toolchain
Quote:
|
|
#7
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Quote:
In all seriousness, because it runs natively on linux, supports c++11 and has much better compliance with c++03, has better optimizations, runs faster (AFAIK), and because IT'S SHINY AND NEW! Also, WRT to the MULTIDIR thing, that's not a fatal error. Double-check that /usr/powerpc-wrs-vxworks/include is a symlink to sys-include/wrn/coreip. Make sure that /usr/powerpc-wrs-vxworks/sys-include contains files that make sense (vxWorks.h, stdio.h, etc.) I was typing those commands into a post box, not into a terminal, so it might have a typo... |
|
#8
|
||||
|
||||
|
Re: Alternate GCC Toolchain
Hey, I'm just asking. I like shiny and new too. I'm all for innovation.
What I'm curious in learning is why so much embedded C still uses the 3.4.4 version, not the 4.xx series of gcc. That said, what are the risks of using 4.x versus 3.4.4 in an embedded system. I know there are substantial language compliance differences and I'm curious as to how that drills down the particular FRC application we deal with. I'm all for innovation. I just want to know what the innovation is. That's all. And thanks, I'm glad to see the project... |
|
#9
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Checked it again. Still not able to compile. Heres what I get:
Code:
/bin/bash: MULTIDIR: command not found /bin/bash: MULTIDIR: command not found /home/alex/gcc-build/./gcc/as: 87: exec: /usr/powerpc-wrs-vxworks/bin/as: not found make[2]: *** [tramp_s.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /home/alex/gcc-build/./gcc/as: 87: exec: /usr/powerpc-wrs-vxworks/bin/as: not found make[2]: *** [enable-execute-stack.o] Error 1 /home/alex/gcc-build/./gcc/as: 87: exec: /usr/powerpc-wrs-vxworks/bin/as: not found make[2]: *** [eabi_s.o] Error 1 /home/alex/gcc-build/./gcc/as: 87: exec: /usr/powerpc-wrs-vxworks/bin/as: not found make[2]: *** [unwind-dw2.o] Error 1 make[2]: Leaving directory `/home/alex/gcc-build/powerpc-wrs-vxworks/libgcc' make[1]: *** [all-target-libgcc] Error 2 make[1]: Leaving directory `/home/alex/gcc-build' make: *** [all] Error 2 Also included an overview of the powerpc-wrs-vxworks folder. Last edited by agartner01 : 04-11-2012 at 23:10. |
|
#10
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Quote:
|
|
#11
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Quote:
Code:
/usr/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/bin/ld: cannot find -lstdc++ |
|
#12
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Quote:
I can't seem to edit my original post anymore, so please do this or you will get errors... |
|
#13
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Ok, now it get this:
Code:
/usr/bin/powerpc-wrs-vxworks-c++ -nostdlib -r -Wl,-X -static CMakeFiles/cmTryCompileExec2792526235.dir/testCXXCompiler.cxx.obj -o cmTryCompileExec2792526235_PartialImage.out -lsupc++ -lstdc++ -lgcc /usr/local/powerpc-wrs-vxworks/munch.sh powerpc-wrs-vxworks-nm cmTryCompileExec2792526235_ctdt.c cmTryCompileExec2792526235_PartialImage.out Error running link command: No such file or directory Quote:
Code:
/usr/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/bin/ld: cannot open linker script file /usr/local/powerpc-wrs-vxworks/wind_base/target/h/tool/gnu/ldscripts/link.OUT: No such file or directory collect2: error: ld returned 1 exit status make[1]: *** [cmTryCompileExec1263306447] Error 1 Last edited by agartner01 : 05-11-2012 at 09:48. |
|
#14
|
|||
|
|||
|
Re: Alternate GCC Toolchain
That's a known bug. Look in the old thread, make the symlinks described, and you should be good.
I haven't been updating the toolchain file as I've been *very* busy working with the GCC devs to get everything working on VxWorks out-of-the-box. Again, this is still experimental until I get everything updated and get some binary packages out. I wanted to give the adventurous a chance to play around with it in advance though ![]() |
|
#15
|
|||
|
|||
|
Re: Alternate GCC Toolchain
Alright! After a few more symlinks, cmake and make ran without incident. Build of wpilib succeeded. I'll test it on our robot tomorrow and see if it works. Thanks for all the hard work!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|