This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
David, Thanks for the detailed howto... It's up and running. The old 'vxWorks 5.2 includes' took a little tweaking but not bad. Definitely easier than using the linux $build in a "canadian" cross. (Do they still have 3 branches of gov?) Thanks again for your help. I owe you a beer/coffee/water JimP ----------------------------------------------- newbie notes on cygwin-x-vxworks crossgcc ----------------------------------------------- Once I installed a fresh cygwin from http://sourceware.cygnus.com/cygwin/mirrors.htmland and followed some newbie info from a cygwin mail thread the planets aligned... put a 'build' directory in binutils-2.9 and configured/make/installed from there. No problems. grats David Korn: --target=m68k-wrs-vxworks --with-headers=/path/to/vw-include --with-gnu-as --with-gnu-ld (allowed default --prefix=/usr/local) put a 'build' directory in gcc-2.95.2 and configured from there. No problems. Same args gcc make: libio/iostream.cc errors: ------------------------------- old stat.h missing some #defines for ULONG,USHORT,UINT8,STATUS Added #defines and the printf.h was missing so I commented out the #include and shotgun a prototype for printf_info: (tests OK for now, needs real printf.h) /* #include <printf.h> */ typedef struct printf_info { unsigned int prec,width,format_char,is_long_double,is_short,is_long,alt, space,left,showsign,group,extra,is_char,pad; } ; Added to regsMc68k.h in sys-include/arch/mc68k ---------------------------------------------- #define ULONG unsigned long #define USHORT unsigned short #define INSTR unsigned long Ignored POSIX warnings from basicio.c compile using vxTypesOld.h ---------------------------------------------------------------- /cygdrive/d/gcc/i586-x-vxworks/gcc-2.95.2/build/gcc/include/types/vxTypesOld .h:77: warning:... Added to fileio.h in libchill for basicio.c ------------------------------------------- #define R_OK 0x4 #define W_OK 0x8 Added 0666 to libchill/basicio.c for missing 'mode' arg in open() calls, 2 places. (the first occurance was correct, ???) -------------------------------------------------------------------- if( (the_assoc->handle = open( the_assoc->pathname, SeqMode[the_usage], 0666 )) ^^^^ gcc install: no problems. /END/ -----Original Message----- From: David Korn [mailto:dkorn@pixelpower.com] Sent: Wednesday, May 02, 2001 12:26 PM To: 'Plucknett, Jim' Cc: Crossgcc-List (E-mail) Subject: RE: cygwin and crossgcc >-----Original Message----- >From: Plucknett, Jim [mailto:plucknet@SSD.FSI.com] >Sent: 01 May 2001 20:55 [Crossgcc list Cc'd back in] >After thinking about you recommendations for a short minute, I decided >to try building a straight cross compiler (cygwin to vxworks(5.1)). >The ultimate $host will be a PC anyway so eliminating $build may >improve my chances. That should save at least some of the hassle and confusion, I hope. >I installed cygwin and set it up per: >http://sources.redhat.com/cygwin/cygwin-ug-net/setup-net.html Really? That looks quite badly out of date to me. According to the second page (http://sources.redhat.com/cygwin/cygwin-ug-net/installing-binaries.html) you are supposed to : " Connect to one of the ftp servers listed in http://sourceware.cygnus.com/cygwin/mirrors.html and cd to the directory containing the latest release. If you want the development tools and the programs necessary to run the GNU configure mechanism, you should download the full binary release called full.exe. If you only care about the user tools listed above, download usertools.exe instead " ...which refers to the old beta releases of cygwin. Certainly there weren't any such files as full.exe or usertools.exe in the mirror I visited. What version of cygwin have you got ? >I copied the gcc and binutils structures to the PC and started >to manually >configure binutils. At this point I get a 'config.sub not found' >error. I'd need to know the exact commands you used at this point; I assume you mean that you copied the directory trees over, but I don't get what you mean by 'manually' configuring binutils. It's possible that something has gotten confused here by the difference between Unix and DOS line ends, but probably the quickest solution is to re-unpack the .tar.gz files. >Can you point me to a howto or something on this effort, so I can >flounder painfully on my own? I needed something to do this week >anyway ;-) Ok. Here's a recipe that should work. We're going to start by making a subdirectory in the home directory to do the build in: $ cd ~ $ mkdir new-gcc $ cd new-gcc Now you've got to copy the .tar.gz files from whereever they live $ cp /some/dir/or/other/gcc-2.95.3.tar.gz . $ cp /some/dir/or/other/binutils-2.10.tar.gz . and unpack them: $ tar zxvf gcc-2.95.3.tar.gz $ tar zxvf binutils-2.10.tar.gz then we can get rid of them, since they're only copies (don't do this if you put your only copies into new-gcc!) $ rm gcc-2.95.3.tar.gz binutils-2.10.tar.gz Now we make some build directories $ mkdir build-gcc $ mkdir build-binutils Now, in order to deal with the CRLF problem, we provide mountpoints to access the source code in text mode; this converts CRLF <-> LF. $ mkdir /gcc-src $ mkdir /binutils-src $ mount -u -t `cygpath -aw \`pwd\`/gcc-2.95.3` /gcc-src/ $ mount -u -t `cygpath -aw \`pwd\`/binutils-2.10` /binutils-src/ This uses pwd to print the current directory, then calls cygpath on the concatenation of the pwd output with the names of the subdirectories in our new-gcc dir in order to convert them to windows-style for the mount command. Next, a necessary precaution. This next step might be superfluous by now but it can't do any harm: $ mkdir /usr/local/lib/gcc-lib/m68k-wrs-vxworks $ mkdir /usr/local/lib/gcc-lib/m68k-wrs-vxworks/2.95.3 [ The reason for this is because the build process seems to generate a lot of relative paths starting at this directory, which is where most of the compiler will be installed once it is built, so it's best to make sure the directory really is there! AFAIUI this caused problems in 2.95.2, and should be fine in 2.95.3, so this step may be obsolete, but it can't hurt.] One final problem: the gcc archive comes with a copy of the texinfo utility that is used to generate the .info files for the manual, but it won't work with cygwin. Fortunately cygwin offers the same functionality itself, so we just need to rename, delete or move the texinfo subdir in the gcc sources. $ mv gcc-2.95.3/texinfo gcc-2.95.3/old.texinfo Right: preparations out of the way, time to get started. The first thing we do is configure, build and install the cross binutils: $ cd build-binutils $ /binutils-src/configure --target=m68k-wrs-vxworks -v 2>&1 | tee conf.log $ make all install 2>&1 | tee build.log $ cd .. Now we configure and build gcc itself. Note that for this stage, you must have Tornado installed on the PC. In fact, all you really need is the header files from the Tornado\target\h directory. In the example that follows, I assume that the full tornado dir. tree is installed on the PC, and that the environment variable WIND_BASE points to it. If not, you can just replace all the backtick/cygpath monkey business with the path to the headers directly. $ cd build-gcc $ /gcc-src/configure --target=m68k-wrs-vxworks --with-included-gettext --with-gnu-as --with-gnu-ld --with-headers=`cygpath -aup ${WIND_BASE}`/target/h --with-included-gettext --enable-languages=c,c++ -v 2>&1 | tee conf.log $ make LANGUAGES="c c++" all install 2>&1 | tee build.log And there you should have it, although I know of one or two problems that might crop up: it might fail when it starts building the modules of libgcc, if the fixincs process has (as it sometimes does) gotten the wrong kind of lineends into the fixed headers. If this occurs, your build will end with some error message along the lines of 'Invalid token in expression', the way to fix it is to say $ cd gcc/include $ find . -type f -ls -exec dos2unix \{\} \; $ cd ../.. which needs you to have a dos2unix converter in your /bin directory; if you don't have one, just drop this into a file /bin/dos2unix #!/bin/sh cp $1 $1.dos && tr -d '\015' <$1.dos >$1 && rm $1.dos and make it runnable by executing $ chmod ugo+x /bin/dos2unix After converting the line ends, you just repeat the make command and it will carry on from where it left off. The other main problem that might crop up would be a build error during the build of libstdc++. That needs making a change to gcc/cp/gen-params that I don't have the details of to hand. You can work round it by simply ignoring it; if you just repeat the make command, but leave out the 'all' (i.e. install only). This will install your entire working compiler, but the C++ STL library won't have been built; however you should still be able to use the STL as it's built into the OS. Last of all, test your compiler out on a simple 'hello world' program: $ cat >hw.c <<EOT #include <stdio.h> int main (void) { printf ("Hello VxWorld!\n"); return 0; }; EOT $ m68k-wrs-vxworks-gcc hw.c -o hw Download that to your target and it should run fine! Note that I've been typing this all off the top of my head without looking up any notes, so it's possible I've made a mistake here; or there could be problems crop up during the build that I haven't allowed for; I'm more familiar with the powerpc version of the compiler. In any case, drop us a line and let us know how you've got on. DaveK -- All your base are belong to the Israeli army! Oh, now they aren't again! ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ********************************************************************** ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |