This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Configuring and Compiling GCC for Windows


Hi Everyone

I'm trying to keep cool and remain sane and will try to explain why I am
trying to do what I am trying to do since this seems to be of major
interest. Perhaps it will help in identifying my difficulty..



1. The end goal of the exercise is to install native compilers for several
processors - specifically for ARM, Intel x86, Mitsubishi, 68xxx and M-Core
and Hitachi. (see point 2 for why I am first configuring for a native boot
strap)
I have commercial compiler suites to most of these processors and have
written a C-compiler and simulator to the M-Core as an exercise. I have
also built a basic JTAG debugger for the ARM.
After using a GNU compiler for the M-Core and hearing that there were also
debuggers from GNU I thought it be wise to try to get involved with GNU
compiler testing and longer term possibly improvement contribution.

-> If this is a stupid idea please indicate with SI-1 ("Stupid idea"-1)



2. The reason why I am trying initially to build a native compiler can be
explained as follows.
a. I assume that this is the simplest and surest to work to begin with
b. When I have built the newest version of the GCC native compiler I can
also use the newest version to compile native compilers
c. One can also view it as a test run..

-> If this is a stupid idea please indicate with SI-2



3. I thought that I should logically take the latest version of the GNU
compiler sources and that is what I did. I understand that it works and so
I don't see any reason to take an old version (unless anyone can tell me
that the laterst really doesn't work). So if it is 3.10, 3.04, 3.189327 I
don't really care and don't believe that it should basically be an issue
here.
For the record I have GCC-3.0.4, which seemed to be the lastes a couple of
weeks back and am happy to stick with this version for the moment.

-> If this is a stupid idea please indicate with SI-3



4. I got the compiler and read how to install it. The first step being to
find some way to decompress the file and dearchive it. No big problem,
download a couple of GNU utilities and it's done.


5. Then I realised that it can only be installed using a Unix type system
and so looked around for something, most recommendations being to use
cygwin which simulates a Unix environment under Windows. This I have
installed on three computers and see no reasons why it should not be
working correctly - all utilities work and all command line commands too. I
let someone with some Unix knowledge look at it (who also uses cygwin for
some of his work) and he didn't see any problems with it.

-> If this is a stupid idea please indicate with SI-5



6. Now we seem to be getting to the issue that no one understands.
In the configuration instructions it say that I must have a compiler to
compile and that cygwin must know where to find this compiler. I looked
around in the cygwin binary directory and found nothing and the command
"gcc -v" fails since the executable is not found. So I checked around again
and found some recommendations to use MinGW since this is a native compiler
suited to bootstrapping - which is, as I have understood, the term for
compiling a compiler.
Thus I installed MinGW with the aim of using this as a native compiler to
compile the GCC for my machine, which would then be used to cross compile
for the targets I have in mind.

-> If this is a stupid idea please indicate with SI-6



***************************************************************************
*********


>OK, last time I am going to try this:

>Can you please please please give me one good reason why
>you are doing what you are doing????????

>It makes no sense to me. 

See points 1 and 2. If the reasons I have given are still insane, please
indicate and I will seek professional psychological advice.


>You have an application (Cygwin) which has native to it
>the compiler that you say you want, yet you are trying
>to build a compiler for another system (MinGW) over the top
>of it.
I think this is a misinterpretation. The fact (see 6) is that my cygwin
installation doesn't seem to have a compiler and I am using the MinGW (a
GCC binary as I understand it) to try to bootstrap. THis has also been
recommended to me..

>You are trying to do this when you can't even tell if
>you got the Cygwin install right. (Which a LOT of people
>do not, just check out the Cygwin mailing list.)
(See point 5). True, I can not be 100% sure but I think that the worst case
synario is that I missed installing the cygwin native compiler - other than
that I have no indications of an installation problem. Even if I missed the
compiler, the alternative native compiler should be able to be used and, as
we know from Hallo World tests - does operate from within the cygwin
environment.


>Why?

>Maybe I should just take a hint from the fact that you
>never answered my question about whether you knew that
>what you say you are building (3.04) is an older version
>of the compiler than 3.1. (Note I do mean 3.1, not
>3.01)
(See point 3) When I downloaded CPP this had not yet been released (in test
phase or something) and so I took the 3.0.4. I am still of the opinion that
the exact version is not the issue at the moment and, should I get 3.0.4
operating I would certainly upgrade to stay at the latest level.
I am sorry if I missed answering to a specific question, please forgive
me..

>I'm not trying to be abusive or mean, but to me at least,
>what you are doing makes no sense. 

I will wait for my stupidity rating before declaring myself sain or
otherwise (please delete as appropriate).


**********************************************************************

>You can't build a native mingw compiler from source using the mingw
>tool-chain itself AFAICT. You need to use the gcc supplied with cygwin
>(use the setup.exe, it along with other tools you will need such as
>binutils, is in the 'Devel' category). Use these, and remove the mingw
>from your path. After you have a working gcc, you can use that to build
>a cygwin to mingw cross compiler (cygwin and mingw are two entirely
>different systems) which is what you are trying to do now. You can now
>use this compiler to build a native win32 executables, much like the gcc
>you are trying to use now, apart from the fact that it will understand
>cygwin paths and mounts. The compiler used to build the mingw compiler
>must understand cygwin paths, so must have been built using cygwin
>itself.
I think there may have been a little misunderstanding somewhere along the
way. I have never attempted to build a native mingw compiler. I have a
MinGW native binary which I am trying to use as a native compiler to
bootstrap GCC (see point 2)

>I would suggest that you try to use cygwin native tools, but if the
>dependency on cygwin1.dll really bothers you, then mingw or DJGPP are
>your only options. DJGPP has a 3.x series compiler with it; I don't know
>whether mingw has a binary of it yet.

>CM

>PS: Why do you need 3.x so badly?
(See point 3). I don't want 3.x badly, but I assume it best to use the
latest release. If someone can tell me that 3.x simply doesn't work and I
should scrap it anbd use some previous version then I will do that. From
the information I have the 3.x works and should be prefered. My problem is
probably somewhere else - for example a critical setting which is missiung
in my installation.



/*********** OPEN QUESTION WHICH NEVER RECEIVES A DIRECT ANSWER
***********************/
The question which I am still not getting answered is the following. I have
the feeling that this is the critical error in my set up which I don't seem
to be able to solve.


somewhere along the line $(MAKE) has been substituted by 

\c:/MINGW/BIN/MAKE.EXE"

which is a bit of a DOS / Unix path convention mix along with a terminating
quote. Since this substitution is not valid, the configuration aborts.


 | | | THE QUESTION | | | |
 vvv                        vvvv
How can I tell cygwin where the compiler is without this causing this wrong
substitution ???
 ^^^                       ^^^^
 | | | THE QUESTION | | | |



/**************************************************************************
**************************************/

Best regards

Mark Butcher

Switzerland

Even if I do not get a rating of mentally insane and dangerous to the
public, please indicte if you see my case as a dead-end case. If we can
agree that it makes no sense to continue trying to install GCC I will
accept defeat with grace and dignity and leave all in peace.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]