About endianess defination

View: New views
3 Messages — Rating Filter:   Alert me  

About endianess defination

by daniel tian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, all :
     I build my newlib port, but there is an error in it.
     It told me the endianess undefined in ieeefp.h.
     Here is the message:
     /home/daniel.tian/gcc_rice_dev/rice-binutils/newlib-1.16.0/newlib/libc/include/machine/ieeefp.h:327:2:
error: #error Endianess not declared!!

     But I 've already defined the the macro in ieeefp.h:

#ifdef __RICE__
#define __IEEE_LITTLE_ENDIAN
#endif
    The problem is I don't know where the macro __RICE__ should be
defined. I checked the CRX processor, and I don't find where it
defined.
    This is my first to port the newlib. So there may be many problem,
difficult for me, but easy for your guys.
    Any suggestion is appreciated.
    Thank you very much.

     Best wishes.
                                                                        daniel

Re: About endianess defination

by daniel tian :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,
       I wrote the configure and make script including adding target
into the newlib.
       I added all those script according CRX archtechture.
       But when newlib was built, parameter passing to gcc I still
could see CRX path. Like the following:
       rice-elf-gcc
-B/home/daniel.tian/gcc_rice_dev/rice-binutils/build-newlib/rice-elf/newlib/
-isystem /home/daniel.tian/gcc_rice_dev/rice-binutils/build-newlib/rice-elf/newlib/targ-include
-isystem /home/daniel.tian/gcc_rice_dev/rice-binutils/newlib-1.16.0/newlib/libc/include
-B/home/daniel.tian/gcc_rice_dev/rice-binutils/build-newlib/rice-elf/libgloss/crx
-L/home/daniel.tian/gcc_rice_dev/rice-binutils/build-newlib/rice-elf/libgloss/libnosys
-L/home/daniel.tian/gcc_rice_dev/rice-binutils/newlib-1.16.0/libgloss/crx
-DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\"
-DPACKAGE_VERSION=\"1.16.0\" -DPACKAGE_STRING=\"newlib\ 1.16.0\"
-DPACKAGE_BUGREPORT=\"\" -I.
-I../../../../../newlib-1.16.0/newlib/libc/time -O2 -DHAVE_RENAME
-DMISSING_SYSCALL_NAMES -fno-builtin      -O2 -g -g -O2   -c -o
lib_a-tzset_r.o `test -f 'tzset_r.c' || echo
'../../../../../newlib-1.16.0/newlib/libc/time/'`tzset_r.c

       Here is the path should not be here:
-B/home/daniel.tian/gcc_rice_dev/rice-binutils/build-newlib/rice-elf/libgloss/crx
       Because there is a folder named 'rice' in
/home/daniel.tian/gcc_rice_dev/rice-binutils/build-newlib/rice-elf/libgloss/.
       I don't know where I could make thing right.

       And I wonder whether it relates to some configure or makefile
which are auto generated by autotools(like aclocal, autoconf,
automake).
       I mean if I added new target, those autotools should be run to
generate new files.

       Sorry if those questions are too simple.
       Thanks very much.
       Best wishes.

                               daniel

Re: About endianess defination

by Dave Korn-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

daniel tian wrote:

> The problem is I don't know where the macro __RICE__ should be defined. I
> checked the CRX processor, and I don't find where it defined.

  It should be a default predefine in the compiler; adding -D options to
CPP_SPEC is the usual way to define these macros that identify OS, CPU, etc.;
for example here's how the cygwin compiler does it - note how it uses specs to
set different build environment #defines based on command-line switches.

> #undef CPP_SPEC
> #define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
>   %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
>   %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{!ansi:%{mthreads:-D_MT}}}\
>   %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ %{!ansi:-Dunix} -D__unix__ -D__unix }\
>   %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ %{!ansi:-DWINNT}}\
>   %{!nostdinc:%{!mno-win32|mno-cygwin:-idirafter ../include/w32api%s -idirafter ../../include/w32api%s}}\
> "

    cheers,
      DaveK