This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Error: CC not set to working compiler


RakeshN wrote:
> 
> When i run
> srcdir/configure --build=i586-linux-gnu --host=i586-cygwin32 --target=h8300-hms
> --prefix=wininstalldir --exec-prefix=wininstalldir/H-i586-cygwin32
>
> I get the error that
>
> i586-cygwin32-gcc -o conftest conftest.c failed  .....
> CC must be set to working compiler.

 How did you test your installed Cygwin-targeted cross-compiler before trying this ?
Compiling a 'Hello World' with it and checking that the produced executable runs ok
under Win32 ?  If not in any way, you must be a real optimist...

 Although the compiler would nicely produce excutables under Linux, they still may
not work under Win32, if you didn't use the right working binutils (990818) for the
compiler...

> mkdir linux-x-cygwin32 
> cd linux-x-cygwin32 
> srcdir/configure --target=i586-cygwin32 --prefix=installdir
> --exec-prefix=installdir/H-i586-linux 

 After building a thousand or so cross-compilers, I have never used the '--exec-prefix=...',
so I cannot say whether  the resulted GCC searches subprograms from the 'installdir/bin',
and 'installdir/i586-cygwin32/bin', or from 'installdir/H-i586-linux/bin' and
'installdir/H-i586-linux/i586-cygwin32/bin'.

 Why the Cross-GCC FAQ puts newbies to try all these weird options?  Many K.I.S.S.es for
the Cross-GCC-FAQ, please...

 What was the real value for this 'installdir'?  The '/linux-x-cygwin32/gcc/installdir'
as the following shows or what?

>   *** The command '/linux-x-cygwin32/gcc/installdir/H-i586-linux/bin/i586-cygwin32-gcc -o
>   conftest -g -O2 conftest.c' failed.
>   *** You must set the environment variable CC to a working compiler.

 It seems that your Cygwin-target compiler cannot produce anything...

 IMHO, when the default '--prefix' value is '/usr/local', the used value,
'/linux-x-cygwin32/gcc/installdir/H-i586-linux' is against all Unix-principles about
using short names and using standard install prefixes like '/usr/local' and '/opt/gnu'...

 In Cygnus people may be obliged to use the host-name in the prefix, but the normal Unix
and Linux users are free to follow the standards...  If the Cross-GCC FAQ says that people
should use these kind of name-monsters, I will strongly disagree...

> I have set the PATH to the correct path for i586-cygwin32-gcc. I have exported the path
> also correctly.

 The standard install dir for local executables, '/usr/local/bin' should already be in
the user's path on every installed Linux system. The 'root' may miss it but the ordinary
users should have it. So following the standards and defaults has its point...
 
> But still the error is the same. Should i also set the CC variable ? But configure
> is already finding  the correct gcc then why should i set it explicitly?
>
>         /tmp/ccWGFnM0.s: Assembler messages:
>         /tmp/ccWGFnM0.s:27: Error: Unknown pseudo-op:  `.def'
>         /tmp/ccWGFnM0.s:27: Error: Unknown pseudo-op:  `.scl'

 Your Cygwin-targeted compiler cannot find the right assembler. What does the

  /linux-x-cygwin32/gcc/installdir/H-i586-linux/bin/i586-cygwin32-gcc -print-search-dirs

say about the search paths ?  Do you have the Win32-target assembler in the 'programs'
search path ?  Again, has this installed Cygwin-targeted compiler ever really worked ?

 Please do a single step at a time, and check that everything is ok after that, and continue
only then. Otherwise everything will be just a continuing mess, but you cannot sue entropy
about that ;-)

Cheers, Kai


------
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]