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]

fixing cross compiles



crtstuff.c now conditionally includes unistd.h and stdio.h based on
the value of inhibit_libc.

However, the Makefile doesn't pass the value of inhibit_libc when it
compiles crtstuff.c.

This breaks cross compiles when using newlib as the C library in a single
build tree.

	* Makefile.in (crtend.o): Pass @inhibit_libc@ to compilation of
	crtstuff.c.
	(crtbegin.o, s-crtS): Likewise.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.358
diff -c -3 -p -r1.358 Makefile.in
*** Makefile.in	2000/01/06 14:29:08	1.358
--- Makefile.in	2000/01/07 08:54:39
*************** stmp-multilib-sub:
*** 1265,1277 ****
  $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
    defaults.h frame.h gbl-ctors.h stmp-int-hdrs
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
! 	  -finhibit-size-directive -fno-inline-functions -fno-exceptions 
$(CRTSTUFF_T_CFLAGS) \
  	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
  
  $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
    defaults.h frame.h gbl-ctors.h stmp-int-hdrs
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
! 	  -finhibit-size-directive -fno-inline-functions -fno-exceptions 
$(CRTSTUFF_T_CFLAGS) \
  	  -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
  
  # On some systems we also want to install versions of these files
--- 1265,1279 ----
  $(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
    defaults.h frame.h gbl-ctors.h stmp-int-hdrs
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
! 	  -finhibit-size-directive -fno-inline-functions \
! 	  -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
  	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
  
  $(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
    defaults.h frame.h gbl-ctors.h stmp-int-hdrs
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
! 	  -finhibit-size-directive -fno-inline-functions \
! 	  -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
  	  -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
  
  # On some systems we also want to install versions of these files
*************** crtbeginS.o crtendS.o: s-crtS ; @true
*** 1281,1292 ****
  s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
    defaults.h frame.h gbl-ctors.h stmp-int-hdrs
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
! 	  -DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
! 	  -fno-exceptions -g0 -c $(srcdir)/crtstuff.c
  	mv crtstuff$(objext) crtbeginS$(objext)
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
! 	  -DCRT_END -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
! 	  -fno-exceptions -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
  	touch s-crtS
  
  # Compile the start modules crt0.o and mcrt0.o that are linked with every 
program
--- 1283,1296 ----
  s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
    defaults.h frame.h gbl-ctors.h stmp-int-hdrs
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
! 	  -DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive \
! 	  -fno-inline-functions -fno-exceptions @inhibit_libc@ -g0 \
! 	  -c $(srcdir)/crtstuff.c
  	mv crtstuff$(objext) crtbeginS$(objext)
  	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
! 	  -DCRT_END -DCRTSTUFFS_O -finhibit-size-directive \
! 	  -fno-inline-functions -fno-exceptions @inhibit_libc@ -g0 \
! 	  -c $(srcdir)/crtstuff.c -o crtendS$(objext)
  	touch s-crtS
  
  # Compile the start modules crt0.o and mcrt0.o that are linked with every 
program





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