Re[2]: [Gc] [bdwgc] 7.2alpha6 fails to compile with clang (#14)

Ivan Maidanski ivmai at mail.ru
Mon Mar 5 06:41:12 PST 2012


Hi the community,

04 03 2012, 16:51 Hans Aberg <haberg-1 at telia.com>:
> On 4 Mar 2012, at 13:15, Ivan Maidanski wrote:
> >
> > This is known (caused by using deprecated API) but could anybody propose a fix for it?
> 
> As you note, it seems deprecated. The only difference between the structs mach_header_64 and mach_header is that the former has an added field which seems to do nothing (see below). So it may have been added in order to pay attention that it should not be used.
> 
> The fix would be to not call _dyld_register_func_for_add_image() and _dyld_register_func_for_remove_image() in a 64-bit compile, since it will probably break.

I'd like also to hear opinion about this from other Darwin experts.

Regards.

> 
> Hans
> 
> ----
> /*
>  * The 32-bit mach header appears at the very beginning of the object file for
>  * 32-bit architectures.
>  */
> struct mach_header {
> 	uint32_t	magic;		/* mach magic number identifier */
> 	cpu_type_t	cputype;	/* cpu specifier */
> 	cpu_subtype_t	cpusubtype;	/* machine specifier */
> 	uint32_t	filetype;	/* type of file */
> 	uint32_t	ncmds;		/* number of load commands */
> 	uint32_t	sizeofcmds;	/* the size of all the load commands */
> 	uint32_t	flags;		/* flags */
> };
> 
> /* Constant for the magic field of the mach_header (32-bit architectures) */
> #define	MH_MAGIC	0xfeedface	/* the mach magic number */
> #define MH_CIGAM	0xcefaedfe	/* NXSwapInt(MH_MAGIC) */
> 
> /*
>  * The 64-bit mach header appears at the very beginning of object files for
>  * 64-bit architectures.
>  */
> struct mach_header_64 {
> 	uint32_t	magic;		/* mach magic number identifier */
> 	cpu_type_t	cputype;	/* cpu specifier */
> 	cpu_subtype_t	cpusubtype;	/* machine specifier */
> 	uint32_t	filetype;	/* type of file */
> 	uint32_t	ncmds;		/* number of load commands */
> 	uint32_t	sizeofcmds;	/* the size of all the load commands */
> 	uint32_t	flags;		/* flags */
> 	uint32_t	reserved;	/* reserved */
> };
> 
> /* Constant for the magic field of the mach_header_64 (64-bit architectures) */
> #define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */
> #define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */
> ----
> 
> 



More information about the Gc mailing list