This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Building mips*-linux-gnu using --with-newlib


Dunno how standard this is, but I tend to build a mips*-linux-gnu
sysroot as follows:

   - build a bare-bones gcc, configured using:
        --with-newlib --disable-shared --disable-threads
        --enable-languages=c
   - use it to build & install glibc
   - build a full compiler, no special configure options
   - use it to build the rest of the sysroot

The point of --with-newlib is to stop libgcc including any system
header files since they aren't available until glibc is installed.

Anyway, this no longer works with the new definition of
MD_FALLBACK_FRAME_STATE_FOR.  libgcc will unconditionally
include <signal.h>.

Is it OK to apply the patch below to get around this?  It seems safe,
but I notice most other ports don't do this.

OTOH, judging by Daniel Egger's recent message to gcc@, it seems
I'm not the only one to use --with-newlib.

Tested by building a mips64-linux-gnu sysroot using the procedure above.

Richard


	* config/mips/linux.h: Wrap MD_FALLBACK_FRAME_STATE_FOR and
	associated includes in #ifndef inhibit_libc.

Index: config/mips/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/linux.h,v
retrieving revision 1.70
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.70 linux.h
*** config/mips/linux.h	17 Oct 2003 16:55:56 -0000	1.70
--- config/mips/linux.h	19 Oct 2003 18:50:15 -0000
*************** #define LIB_SPEC "\
*** 192,197 ****
--- 192,198 ----
  %{!shared: %{pthread:-lpthread} \
    %{profile:-lc_p} %{!profile: -lc}}"
  
+ #ifndef inhibit_libc
  /* Do code reading to identify a signal frame, and set the frame
     state data appropriately.  See unwind-dw2.c for the structs.  */
  #ifdef IN_LIBGCC2
*************** #define MD_FALLBACK_FRAME_STATE_FOR(CONT
*** 261,263 ****
--- 261,264 ----
                                                                       \
      goto SUCCESS;                                                    \
    } while (0)
+ #endif


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