Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Alternate GCC Toolchain (http://www.chiefdelphi.com/forums/showthread.php?t=109385)

CodeYeti 17-01-2013 16:53

Re: Alternate GCC Toolchain
 
Quote:

Originally Posted by rbmj (Post 1217350)
I'll upload the other files, which should help with building everything. These include .orig.tar.gz and .debian.tar.gz files IIRC.

The .orig files can be made with the following process with a git archive:

Code:

# in git archive for package $PKG
mkdir ../$PKG-$VERSION
git archive master | tar -x -C ../$PKG-$VERSION
cd ..
tar -cf $PKG_$VERSION.orig.tar $PKG-$VERSION
gzip $PKG_$VERSION.orig.tar
cd $PKG-$VERSION
debuild

Making these packages can be a pain in the rear. The debian/rules makefiles for gcc and wpilib are not code snippets I'm particularly proud of... but they work.

Also, if you make a mistake and the build dies, debian wants to completely rebuild the whole package from a distclean. So don't mess up when you're compiling GCC... you wouldn't believe how much time I wasted only to learn that I forgot to pass -e WIND_BASE to debuild...

I did the same thing, luckily, the first thing I did was check the config.log!

Regardless, ironically, I've got this stuff running on my mac via a manual install much better than I do on debian with the packages, but I'd love to help with development, and I want to stay current so I'm trying to switch over. Right now, theres something broken where its not finding the C++ includes (i.e. #include <string> won't work, etc) and I have no idea why. If anybody has run in to this, I'd appreciate a tip. Debugging as you're reading.

Also, just as a thought, since your debian package for wpilib has a builddep for cmake, and AFAIK, just invokes it, why don't you just use CPack? Seems like that would be a little bit cleaner solution, but that's just me.

EDIT: Still having that issue with the packages. I'm going to try the packages you built and see if that makes a difference. Just to make sure, I've been installing them in this order:
Code:

binutils
wrs-headers
gcc
buildscripts

Any help is appreciated.

rbmj 17-01-2013 17:41

Re: Alternate GCC Toolchain
 
Quote:

Originally Posted by CodeYeti (Post 1217419)
I did the same thing, luckily, the first thing I did was check the config.log!

Regardless, ironically, I've got this stuff running on my mac via a manual install much better than I do on debian with the packages, but I'd love to help with development, and I want to stay current so I'm trying to switch over. Right now, theres something broken where its not finding the C++ includes (i.e. #include <string> won't work, etc) and I have no idea why. If anybody has run in to this, I'd appreciate a tip. Debugging as you're reading.

Never seen that one... thanks for all your work testing/fixing/debugging!

Quote:

Also, just as a thought, since your debian package for wpilib has a builddep for cmake, and AFAIK, just invokes it, why don't you just use CPack? Seems like that would be a little bit cleaner solution, but that's just me.
Because CPack, though easy, doesn't handle dependencies, metadata, and maintainer scripts as nicely as the native toolchain does.

CodeYeti 17-01-2013 17:47

Re: Alternate GCC Toolchain
 
Quote:

Originally Posted by rbmj (Post 1217459)
Because CPack, though easy, doesn't handle dependencies, metadata, and maintainer scripts as nicely as the native toolchain does.

Alright. I didn't know it didn't have the capability to handle dependencies.

Also, I'm still having that same issue with not finding the C++ includes. <see above>

EDIT:If I'm asking a ton of questions, it's because this is more of a learning experience than a hardcore project for me :D.

EDIT 2: I installed the versions of the packages from your dropbox, and I'm still getting the c++ headers problem. The headers are in the exact same place as they are on my mac, where the whole system works (manual installs, no packages or anything).

rbmj 17-01-2013 17:56

Re: Alternate GCC Toolchain
 
Quote:

Originally Posted by CodeYeti (Post 1217463)
Alright. I didn't know it didn't have the capability to handle dependencies.

Also, I'm still having that same issue with not finding the C++ includes. <see above>

Stupid question: do the directories specified by `powerpc-wrs-vxworks-gcc -print-prog-name=cc1plus` -v exist and have contents that make sense?

I don't know why that's not working...

Quote:

EDIT:If I'm asking a ton of questions, it's because this is more of a learning experience than a hardcore project for me :D.
That's great :). Though I don't see why things can't be hardcore projects and learning experiences at the same time! ;)

CodeYeti 17-01-2013 18:02

Re: Alternate GCC Toolchain
 
Well there's the problem. It appears to be looking for the includes in /usr/local instead of /usr. Here's the output from your line of bash.
Code:

ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/include/c++/4.8.0"
ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/include/c++/4.8.0/powerpc-wrs-vxworks"
ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/include/c++/4.8.0/backward"
ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/sys-include"
ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/../../../../powerpc-wrs-vxworks/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/include
 /usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/include-fixed
End of search list.

This might be due to if finding things in /usr/local/lib that it shouldn't because of remnants of old installed-from-source toolchains. I'll try to get rid of breadcrumbs and report back.

EDIT: I think there's a bug in the wrs-headers-installer package. It doesn't actually remove a bunch of stuff, and I get a warning about the directory not being removed because its not empty. Here's the output.
Code:

mcoffin@mlc-debian-i7990x:~/Downloads$ sudo dpkg -P powerpc-wrs-vxworks-binutils powerpc-wrs-vxworks-gcc powerpc-wrs-vxworks-buildscripts wrs-headers-installer
(Reading database ... 120972 files and directories currently installed.)
Removing powerpc-wrs-vxworks-gcc ...
Purging configuration files for powerpc-wrs-vxworks-gcc ...
Removing powerpc-wrs-vxworks-buildscripts ...
dpkg: warning: while removing powerpc-wrs-vxworks-buildscripts, directory '/usr/powerpc-wrs-vxworks/share' not empty so not removed
Removing wrs-headers-installer ...
Purging configuration files for wrs-headers-installer ...
Removing powerpc-wrs-vxworks-binutils ...
dpkg: warning: while removing powerpc-wrs-vxworks-binutils, directory '/usr/powerpc-wrs-vxworks' not empty so not removed
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place


CodeYeti 17-01-2013 18:16

Re: Alternate GCC Toolchain
 
Well, after becoming pretty sure that I've removed all the breadcrumbs from having the compiler installed under /usr/local, I tried the process again, now it can't find any of the headers due to looking for them in /usr/local. Heres the new include search paths.
Code:

ignoring nonexistent directory "/usr/local/lib/../powerpc-wrs-vxworks/include/c++/4.8.0"
ignoring nonexistent directory "/usr/local/lib/../powerpc-wrs-vxworks/include/c++/4.8.0/powerpc-wrs-vxworks"
ignoring nonexistent directory "/usr/local/lib/../powerpc-wrs-vxworks/include/c++/4.8.0/backward"
ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/include"
ignoring nonexistent directory "/usr/local/lib/gcc/powerpc-wrs-vxworks/4.8.0/include-fixed"
ignoring nonexistent directory "/usr/local/lib/../powerpc-wrs-vxworks/sys-include"
ignoring nonexistent directory "/usr/local/lib/../powerpc-wrs-vxworks/include"

EDIT: Fixed this. I had old binaries in /usr/local/bin that were causing GCC to think that it was installed there.

EDIT 2: Only problem I'm having at the moment is cpack putting wpilib in the wrong spot. I'm trying to use cpack just to learn how to before reverting back to the regular packages. cpack seems to ignore CMAKE_INSTALL_PREFIX.

crynix 21-01-2013 07:36

Re: Alternate GCC Toolchain
 
Thank you for your work. I'll be mirroring the files at http://www.eshsrobotics.com/mirror/frctoolchain.zip

crynix 21-01-2013 22:21

Re: Alternate GCC Toolchain
 
Thank you for your work. I'll definitely be contributing to this project.

I'm mirroring your binaries on our team website http://eshsrobotics.com/mirror/frctoolchain.zip

I'll eventually set up a PPA.

CodeYeti 02-02-2013 15:47

Re: Alternate GCC Toolchain
 
Hi everybody. Just as an update, I've been dorking around with using lambda functions to define delegate math inline. For an example of the usage of a lambda function on a FIRST robot, take a quick look at the Loader::Loader(Joystick *) constructor in this file:
https://github.com/rmr662/temp-test-.../RMRLoader.cpp

Please note that this will only work with C++11.

CodeYeti 15-02-2013 01:07

Re: Alternate GCC Toolchain
 
Has anybody gotten the gcc-4.8 source package from experimental to build for powerpc-wrs-vxworks? It should work with a custom tarball but I want to know if anybody's done it before I delve into it and write a tutorial for no reason.

I thought I would get going on it since I just recently built my toolchain for arm-linux-gnueabihf.

I've managed to get at least the binutils to build for powerpc-wrs-vxworks with just the source package straight out of wheezy. I'll do some more testing when I get home, but as far as I can tell, the only major difference is going to be that internalization is enabled.

If anybody would like to help me out, I'll attach the binary package so you can give it a shot. Keep in mind that its not signed or anything as I'm not quite sure how that works yet.

If this does work with the rest of the toolchain, then we could update the dependencies for the other packages and deprecate the use of the custom package unless there's something that I'm missing.

http://temp-share.com/show/FHKdR60U6

codes02 16-02-2013 03:24

Re: Alternate GCC Toolchain
 
I've updated my build script to build a toolchain using a gcc snapshot and no patches to anything.

https://bitbucket.org/jmesmon/vxworks-gcc-patches

Keep in mind that this does delete quite a few directories, make sure you've read the script before using it.

Some caveats on this build and gcc in general:
  • I had to disable building of gcov via "inhibit_libc=true", the fixincludes don't work around it's use of open() or mkdir().
  • Setting WIND_BASE is still necessary (this is rather silly)
  • I haven't run this on a real robot. The only thing I've test built is here
  • I have set it to build libstdc++-v3, but I have no idea if that will work with vxworks.
  • I don't do any extraneous copying or symlinking. Issues with "coreip" are expected. Fixing these need changes to "-isystem" within gcc (coincidentally the same thing that hilariously wants WIND_BASE)

William Kunkel 16-02-2013 13:44

Re: Alternate GCC Toolchain
 
Hi everybody! I've been trying to get this built on my Gentoo box, but I've run into issues, and googling hasn't turned up anything. It compiles a few things, then I run into this:

Quote:

/bin/sh: MULTIDIR: command not found
/bin/sh: MULTIDIR: command not found
/bin/sh: MULTIDIR: command not found
In file included from /home/maraschinopanda/alt-gcc/gcc-build/gcc/include-fixed/unistd.h:13:0,
from ../../../gcc-master/libgcc/../gcc/tsystem.h:102,
from ../../../gcc-master/libgcc/libgcc2.c:27:
/home/maraschinopanda/alt-gcc/gcc-build/gcc/include-fixed/ioLib.h:148:21: fatal error: net/uio.h: No such file or directory
#include <net/uio.h>
^
compilation terminated.
Then the error cascades and make exits error code 2. Unfortunately, I don't know enough about GCC to diagnose the issue. Any pointers?

codes02 16-02-2013 14:41

Re: Alternate GCC Toolchain
 
Please Identify
  • the version of gcc used
  • the configure command used
  • the make command used

William Kunkel 16-02-2013 14:59

Re: Alternate GCC Toolchain
 
The output of gcc --version is:
Quote:

gcc (Gentoo 4.5.4 p1.0, pie-0.4.7) 4.5.4
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The configure command was:
Quote:

../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
And the make command was just
Quote:

make -j4
Thanks for the help!

codes02 16-02-2013 15:22

Re: Alternate GCC Toolchain
 
Quote:

Originally Posted by MaraschinoPanda (Post 1234413)
The output of gcc --version is:

Please indicate the version of the gcc source code you are building (not the version of gcc you are using to build it).

You may need to pass the location of the headers to gcc's configure command in "--with-headers" (unless you've copied them in place previously).

This isn't your current issue, but for "make" to work you'll need to do "make -j4 inhibit_libc=true" (--without-gcov doesn't appear to work, adding "inhibit_libc=true" actually prevents gcov from being built).


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

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