<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>RE: Problems configuring rtems-cygwin-m68k</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Tim,</FONT>
</P>
<P> <FONT SIZE=2>I've run into the exact problem my solution was to migrate to Linux (but you could use Win9X or ME) and below is what Joel sent to the Cygwin group.</FONT></P>
<P><FONT SIZE=2>Hope this helps!</FONT>
</P>
<P><FONT SIZE=2>Christopher Jowell</FONT>
</P>
<P><FONT SIZE=2>Application System Analyst </FONT>
<BR><FONT SIZE=2>Roche Diagnostics </FONT>
<BR><FONT SIZE=2>235 Hembree Park Dr.</FONT>
<BR><FONT SIZE=2>Roswell Ga 30076</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>(770) 576-5000 X 579</FONT>
<BR><FONT SIZE=2>(770) 576-5020 Fax</FONT>
</P>
<BR>
<P><FONT SIZE=2>Hi,</FONT>
</P>
<P><FONT SIZE=2>I am using the current net release of Cygwin to build RTEMS to </FONT>
<BR><FONT SIZE=2>target an m68k (ELF format). When the configure script tries </FONT>
<BR><FONT SIZE=2>to see if the cross compiler works, it will execute this </FONT>
<BR><FONT SIZE=2>fragment from a configure script:</FONT>
</P>
<P><FONT SIZE=2>================</FONT>
<BR><FONT SIZE=2>cat > conftest.$ac_ext << EOF</FONT>
</P>
<P><FONT SIZE=2>#line 1253 "configure"</FONT>
<BR><FONT SIZE=2>#include "confdefs.h"</FONT>
</P>
<P><FONT SIZE=2>main(){return(0);}</FONT>
<BR><FONT SIZE=2>EOF</FONT>
<BR><FONT SIZE=2>if { (eval echo configure:1258: \"$ac_link\") 1>&5; (eval $ac_link)</FONT>
<BR><FONT SIZE=2>2>&5; } &&</FONT>
<BR><FONT SIZE=2>t</FONT>
<BR><FONT SIZE=2>est -s conftest${ac_exeext}; then</FONT>
<BR><FONT SIZE=2> ac_cv_prog_cc_works=yes</FONT>
<BR><FONT SIZE=2> # If we can't run a trivial program, we are probably using a cross</FONT>
<BR><FONT SIZE=2>compiler.</FONT>
<BR><FONT SIZE=2> if (./conftest; exit) 2>/dev/null; then </FONT>
<BR><FONT SIZE=2>=================</FONT>
</P>
<P><FONT SIZE=2>Cygwin under WinME/95 passes this test and apparently refuses to run</FONT>
<BR><FONT SIZE=2>"./conftest".</FONT>
<BR><FONT SIZE=2>Cygwin under WinNT/2000 allows ./conftest to be executed. Even worse,</FONT>
<BR><FONT SIZE=2>this</FONT>
<BR><FONT SIZE=2>conftest will execute enough to go into a hard loop which can't be</FONT>
<BR><FONT SIZE=2>killed with</FONT>
<BR><FONT SIZE=2><ctl>-C. </FONT>
</P>
<P><FONT SIZE=2>I believe that Cygwin should refuse to execute this program. Is there</FONT>
<BR><FONT SIZE=2>any provision for checking a magic number on the executable?</FONT>
</P>
<P><FONT SIZE=2>Has anyone else seen anything like this?</FONT>
</P>
<P><FONT SIZE=2>I can provide the executable if this is desired.</FONT>
</P>
<BR>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Tim Riches [<A HREF="mailto:tim.riches@westbridge-design.co.uk">mailto:tim.riches@westbridge-design.co.uk</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, January 12, 2001 12:44 PM</FONT>
<BR><FONT SIZE=2>To: rtems-users</FONT>
<BR><FONT SIZE=2>Subject: Problems configuring rtems-cygwin-m68k</FONT>
</P>
<P><FONT SIZE=2>I'm having problems configuring Rtems for m68k-elf.</FONT>
</P>
<P><FONT SIZE=2>Environment:</FONT>
<BR><FONT SIZE=2>cygwin 1.1.6 under NT4 SP6</FONT>
<BR><FONT SIZE=2>binutils package (2000-1221-1)</FONT>
<BR><FONT SIZE=2>newlib package (1.9.0)</FONT>
<BR><FONT SIZE=2>gcc (2.95.2-5)</FONT>
<BR><FONT SIZE=2>rtems (4.5.0)</FONT>
<BR><FONT SIZE=2>PATH /bin /usr/local/bin /usr</FONT>
</P>
<P><FONT SIZE=2>I have successfully built the binutils with configure options:</FONT>
<BR><FONT SIZE=2>/home/build-bin</FONT>
<BR><FONT SIZE=2>/binutils-20001221-1/configure --target=m68k-elf --prefix=/usr/local</FONT>
<BR><FONT SIZE=2>make</FONT>
<BR><FONT SIZE=2>make install</FONT>
</P>
<P><FONT SIZE=2>I have also built gcc successfully(?) having previously set up links for</FONT>
<BR><FONT SIZE=2>newlib, libgloss, include, gcc.</FONT>
<BR><FONT SIZE=2>/home/build-gcc</FONT>
<BR><FONT SIZE=2>/gcc-2.95.2-5/configure --target=m68k-elf --prefix=/usr/local</FONT>
<BR><FONT SIZE=2>--enable-languages=c,c++ --with-newlib --with-as=/usr/local/m68k-elf/bin/as</FONT>
<BR><FONT SIZE=2>--with-ld=/usr/local/m68k-elf/bin/ld -v</FONT>
<BR><FONT SIZE=2>make</FONT>
<BR><FONT SIZE=2>make install</FONT>
</P>
<P><FONT SIZE=2>[I used the --with-as= in the hope that calling gcc(cross-compiler) would</FONT>
<BR><FONT SIZE=2>hard code the path for its as and ld]</FONT>
</P>
<P><FONT SIZE=2>When I come to configure the rtems it appears to check the native compiler</FONT>
<BR><FONT SIZE=2>then later the cross-compiler, the second check fails.</FONT>
</P>
<P><FONT SIZE=2>configure options for rtems:</FONT>
<BR><FONT SIZE=2>/home/build-rtems</FONT>
<BR><FONT SIZE=2>/rtems-4.5.0/configure --target=m68k-elf --prefix=/usr/local</FONT>
<BR><FONT SIZE=2>--enable-rtemsbsp=gen68360 --program-prefix=m68k-elf-</FONT>
<BR><FONT SIZE=2>Output listing:</FONT>
<BR><FONT SIZE=2>##########################################################</FONT>
<BR><FONT SIZE=2>checking if cpu m68k is supported... yes</FONT>
<BR><FONT SIZE=2>checking for m68k-elf-gcc... /usr/local/bin/m68k-elf-gcc</FONT>
<BR><FONT SIZE=2>checking whether the C compiler (/usr/local/bin/m68k-elf-gcc ) works... no</FONT>
<BR><FONT SIZE=2>configure: error: installation or configuration problem: C compiler cannot</FONT>
<BR><FONT SIZE=2>create executables.</FONT>
<BR><FONT SIZE=2>configure: error: /rtems-4.5.0/c/make/configure failed for make</FONT>
<BR><FONT SIZE=2>configure: error: /rtems-4.5.0/c/configure failed for c</FONT>
<BR><FONT SIZE=2>###########################################################</FONT>
<BR><FONT SIZE=2>Interesting thing is that m68k-elf-gcc does work! - in as much as it</FONT>
<BR><FONT SIZE=2>compiled a small program which ran on our target hardware without</FONT>
<BR><FONT SIZE=2>problems.</FONT>
</P>
<P><FONT SIZE=2>Any ideas/suggestions would be appreciated.</FONT>
</P>
<P><FONT SIZE=2>==========================================</FONT>
<BR><FONT SIZE=2>Tim Riches</FONT>
<BR><FONT SIZE=2>Principal Design Engineer</FONT>
</P>
<P><FONT SIZE=2>Westbridge Design Ltd</FONT>
<BR><FONT SIZE=2>Hurst Barns</FONT>
<BR><FONT SIZE=2>Hurst Lane</FONT>
<BR><FONT SIZE=2>Privett, Alton</FONT>
<BR><FONT SIZE=2>Hants</FONT>
<BR><FONT SIZE=2>GU34 3PL</FONT>
<BR><FONT SIZE=2>UK</FONT>
</P>
<P><FONT SIZE=2>e-mail: tim.riches@westbridge-design.co.uk</FONT>
<BR><FONT SIZE=2>Tel: +44 (0)1730 828111</FONT>
<BR><FONT SIZE=2>Fax: +44 (0)1730 828123</FONT>
</P>
</BODY>
</HTML>