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

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems compiling gcc-3.3.5 with newlib-1.12.0


Carlos de wrote:
Hi
I'm tring to compile a cross-toolchain for arm-elf on
a IA32 linux box using gcc-3.3.5, binutils-2.15,
newlib-1.12.0 against linux-2.6.9 headers.

What the linux-2.6.9 headers has to do with this project?


I had
originally tried using the scripts in contrib/patches but ran into trouble there. So tried using Bill
Gatliff's original build-crossgcc.sh. I also added
whatever patches seemed necessary for binutils from the patches subdir in crosstool-0.28-rc37 -
binutils-arm-undef-imm.patch, binutils-skip-comments.
patch and cross-gprof.patch. I couldnt locate any
patches for gcc ( or newlib,linux).

No patches should be necessary first... "Don't fix it if it ain't broken!". If you find bugs or become aware about them, you can always check that the bugs really are there and then fix them later when already knowing how to build GCC.

 Just copy the generic newlib headers into your chosen
'$prefix/arm-elf/include', as your logfile tells :

-isystem /home/carlos/crosstool_nl_build/arm-elf/include

and symlink/copy the headers the GCC-build 'feature' needs being there in the '$prefix/$target/sys-include', in your case :

/home/carlos/crosstool_nl_build/arm-elf/sys-include

ie. the 'stdlib.h', 'stdio.h', 'string.h', 'limits.h', 'time.h'
and 'unistd.h'. I would expect the Bill's cross-GCC FAQ telling
about this 'feature' because claiming to be a FAQ and so answering
to the "Frequently Asked Questions" on this list...

However towards the end i encountered a 'div_t not
declared ' error which seems to have occurred to many
others.   However I cant find a definive solution

Why on earth you have not read the answers from me on this list instead? What you didn't understand in my earlier replies? Were they then how provocative ever, the facts anyway should have been told there...

These 'div_t' / 'ldiv_t' things described in the newlib's 'stdlib.h':

------------- clip --------------------
/*
 * stdlib.h
 *
 * Definitions for common types, variables, and functions.
 */

#ifndef _STDLIB_H_
#ifdef __cplusplus
extern "C" {
#endif
#define _STDLIB_H_

#include "_ansi.h"

#define __need_size_t
#define __need_wchar_t
#include <stddef.h>

#include <sys/reent.h>

typedef struct
{
  int quot; /* quotient */
  int rem; /* remainder */
} div_t;

typedef struct
{
  long quot; /* quotient */
  long rem; /* remainder */
} ldiv_t;

#ifndef NULL
#define NULL 0
#endif
------------- clip --------------------

should be easy to check...

Is there any solution to this?

In file included from
.../../../../../gcc-3.3.5/libstdc++-v3/libsupc++/eh_alloc.cc:33:
/home/carlos/tool_tar/build-gcc/arm-elf/thumb/libstdc++-v3/include/cstdlib:86:
error: `
   div_t' not declared
/home/carlos/tool_tar/build-gcc/arm-elf/thumb/libstdc++-v3/include/cstdlib:87:
error: `
   ldiv_t' not declared
/home/carlos/tool_tar/build-gcc/arm-elf/thumb/libstdc++-v3/include/cstdlib:97:
error: `
   div' not declared

The original newlib headers define these things but when the headers were not seen, the GCC build replaces them with not-working stub-substitutes....

Before one can try to build the libstdc++, there must be :

- a preinstalled target C library for system targets

or

 - the preinstalled generic newlib headers and '--with-newlib' used in the GCC
   configure command with newlib-using embedded targets. Plus the GCC-build's
   'feature' worked around somehow...

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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