Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I followed the wiki cross compiler tutorial to build my cross compiler in cygwin, but I got error (with no surprise) after I execute 'make all'. The error is as follows
arlex.o: In function 'main':
/usr/src/build-binutils/binutils/arlex.c:1: multiple definition of '_main'
arparse.o:/usr/src/build-binutils/binutils/arparse.c:1: first defined here
ar.o: In function 'main':
/usr/src/build-binutils/binutils/../../binutils-20060817-1/binutils/ar.c:337:mu
ltiple definition of "main'
arparse.o:/usr/src/build-binutils/binutils/arparse.c:1: first defined here
ar.o: In function 'mri_emul':
/usr/src/build-binutils/binutils/../../binutils-20060817-1/binutils/ar.c:141: un
defined reference to '_yyparse'
collect2: ld returned 1 exit status
make[4]: *** [ar.exe] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-binutils] Error 2
make: *** [all] Error 2
configure:2306: checking for correct version of gmp.h no
configure:2319: gcc -c -g -O2 conftest.c 1>&5
configure:2309:17: gmp.h: No such file or directory
configure: In function `main':
configure:2313: error: `choke' undeclared (first use in this function)
configure:2313: error: (Each undeclared identifier is reported only once
configure:2313: error: for each function it appears in.)
configure:2313: error: parse error before "me"
configure: failed program was:
#line 2308 "configure"
#include "confdefs.h"
#include "gmp.h"
int main() {
#if __GNU_MP_VERSION < 3
choke me
#endif
; return 0; }
configure:3451: checking for bison
configure:3451: checking for byacc
configure:3451: checking for yacc
configure:3491: checking for bison
The cross-compiler tutorial has the correct instructions (it worked for me and many others) but you will need to make sure that you have all sorts of support software.
EDIT: Verify that you do actually have Bison (run Cygwin's setup.exe) and if you do, check for yacc and then lex. You're missing at least one of the three, it would appear.
It seems to me you are missing a _lot_ of programs - are you sure that your binutils version in Cygwin is correct (or that it even exists)? I notice that the configure script can't find objdump, for instance.
Also, try getting yacc (as well as byacc) and lex.
That log shows me that it succeeded - typically now you'd run "make install" and it'd all be installed into your Cygwin environment (or wherever you set --prefix to).
pcmattman wrote:The cross-compiler tutorial has the correct instructions (it worked for me and many others) but you will need to make sure that you have all sorts of support software.
Actually, it suffices to run Cygwin's setup.exe, without altering its default choice of packages except for to include devel/gcc and devel/make. No additional "support software" is required - or at least, was required last time I checked. I will check again next week (I'm without a suitable test machine ATM.)
Every good solution is obvious once you've found it.
pcmattman wrote:The cross-compiler tutorial has the correct instructions (it worked for me and many others) but you will need to make sure that you have all sorts of support software.
Actually, it suffices to run Cygwin's setup.exe, without altering its default choice of packages except for to include devel/gcc and devel/make. No additional "support software" is required - or at least, was required last time I checked. I will check again next week (I'm without a suitable test machine ATM.)
Do me a favour (on the one thing that seems to break it for me every time) and see if texinfo is installed by default, and if not, does the compile fail. I have the problem on Cygwin and Lnux and it always bugs me that no one else seems to.
pcmattman wrote:The cross-compiler tutorial has the correct instructions (it worked for me and many others) but you will need to make sure that you have all sorts of support software.
Actually, it suffices to run Cygwin's setup.exe, without altering its default choice of packages except for to include devel/gcc and devel/make. No additional "support software" is required - or at least, was required last time I checked. I will check again next week (I'm without a suitable test machine ATM.)
Do me a favour (on the one thing that seems to break it for me every time) and see if texinfo is installed by default, and if not, does the compile fail. I have the problem on Cygwin and Lnux and it always bugs me that no one else seems to.
It happens to me too, but a simple apt-get install usually fixes it.
Solar wrote:Actually, it suffices to run Cygwin's setup.exe, without altering its default choice of packages except for to include devel/gcc and devel/make. No additional "support software" is required - or at least, was required last time I checked. I will check again next week (I'm without a suitable test machine ATM.)
If it isn't installed you need bison, byacc, yacc, and lex. These may be installed by default but it can't hurt to check. Also, GCC (at least for me) binaries were not in the default installation.
Solar wrote:Actually, it suffices to run Cygwin's setup.exe, without altering its default choice of packages except for to include devel/gcc and devel/make. No additional "support software" is required - or at least, was required last time I checked. I will check again next week (I'm without a suitable test machine ATM.)
You'll need flex and bison for GCC 3 builds.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Solar wrote:That might be, but why would you want to use GCC 3? (Not a rethorical question here, I fail to see the benefit over using the stable 4.x line.)
As mentioned in a previous thread, GCC continues to get more "bloat" but at the same time.. drop several historical architectures.
OpenBSD uses it's own custom GCC 3.3.5 port... but as like other pieces of software distributed with OpenBSD.. It's just the version number it had when it went into the tree.
It contains several local modifications.. support for additional architectures.. and other optimizations they put in that unfortunately never went "upstream".
Still.. people go cross-eyed when they see the old version number.. in reality, they just never "upped" the version variables .
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Solar wrote:That might be, but why would you want to use GCC 3? (Not a rethorical question here, I fail to see the benefit over using the stable 4.x line.)
So I don't need to specify the (possibly different) version when invoking a crosscompiler through the default one. And yes, I'm lazy.
Basically, its the idea that if something is (not) good enough to get bundled, it should be (not) good enough to osdev.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]