configuration

Joel Sherrill joel.sherrill at OARcorp.com
Tue Oct 17 23:06:36 UTC 2000


Since you challenged me on comp.arch.embedded. :)

"D.G.Somerton" wrote:
> 
> Hello,
> 
>   I am 'trying' to configure the RTEMS on cygwin. This is failing. see
> previous posts.
> 
>   Someone suggested that VC environment variables may clashing.
>   This cannot be, as VC uses LIB, INCLUDE, MSVCDIR, MSDEVDIR

I believe this is the 1/2 of the problem.

>   info gcc: Invoking: Environment Variables:
>     LIBRARY_PATH
>     C_INCLUDE_PATH

That make be all that gcc uses but the setting of environment variables
conflicts with their use in the RTEMS makefiles.  On top of that, it
appears that TMPDIR or something like that is getting through as well.
 
>   Someone suggested linking cc to gcc.

This is needed.

>   This is no good, as gcc is /bin/../lib/gcc-lib/i686-pc-cygwin/2.95.2
>   The cross compiler is /tool/bin/m68k-rtems-gcc.exe
>   I have linked cc to the cross compiler.

This is VERY bad.  cc/gcc must be able to produce a working 
native program.  The build of RTEMS (and the other tools if you
built them from source) compiles native utilities using cc/gcc.

>   Compiling a test program works. i.e. cc -v -S f.c produces f.s.
> 
> file f.c
> int f(int x)
> {
>   return x + 1;
> }

But this is m68k code and you need i386/cygwin code for native programs.
This does show that the cross compiler is basically installed correctly
though and this is what the Getting Started manual is getting you to
check here.

> Reading specs from /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/specs
> gcc version 2.95.2 19991024 (release)
> /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/cpp.exe -lang-c -v -D__GNUC__=2 -D_
> _GNUC_MINOR__=95 -Dmc68000 -Drtems -D__rtems__ -D__ELF__ -D__mc68000__ -D__r
> tems__ -D__rtems__ -D__ELF__ -D__mc68000 -D__rtems -Asystem(rtems) -Acpu(mc6
> 8000) -Acpu(m68k) -Amachine(m68k) f.c H:\TEMP/ccLDGzBk.i
> GNU CPP version 2.95.2 19991024 (release) (68k, Motorola syntax)
> #include "..." search starts here:
> #include <...> search starts here:
> /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/include
> /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/../../../../m68k-rtems/include
> End of search list.
> The following default directories have been omitted from the search path:
> /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/../../../../include/g++-3
> /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/../../../../m68k-rtems/sys-include
> End of omitted list.
> /opt/rtems/lib/gcc-lib/m68k-rtems/2.95.2/cc1.exe
> H:\TEMP/ccLDGzBk.i -quiet -dumpbase f.c -version -o f.s
  ^^^^^^^^^^^^^^^

I think this could cause problems but can't guarantee it.  I am not sure
that the cygwin programs can use a path of the form
<drive_letter>:<path>.
Do this:

env | grep TEMP

The output will probably show TMPDIR set to H:\TEMP.  

> GNU C version 2.95.2 19991024 (release) (m68k-rtems) compiled by GNU C
> version 2.95.2 19991024 (release).
> 
> file f.s
>  .file "f.c"
> gcc2_compiled.:
> .text
> .globl f
>  .type  f, at function
> f:
>  link.w %a6,#0
>  move.l 8(%a6),%d1
>  addq.l #1,%d1
>  move.l %d1,%d0
>  jbra .L2
> .L2:
>  unlk %a6
>  rts
> .Lfe1:
>  .size  f,.Lfe1-f
>  .ident "GCC: (GNU) 2.95.2 19991024 (release)"

Ignoring the fact that it is linked to the native compiler, this
is correct.  m68k-rtems-gcc -S produced m68k assembly code.
 
> --------------------------------------------
> 
> After the failed configure, here are the logs.
> /tools/../build/config.log and /tools/../build/tools/build/config.log
> 
> It seems that the configuration cannot determine that this is cygwin.

Exactly.  This is the m68k-rtems-gcc compiler.

 
> configure:854: checking for Cygwin environment
> configure:870: cc -c   conftest.c 1>&5
> configure: In function `main':
> configure:866: `__CYGWIN32__' undeclared (first use in this function)
> configure:866: (Each undeclared identifier is reported only once
> configure:866: for each function it appears in.)

>>> cygwin autoconf test cases deleted

> ---------------------------------
> 
> So as you can see,  it is looking for __CYGWIN32__
> What is this?
> Where does it come from?

__CYGWIN32__ is a predefined symbol for the native compiler.  It is
not defined by the m68k-rtems-gcc.  Correct behavior for the compiler.


> How do I set it so the configuration works?

Make sure cc.exe is linked to the native gcc.exe.

Make sure the environment variables you were previously told to
ensure are not set are in fact not set.  Include TMPDIR in this
list. 

Do the build again.  Report the failure to the list.

> 
> D.G.Somerton
> Very frustrated, a supposedly simple procedure is in fact extremely
> complicated. Why?

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list