[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [openrisc] or32 compile errors



> I am trying to compile a simple c program with the or32-rtems-gcc
> compiler and I am getting errors.  Please forgive me if I am doing
> something stupid.  I am a newbie concerning C programming and software
> development in general.
> 
> Here's the program I am wanting to compile... This is the sample program
> from the DDD documentation.  It compiles cleanly with plain gcc.
> 
> ----- CUT BELOW THIS LINE -----
> /* sample.c -- Sample C program to be debugged with ddd */ 
> #include <stdio.h> 
> #include <stdlib.h>
...
> [jeff@asic1 testbench]$ or32-rtems-gcc -o sample sample.c 
> /opt/or32-rtems/or32-rtems/lib/libc.a(findfp.o): In function

The problem is with libraries... You are actually trying to build
application for rtems OS.
I am not aware what is the status with RTEMS and building 
applications for it (Ivan and Chris were working on it).
Maybe you will need some extra steps like with building
uClinux tools. Look at web how you can build the utils for uClinux.

But if you want just to test the debugger with DDD, you can do
much simpler example, like:
(Copied and modified from or1k/or1ksim/testbench; you can find more
OS independent applications/tests there.
Note that below example does not use any standard headers, supported
by OS)

int gk = 0;
int c = 0;
int fun1 (int a, int b, int c, int d, int e, int f, int g)
{
  int j = 0;
  volatile char x[50];
  &x;

  while(j < 2) {
    a++;
    j++;
  }

  return a;
}

int main(void)
{
  int i, j, k;
  i = j = k = 0;

  while (c++ < 10) {
    j = fun1(gk, k + 1, k + 2, k + 3, k + 4, k + 5, k + 6);
    if(j > 40)
      gk = j - 20;
    else
      gk = j;
  }
  return (gk != 20);
}


--
To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml