This is the mail archive of the gcc@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]

Re: Trying to build cross, complains about missing system header files


> My system unistd.h file contains prototypes for thinks that don't exist
> on my m68k target.  No file system, no way to print, etc.  What is the
> usual workaround for situations like this?
> 
> Do I supply the system .h files and stub sources for the functions, or
> is there a more elegant solution for this?
> 
> And where should I put the stub sources, assuming that is the solution
> of choice?

It seems that these functions are primarily used for profiling, in
libgcc2.c. If that's the case, I think you have a number of options:

a) define BLOCK_PROFILER_CODE on your target, and none of the _bb
   stuff will be compiled. I think you can leave it empty, or put
   empty definitions of the necessary functions in it.

b) define inhibit_libc. I think this is meant for newlib, but it may
   well work for your environment.

c) provide stub functions. You only need to have header declarations -
   libgcc2 is split into many objects, one per function. So if the
   compiler never emits the profiling functions (i.e. you never
   compile with -pg), then nobody will miss those functions.

Of course, if you do want to support profiling, you have to provide
means to output the profiling data.

Regards,
Martin

P.S. Perhaps there are other reasons to require unistd in libgcc2. If
there are, don't hesitate to ask again.


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