⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gcconfig.h

📁 gcc的组建
💻 H
📖 第 1 页 / 共 5 页
字号:
#         define DOS4GW#       endif#     endif#   endif#   define mach_type_known# endif# if defined(__s390__) && defined(LINUX)#    define S390#    define mach_type_known# endif# if defined(__GNU__)#   if defined(__i386__)/* The Debian Hurd running on generic PC */  #     define  HURD#     define  I386#     define  mach_type_known#    endif # endif/* Feel free to add more clauses here *//* Or manually define the machine type here.  A machine type is 	*//* characterized by the architecture.  Some				*//* machine types are further subdivided by OS.				*//* the macros ULTRIX, RISCOS, and BSD to distinguish.			*//* Note that SGI IRIX is treated identically to RISCOS.			*//* SYSV on an M68K actually means A/UX.					*//* The distinction in these cases is usually the stack starting address */# ifndef mach_type_known	--> unknown machine type# endif		    /* Mapping is: M68K       ==> Motorola 680X0	*/		    /*		   (SUNOS4,HP,NEXT, and SYSV (A/UX),	*/		    /*		   MACOS and AMIGA variants)		*/		    /*             I386       ==> Intel 386	 	*/		    /*		    (SEQUENT, OS2, SCO, LINUX, NETBSD,	*/		    /*		     FREEBSD, THREE86BSD, MSWIN32,	*/		    /* 		     BSDI,SUNOS5, NEXT, other variants)	*/                    /*             NS32K      ==> Encore Multimax 	*/                    /*             MIPS       ==> R2000 or R3000	*/                    /*			(RISCOS, ULTRIX variants)	*/                    /*		   VAX	      ==> DEC VAX		*/                    /*			(BSD, ULTRIX variants)		*/                    /*		   RS6000     ==> IBM RS/6000 AIX3.X	*/                    /*		   RT	      ==> IBM PC/RT		*/                    /*		   HP_PA      ==> HP9000/700 & /800	*/                    /*				  HP/UX, LINUX		*/		    /*		   SPARC      ==> SPARC	v7/v8/v9	*/		    /*			(SUNOS4, SUNOS5, LINUX,		*/		    /*			 DRSNX variants)		*/		    /* 		   ALPHA      ==> DEC Alpha 		*/		    /*			(OSF1 and LINUX variants)	*/		    /* 		   M88K       ==> Motorola 88XX0        */		    /* 		        (CX_UX and DGUX)		*/		    /* 		   S370	      ==> 370-like machine	*/		    /* 			running Amdahl UTS4		*/                    /*             S390       ==> 390-like machine      */		    /*                  running LINUX                   */		    /* 		   ARM32      ==> Intel StrongARM	*/		    /* 		   IA64	      ==> Intel IPF		*/		    /*				  (e.g. Itanium)	*/		    /*			(LINUX and HPUX)	        */		    /*		   SH	      ==> Hitachi SuperH	*/		    /* 			(LINUX & MSWINCE)		*/		    /* 		   X86_64     ==> AMD x86-64		*/		    /*		   POWERPC    ==> IBM/Apple PowerPC	*/		    /*			(MACOS(<=9),DARWIN(incl.MACOSX),*/		    /*			 LINUX, NETBSD, NOSYS variants)	*/		    /*		   CRIS       ==> Axis Etrax		*/		    /*		   M32R	      ==> Renesas M32R		*//* * For each architecture and OS, the following need to be defined: * * CPP_WORD_SZ is a simple integer constant representing the word size. * in bits.  We assume byte addressibility, where a byte has 8 bits. * We also assume CPP_WORD_SZ is either 32 or 64. * (We care about the length of pointers, not hardware * bus widths.  Thus a 64 bit processor with a C compiler that uses * 32 bit pointers should use CPP_WORD_SZ of 32, not 64. Default is 32.) * * MACH_TYPE is a string representation of the machine type. * OS_TYPE is analogous for the OS. * * ALIGNMENT is the largest N, such that * all pointer are guaranteed to be aligned on N byte boundaries. * defining it to be 1 will always work, but perform poorly. * * DATASTART is the beginning of the data segment. * On some platforms SEARCH_FOR_DATA_START is defined. * SEARCH_FOR_DATASTART will cause GC_data_start to * be set to an address determined by accessing data backwards from _end * until an unmapped page is found.  DATASTART will be defined to be * GC_data_start. * On UNIX-like systems, the collector will scan the area between DATASTART * and DATAEND for root pointers. * * DATAEND, if not `end' where `end' is defined as ``extern int end[];''. * RTH suggests gaining access to linker script synth'd values with * this idiom instead of `&end' where `end' is defined as ``extern int end;'' . * Otherwise, ``GCC will assume these are in .sdata/.sbss'' and it will, e.g., * cause failures on alpha*-*-* with ``-msmall-data or -fpic'' or mips-*-* * without any special options. * * ALIGN_DOUBLE of GC_malloc should return blocks aligned to twice * the pointer size. * * STACKBOTTOM is the cool end of the stack, which is usually the * highest address in the stack. * Under PCR or OS/2, we have other ways of finding thread stacks. * For each machine, the following should: * 1) define STACK_GROWS_UP if the stack grows toward higher addresses, and * 2) define exactly one of *	STACKBOTTOM (should be defined to be an expression) *	LINUX_STACKBOTTOM *	HEURISTIC1 *	HEURISTIC2 * If STACKBOTTOM is defined, then it's value will be used directly as the * stack base.  If LINUX_STACKBOTTOM is defined, then it will be determined * with a method appropriate for most Linux systems.  Currently we look * first for __libc_stack_end, and if that fails read it from /proc. * If either of the last two macros are defined, then STACKBOTTOM is computed * during collector startup using one of the following two heuristics: * HEURISTIC1:  Take an address inside GC_init's frame, and round it up to *		the next multiple of STACK_GRAN. * HEURISTIC2:  Take an address inside GC_init's frame, increment it repeatedly *		in small steps (decrement if STACK_GROWS_UP), and read the value *		at each location.  Remember the value when the first *		Segmentation violation or Bus error is signalled.  Round that *		to the nearest plausible page boundary, and use that instead *		of STACKBOTTOM. * * Gustavo Rodriguez-Rivera points out that on most (all?) Unix machines, * the value of environ is a pointer that can serve as STACKBOTTOM. * I expect that HEURISTIC2 can be replaced by this approach, which * interferes far less with debugging.  However it has the disadvantage * that it's confused by a putenv call before the collector is initialized. * This could be dealt with by intercepting putenv ... * * If no expression for STACKBOTTOM can be found, and neither of the above * heuristics are usable, the collector can still be used with all of the above * undefined, provided one of the following is done: * 1) GC_mark_roots can be changed to somehow mark from the correct stack(s) *    without reference to STACKBOTTOM.  This is appropriate for use in *    conjunction with thread packages, since there will be multiple stacks. *    (Allocating thread stacks in the heap, and treating them as ordinary *    heap data objects is also possible as a last resort.  However, this is *    likely to introduce significant amounts of excess storage retention *    unless the dead parts of the thread stacks are periodically cleared.) * 2) Client code may set GC_stackbottom before calling any GC_ routines. *    If the author of the client code controls the main program, this is *    easily accomplished by introducing a new main program, setting *    GC_stackbottom to the address of a local variable, and then calling *    the original main program.  The new main program would read something *    like: * *		# include "gc_private.h" * *		main(argc, argv, envp) *		int argc; *		char **argv, **envp; *		{ *		    int dummy; * *		    GC_stackbottom = (ptr_t)(&dummy); *		    return(real_main(argc, argv, envp)); *		} * * * Each architecture may also define the style of virtual dirty bit * implementation to be used: *   MPROTECT_VDB: Write protect the heap and catch faults. *   PROC_VDB: Use the SVR4 /proc primitives to read dirty bits. * * An architecture may define DYNAMIC_LOADING if dynamic_load.c * defined GC_register_dynamic_libraries() for the architecture. * * An architecture may define PREFETCH(x) to preload the cache with *x. * This defaults to a no-op. * * PREFETCH_FOR_WRITE(x) is used if *x is about to be written. * * An architecture may also define CLEAR_DOUBLE(x) to be a fast way to * clear the two words at GC_malloc-aligned address x.  By default, * word stores of 0 are used instead. * * HEAP_START may be defined as the initial address hint for mmap-based * allocation. *//* If we are using a recent version of gcc, we can use __builtin_unwind_init() * to push the relevant registers onto the stack.  This generally makes * USE_GENERIC_PUSH_REGS the preferred approach for marking from registers. */# if defined(__GNUC__) && ((__GNUC__ >= 3) || \			   (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) \		       && !defined(__INTEL_COMPILER)#   define HAVE_BUILTIN_UNWIND_INIT# endif# define STACK_GRAN 0x1000000# ifdef M68K#   define MACH_TYPE "M68K"#   define ALIGNMENT 2#   ifdef OPENBSD#	define OS_TYPE "OPENBSD"#	define HEURISTIC2#	ifdef __ELF__#	  define DATASTART GC_data_start#	  define DYNAMIC_LOADING#	else	  extern char etext[];#	  define DATASTART ((ptr_t)(etext))#       endif#       define USE_GENERIC_PUSH_REGS#   endif#   ifdef NETBSD#	define OS_TYPE "NETBSD"#	define HEURISTIC2#	ifdef __ELF__#	  define DATASTART GC_data_start#	  define DYNAMIC_LOADING#	else	  extern char etext[];#	  define DATASTART ((ptr_t)(etext))#       endif#	define USE_GENERIC_PUSH_REGS#   endif#   ifdef LINUX#       define OS_TYPE "LINUX"#       define STACKBOTTOM ((ptr_t)0xf0000000)#       define USE_GENERIC_PUSH_REGS#	     define USE_MMAP	      /* We never got around to the assembly version. *//* #       define MPROTECT_VDB - Reported to not work  9/17/01 */#       ifdef __ELF__#            define DYNAMIC_LOADING#	     include <features.h>#	     if defined(__GLIBC__)&& __GLIBC__>=2#              define SEARCH_FOR_DATA_START#	     else /* !GLIBC2 */               extern char **__environ;#              define DATASTART ((ptr_t)(&__environ))                             /* hideous kludge: __environ is the first */                             /* word in crt0.o, and delimits the start */                             /* of the data segment, no matter which   */                             /* ld options were passed through.        */                             /* We could use _etext instead, but that  */                             /* would include .rodata, which may       */                             /* contain large read-only data tables    */                             /* that we'd rather not scan.             */#	     endif /* !GLIBC2 */             extern int _end[];#            define DATAEND (_end)#       else             extern int etext[];#            define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))#       endif#   endif#   ifdef SUNOS4#	define OS_TYPE "SUNOS4"	extern char etext[];#	define DATASTART ((ptr_t)((((word) (etext)) + 0x1ffff) & ~0x1ffff))#	define HEURISTIC1	/* differs	*/#	define DYNAMIC_LOADING#   endif#   ifdef HP#	define OS_TYPE "HP"	extern char etext[];#       define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))#       define STACKBOTTOM ((ptr_t) 0xffeffffc)			      /* empirically determined.  seems to work. */#  	include <unistd.h>#	define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)#   endif#   ifdef SYSV#	define OS_TYPE "SYSV"	extern etext[];#   	define DATASTART ((ptr_t)((((word) (etext)) + 0x3fffff) \				   & ~0x3fffff) \				  +((word)etext & 0x1fff))	/* This only works for shared-text binaries with magic number 0413.	   The other sorts of SysV binaries put the data at the end of the text,	   in which case the default of etext would work.  Unfortunately,	   handling both would require having the magic-number available.	   	   		-- Parag	   */#	define STACKBOTTOM ((ptr_t)0xFFFFFFFE)			/* The stack starts at the top of memory, but   */			/* 0x0 cannot be used as setjump_test complains */			/* that the stack direction is incorrect.  Two  */			/* bytes down from 0x0 should be safe enough.   */			/* 		--Parag				*/#   	include <sys/mmu.h>#	define GETPAGESIZE() PAGESIZE	/* Is this still right? */#   endif#   ifdef AMIGA#	define OS_TYPE "AMIGA" 	    	/* STACKBOTTOM and DATASTART handled specially	*/ 	    	/* in os_dep.c					*/# 	define DATAEND	/* not needed */#	define GETPAGESIZE() 4096#   endif#   ifdef MACOS#     ifndef __LOWMEM__#     include <LowMem.h>#     endif#     define OS_TYPE "MACOS"			/* see os_dep.c for details of global data segments. */#     define STACKBOTTOM ((ptr_t) LMGetCurStackBase())#     define DATAEND	/* not needed */#     define GETPAGESIZE() 4096#   endif#   ifdef NEXT#	define OS_TYPE "NEXT"#	define DATASTART ((ptr_t) get_etext())#	define STACKBOTTOM ((ptr_t) 0x4000000)#	define DATAEND	/* not needed */#   endif# endif# ifdef POWERPC#   define MACH_TYPE "POWERPC"#   ifdef MACOS#     define ALIGNMENT 2  /* Still necessary?  Could it be 4?	*/#     ifndef __LOWMEM__#     include <LowMem.h>#     endif#     define OS_TYPE "MACOS"			/* see os_dep.c for details of global data segments. */#     define STACKBOTTOM ((ptr_t) LMGetCurStackBase())#     define DATAEND  /* not needed */#   endif#   ifdef LINUX#     if (defined (powerpc64) || defined(__powerpc64__))#       define ALIGNMENT 8#       define CPP_WORDSZ 64#       define HBLKSIZE 4096#     else#       define ALIGNMENT 4#     endif#     define OS_TYPE "LINUX"      /* HEURISTIC1 has been reliably reported to fail for a 32-bit	*/      /* executable on a 64 bit kernel.					*/#     define LINUX_STACKBOTTOM#     define DYNAMIC_LOADING#     define SEARCH_FOR_DATA_START      extern int _end[];#     define DATAEND (_end)#   endif#   ifdef DARWIN#     if (defined (__ppc64__))#       define ALIGNMENT 8#       define CPP_WORDSZ 64#     else#       define ALIGNMENT 4#     endif#     define OS_TYPE "DARWIN"#     define DYNAMIC_LOADING      /* XXX: see get_end(3), get_etext() and get_end() should not be used.         These aren't used when dyld support is enabled (it is by default) */#     define DATASTART ((ptr_t) get_etext())#     define DATAEND	((ptr_t) get_end())#     define STACKBOTTOM ((ptr_t) 0xc0000000)#     define USE_MMAP#     define USE_MMAP_ANON#     define USE_ASM_PUSH_REGS      /* This is potentially buggy. It needs more testing. See the comments in         os_dep.c */#     define MPROTECT_VDB#     include <unistd.h>#     define GETPAGESIZE() getpagesize()#     if defined(USE_PPC_PREFETCH) && defined(__GNUC__)	/* The performance impact of prefetches is untested */#	define PREFETCH(x) \	  __asm__ __volatile__ ("dcbt 0,%0" : : "r" ((const void *) (x)))#	define PREFETCH_FOR_WRITE(x) \	  __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))#     endif      /* There seems to be some issues with trylock hanging on darwin. This         should be looked into some more */#     define NO_PTHREAD_TRYLOCK#   endif#   ifdef FREEBSD#       define ALIGNMENT 4#       define OS_TYPE "FREEBSD"#       ifndef GC_FREEBSD_THREADS#           define MPROTECT_VDB#       endif#       define SIG_SUSPEND SIGUSR1#       define SIG_THR_RESTART SIGUSR2#       define FREEBSD_STACKBOTTOM#       ifdef __ELF__#           define DYNAMIC_LOADING#       endif        extern char etext[];        extern char * GC_FreeBSDGetDataStart();#       define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)#   endif#   ifdef NETBSD#     define ALIGNMENT 4#     define OS_TYPE "NETBSD"#     define HEURISTIC2      extern char etext[];#     define DATASTART GC_data_start#     define DYNAMIC_LOADING#   endif#   ifdef NOSYS#     define ALIGNMENT 4#     define OS_TYPE "NOSYS"      extern void __end[], __dso_handle[];#     define DATASTART (__dso_handle)  /* OK, that's ugly.  */#     define DATAEND (__end)	/* Stack starts at 0xE0000000 for the simulator.  */#     undef STACK_GRAN#     define STACK_GRAN 0x10000000#     define HEURISTIC1#   endif# endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -