code:
--- evince-2.32.0.org/libview/ev-jobs.c	2013-01-08 08:57:52.781000002 +0000
+++ evince-2.32.0/libview/ev-jobs.c	2013-01-08 12:07:27.662000003 +0000
@@ -154,7 +154,7 @@
 			      G_STRUCT_OFFSET (EvJobClass, cancelled),
 			      NULL, NULL,
 			      g_cclosure_marshal_VOID__VOID,
-			      G_TYPE_NONE, 0);
+			      G_TYPE_NONE, 0, (void *) 0);
 	job_signals [FINISHED] =
 		g_signal_new ("finished",
 			      EV_TYPE_JOB,
@@ -162,7 +162,7 @@
 			      G_STRUCT_OFFSET (EvJobClass, finished),
 			      NULL, NULL,
 			      g_cclosure_marshal_VOID__VOID,
-			      G_TYPE_NONE, 0);
+			      G_TYPE_NONE, 0, (void *) 0);
 }

 static gboolean
@@ -176,7 +176,7 @@
 		ev_debug_message (DEBUG_JOBS, "%s (%p) job was cancelled, do not emit finished", EV_GET_TYPE_NAME (job), job);
 	} else {
 		ev_profiler_stop (EV_PROFILE_JOBS, "%s (%p)", EV_GET_TYPE_NAME (job), job);
-		g_signal_emit (job, job_signals[FINISHED], 0);
+		g_signal_emit (job, job_signals[FINISHED], 0, (void *) 0);
 	}

 	return FALSE;
@@ -202,7 +202,7 @@
 					 (GDestroyNotify)g_object_unref);
 	} else {
 		ev_profiler_stop (EV_PROFILE_JOBS, "%s (%p)", EV_GET_TYPE_NAME (job), job);
-		g_signal_emit (job, job_signals[FINISHED], 0);
+		g_signal_emit (job, job_signals[FINISHED], 0, (void *) 0);
 	}
 }

@@ -226,7 +226,7 @@
 	/* This should never be called from a thread */
 	job->cancelled = TRUE;
 	g_cancellable_cancel (job->cancellable);
-	g_signal_emit (job, job_signals[CANCELLED], 0);
+	g_signal_emit (job, job_signals[CANCELLED], 0, (void *) 0);
 }

 void
@@ -846,7 +846,7 @@

 	job_fonts->scan_completed = !ev_document_fonts_scan (fonts, 20);
 	g_signal_emit (job_fonts, job_fonts_signals[FONTS_UPDATED], 0,
-		       ev_document_fonts_get_progress (fonts));
+		       ev_document_fonts_get_progress (fonts), (void *) 0);

 	ev_document_fc_mutex_unlock ();
 	ev_document_doc_mutex_unlock ();
@@ -872,7 +872,7 @@
 			      NULL, NULL,
 			      g_cclosure_marshal_VOID__DOUBLE,
 			      G_TYPE_NONE,
-			      1, G_TYPE_DOUBLE);
+			      1, G_TYPE_DOUBLE, (void *) 0);
 }

 EvJob *
@@ -1220,7 +1220,7 @@
 		job_find->has_results = (matches != NULL);

 	job_find->pages[job_find->current_page] = matches;
-	g_signal_emit (job_find, job_find_signals[FIND_UPDATED], 0, job_find->current_page);
+	g_signal_emit (job_find, job_find_signals[FIND_UPDATED], 0, job_find->current_page, (void *) 0);

 	job_find->current_page = (job_find->current_page + 1) % job_find->n_pages;
 	if (job_find->current_page == job_find->start_page) {
@@ -1249,7 +1249,7 @@
 			      NULL, NULL,
 			      g_cclosure_marshal_VOID__INT,
 			      G_TYPE_NONE,
-			      1, G_TYPE_INT);
+			      1, G_TYPE_INT, (void *) 0);
 }

 EvJob *


code:
/*
 *  linux/include/linux/ext2_fs.h
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card (card@masi.ibp.fr)
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 *
 *  from
 *
 *  linux/include/linux/minix_fs.h
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 */

#ifndef _LINUX_EXT2_FS_H
#define _LINUX_EXT2_FS_H
#include <stdint.h>
#define __fu32 uint32_t
#define __fu16 uint16_t
#include <linux/types.h>
#include <linux/magic.h>
#include <linux/fs.h>

/*
 * The second extended filesystem constants/structures
 */

/*
 * Define EXT2FS_DEBUG to produce debug messages
 */
#undef EXT2FS_DEBUG

/*
 * Define EXT2_RESERVATION to reserve data blocks for expanding files
 */
#define EXT2_DEFAULT_RESERVE_BLOCKS     8
/*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */
#define EXT2_MAX_RESERVE_BLOCKS         1027
#define EXT2_RESERVE_WINDOW_NOT_ALLOCATED 0
/*
 * The second extended file system version
 */
#define EXT2FS_DATE		"95/08/09"
#define EXT2FS_VERSION		"0.5b"

/*
 * Debug code
 */
#ifdef EXT2FS_DEBUG
#	define ext2_debug(f, a...)	{ \
					printk ("EXT2-fs DEBUG (%s, %d): %s:", \
						__FILE__, __LINE__, __func__); \
				  	printk (f, ## a); \
					}
#else
#	define ext2_debug(f, a...)	/**/
#endif

/*
 * Special inode numbers
 */
#define	EXT2_BAD_INO		 1	/* Bad blocks inode */
#define EXT2_ROOT_INO		 2	/* Root inode */
#define EXT2_BOOT_LOADER_INO	 5	/* Boot loader inode */
#define EXT2_UNDEL_DIR_INO	 6	/* Undelete directory inode */

/* First non-reserved inode for old ext2 filesystems */
#define EXT2_GOOD_OLD_FIRST_INO	11

/* Assume that user mode programs are passing in an ext2fs superblock, not
 * a kernel struct super_block.  This will allow us to call the feature-test
 * macros from user land. */
#define EXT2_SB(sb)	(sb)

/*
 * Maximal count of links to a file
 */
#define EXT2_LINK_MAX		32000

/*
 * Macro-instructions used to manage several block sizes
 */
#define EXT2_MIN_BLOCK_SIZE		1024
#define	EXT2_MAX_BLOCK_SIZE		4096
#define EXT2_MIN_BLOCK_LOG_SIZE		  10
# define EXT2_BLOCK_SIZE(s)		(EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
#define	EXT2_ADDR_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (__u32))
# define EXT2_BLOCK_SIZE_BITS(s)	((s)->s_log_block_size + 10)
#define EXT2_INODE_SIZE(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
				 EXT2_GOOD_OLD_INODE_SIZE : \
				 (s)->s_inode_size)
#define EXT2_FIRST_INO(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
				 EXT2_GOOD_OLD_FIRST_INO : \
				 (s)->s_first_ino)

/*
 * Macro-instructions used to manage fragments
 */
#define EXT2_MIN_FRAG_SIZE		1024
#define	EXT2_MAX_FRAG_SIZE		4096
#define EXT2_MIN_FRAG_LOG_SIZE		  10
# define EXT2_FRAG_SIZE(s)		(EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
# define EXT2_FRAGS_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))

/*
 * Structure of a blocks group descriptor
 */
struct ext2_group_desc
{
	__le32	bg_block_bitmap;		/* Blocks bitmap block */
	__le32	bg_inode_bitmap;		/* Inodes bitmap block */
	__le32	bg_inode_table;		/* Inodes table block */
	__le16	bg_free_blocks_count;	/* Free blocks count */
	__le16	bg_free_inodes_count;	/* Free inodes count */
	__le16	bg_used_dirs_count;	/* Directories count */
	__le16	bg_pad;
	__le32	bg_reserved[3];
};

/*
 * Macro-instructions used to manage group descriptors
 */
# define EXT2_BLOCKS_PER_GROUP(s)	((s)->s_blocks_per_group)
# define EXT2_DESC_PER_BLOCK(s)		(EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
# define EXT2_INODES_PER_GROUP(s)	((s)->s_inodes_per_group)

/*
 * Constants relative to the data blocks
 */
#define	EXT2_NDIR_BLOCKS		12
#define	EXT2_IND_BLOCK			EXT2_NDIR_BLOCKS
#define	EXT2_DIND_BLOCK			(EXT2_IND_BLOCK + 1)
#define	EXT2_TIND_BLOCK			(EXT2_DIND_BLOCK + 1)
#define	EXT2_N_BLOCKS			(EXT2_TIND_BLOCK + 1)

/*
 * Inode flags (GETFLAGS/SETFLAGS)
 */
#define	EXT2_SECRM_FL			FS_SECRM_FL	/* Secure deletion */
#define	EXT2_UNRM_FL			FS_UNRM_FL	/* Undelete */
#define	EXT2_COMPR_FL			FS_COMPR_FL	/* Compress file */
#define EXT2_SYNC_FL			FS_SYNC_FL	/* Synchronous updates */
#define EXT2_IMMUTABLE_FL		FS_IMMUTABLE_FL	/* Immutable file */
#define EXT2_APPEND_FL			FS_APPEND_FL	/* writes to file may only append */
#define EXT2_NODUMP_FL			FS_NODUMP_FL	/* do not dump file */
#define EXT2_NOATIME_FL			FS_NOATIME_FL	/* do not update atime */
/* Reserved for compression usage... */
#define EXT2_DIRTY_FL			FS_DIRTY_FL
#define EXT2_COMPRBLK_FL		FS_COMPRBLK_FL	/* One or more compressed clusters */
#define EXT2_NOCOMP_FL			FS_NOCOMP_FL	/* Don't compress */
#define EXT2_ECOMPR_FL			FS_ECOMPR_FL	/* Compression error */
/* End compression flags --- maybe not all used */
#define EXT2_BTREE_FL			FS_BTREE_FL	/* btree format dir */
#define EXT2_INDEX_FL			FS_INDEX_FL	/* hash-indexed directory */
#define EXT2_IMAGIC_FL			FS_IMAGIC_FL	/* AFS directory */
#define EXT2_JOURNAL_DATA_FL		FS_JOURNAL_DATA_FL /* Reserved for ext3 */
#define EXT2_NOTAIL_FL			FS_NOTAIL_FL	/* file tail should not be merged */
#define EXT2_DIRSYNC_FL			FS_DIRSYNC_FL	/* dirsync behaviour (directories only) */
#define EXT2_TOPDIR_FL			FS_TOPDIR_FL	/* Top of directory hierarchies*/
#define EXT2_RESERVED_FL		FS_RESERVED_FL	/* reserved for ext2 lib */

#define EXT2_FL_USER_VISIBLE		FS_FL_USER_VISIBLE	/* User visible flags */
#define EXT2_FL_USER_MODIFIABLE		FS_FL_USER_MODIFIABLE	/* User modifiable flags */

/* Flags that should be inherited by new inodes from their parent. */
#define EXT2_FL_INHERITED (EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_COMPR_FL |\
			   EXT2_SYNC_FL | EXT2_NODUMP_FL |\
			   EXT2_NOATIME_FL | EXT2_COMPRBLK_FL |\
			   EXT2_NOCOMP_FL | EXT2_JOURNAL_DATA_FL |\
			   EXT2_NOTAIL_FL | EXT2_DIRSYNC_FL)

/* Flags that are appropriate for regular files (all but dir-specific ones). */
#define EXT2_REG_FLMASK (~(EXT2_DIRSYNC_FL | EXT2_TOPDIR_FL))

/* Flags that are appropriate for non-directories/regular files. */
#define EXT2_OTHER_FLMASK (EXT2_NODUMP_FL | EXT2_NOATIME_FL)

/*
 * ioctl commands
 */
#define	EXT2_IOC_GETFLAGS		FS_IOC_GETFLAGS
#define	EXT2_IOC_SETFLAGS		FS_IOC_SETFLAGS
#define	EXT2_IOC_GETVERSION		FS_IOC_GETVERSION
#define	EXT2_IOC_SETVERSION		FS_IOC_SETVERSION
#define	EXT2_IOC_GETRSVSZ		_IOR('f', 5, long)
#define	EXT2_IOC_SETRSVSZ		_IOW('f', 6, long)

/*
 * ioctl commands in 32 bit emulation
 */
#define EXT2_IOC32_GETFLAGS		FS_IOC32_GETFLAGS
#define EXT2_IOC32_SETFLAGS		FS_IOC32_SETFLAGS
#define EXT2_IOC32_GETVERSION		FS_IOC32_GETVERSION
#define EXT2_IOC32_SETVERSION		FS_IOC32_SETVERSION

/*
 * Structure of an inode on the disk
 */
struct ext2_inode {
	__le16	i_mode;		/* File mode */
	__le16	i_uid;		/* Low 16 bits of Owner Uid */
	__le32	i_size;		/* Size in bytes */
	__le32	i_atime;	/* Access time */
	__le32	i_ctime;	/* Creation time */
	__le32	i_mtime;	/* Modification time */
	__le32	i_dtime;	/* Deletion Time */
	__le16	i_gid;		/* Low 16 bits of Group Id */
	__le16	i_links_count;	/* Links count */
	__le32	i_blocks;	/* Blocks count */
	__le32	i_flags;	/* File flags */
	union {
		struct {
			__le32  l_i_reserved1;
		} linux1;
		struct {
			__le32  h_i_translator;
		} hurd1;
		struct {
			__le32  m_i_reserved1;
		} masix1;
	} osd1;				/* OS dependent 1 */
	__le32	i_block[EXT2_N_BLOCKS];/* Pointers to blocks */
	__le32	i_generation;	/* File version (for NFS) */
	__le32	i_file_acl;	/* File ACL */
	__le32	i_dir_acl;	/* Directory ACL */
	__le32	i_faddr;	/* Fragment address */
	union {
		struct {
			__u8	l_i_frag;	/* Fragment number */
			__u8	l_i_fsize;	/* Fragment size */
			__u16	i_pad1;
			__le16	l_i_uid_high;	/* these 2 fields    */
			__le16	l_i_gid_high;	/* were reserved2[0] */
			__u32	l_i_reserved2;
		} linux2;
		struct {
			__u8	h_i_frag;	/* Fragment number */
			__u8	h_i_fsize;	/* Fragment size */
			__le16	h_i_mode_high;
			__le16	h_i_uid_high;
			__le16	h_i_gid_high;
			__le32	h_i_author;
		} hurd2;
		struct {
			__u8	m_i_frag;	/* Fragment number */
			__u8	m_i_fsize;	/* Fragment size */
			__u16	m_pad1;
			__u32	m_i_reserved2[2];
		} masix2;
	} osd2;				/* OS dependent 2 */
};

#define i_size_high	i_dir_acl

#if defined(__KERNEL__) || defined(__linux__)
#define i_reserved1	osd1.linux1.l_i_reserved1
#define i_frag		osd2.linux2.l_i_frag
#define i_fsize		osd2.linux2.l_i_fsize
#define i_uid_low	i_uid
#define i_gid_low	i_gid
#define i_uid_high	osd2.linux2.l_i_uid_high
#define i_gid_high	osd2.linux2.l_i_gid_high
#define i_reserved2	osd2.linux2.l_i_reserved2
#endif

#ifdef	__hurd__
#define i_translator	osd1.hurd1.h_i_translator
#define i_frag		osd2.hurd2.h_i_frag
#define i_fsize		osd2.hurd2.h_i_fsize
#define i_uid_high	osd2.hurd2.h_i_uid_high
#define i_gid_high	osd2.hurd2.h_i_gid_high
#define i_author	osd2.hurd2.h_i_author
#endif

#ifdef	__masix__
#define i_reserved1	osd1.masix1.m_i_reserved1
#define i_frag		osd2.masix2.m_i_frag
#define i_fsize		osd2.masix2.m_i_fsize
#define i_reserved2	osd2.masix2.m_i_reserved2
#endif

/*
 * File system states
 */
#define	EXT2_VALID_FS			0x0001	/* Unmounted cleanly */
#define	EXT2_ERROR_FS			0x0002	/* Errors detected */

/*
 * Mount flags
 */
#define EXT2_MOUNT_CHECK		0x000001  /* Do mount-time checks */
#define EXT2_MOUNT_OLDALLOC		0x000002  /* Don't use the new Orlov allocator */
#define EXT2_MOUNT_GRPID		0x000004  /* Create files with directory's group */
#define EXT2_MOUNT_DEBUG		0x000008  /* Some debugging messages */
#define EXT2_MOUNT_ERRORS_CONT		0x000010  /* Continue on errors */
#define EXT2_MOUNT_ERRORS_RO		0x000020  /* Remount fs ro on errors */
#define EXT2_MOUNT_ERRORS_PANIC		0x000040  /* Panic on errors */
#define EXT2_MOUNT_MINIX_DF		0x000080  /* Mimics the Minix statfs */
#define EXT2_MOUNT_NOBH			0x000100  /* No buffer_heads */
#define EXT2_MOUNT_NO_UID32		0x000200  /* Disable 32-bit UIDs */
#define EXT2_MOUNT_XATTR_USER		0x004000  /* Extended user attributes */
#define EXT2_MOUNT_POSIX_ACL		0x008000  /* POSIX Access Control Lists */
#define EXT2_MOUNT_XIP			0x010000  /* Execute in place */
#define EXT2_MOUNT_USRQUOTA		0x020000  /* user quota */
#define EXT2_MOUNT_GRPQUOTA		0x040000  /* group quota */
#define EXT2_MOUNT_RESERVATION		0x080000  /* Preallocation */

#define clear_opt(o, opt)		o &= ~EXT2_MOUNT_##opt
#define set_opt(o, opt)			o |= EXT2_MOUNT_##opt
#define test_opt(sb, opt)		(EXT2_SB(sb)->s_mount_opt & \
					 EXT2_MOUNT_##opt)
/*
 * Maximal mount counts between two filesystem checks
 */
#define EXT2_DFL_MAX_MNT_COUNT		20	/* Allow 20 mounts */
#define EXT2_DFL_CHECKINTERVAL		0	/* Don't use interval check */

/*
 * Behaviour when detecting errors
 */
#define EXT2_ERRORS_CONTINUE		1	/* Continue execution */
#define EXT2_ERRORS_RO			2	/* Remount fs read-only */
#define EXT2_ERRORS_PANIC		3	/* Panic */
#define EXT2_ERRORS_DEFAULT		EXT2_ERRORS_CONTINUE

/*
 * Structure of the super block
 */
struct ext2_super_block {
	__le32	s_inodes_count;		/* Inodes count */
	__le32	s_blocks_count;		/* Blocks count */
	__le32	s_r_blocks_count;	/* Reserved blocks count */
	__le32	s_free_blocks_count;	/* Free blocks count */
	__le32	s_free_inodes_count;	/* Free inodes count */
	__le32	s_first_data_block;	/* First Data Block */
	__le32	s_log_block_size;	/* Block size */
	__le32	s_log_frag_size;	/* Fragment size */
	__le32	s_blocks_per_group;	/* # Blocks per group */
	__le32	s_frags_per_group;	/* # Fragments per group */
	__le32	s_inodes_per_group;	/* # Inodes per group */
	__le32	s_mtime;		/* Mount time */
	__le32	s_wtime;		/* Write time */
	__le16	s_mnt_count;		/* Mount count */
	__le16	s_max_mnt_count;	/* Maximal mount count */
	__le16	s_magic;		/* Magic signature */
	__le16	s_state;		/* File system state */
	__le16	s_errors;		/* Behaviour when detecting errors */
	__le16	s_minor_rev_level; 	/* minor revision level */
	__le32	s_lastcheck;		/* time of last check */
	__le32	s_checkinterval;	/* max. time between checks */
	__le32	s_creator_os;		/* OS */
	__le32	s_rev_level;		/* Revision level */
	__le16	s_def_resuid;		/* Default uid for reserved blocks */
	__le16	s_def_resgid;		/* Default gid for reserved blocks */
	/*
	 * These fields are for EXT2_DYNAMIC_REV superblocks only.
	 *
	 * Note: the difference between the compatible feature set and
	 * the incompatible feature set is that if there is a bit set
	 * in the incompatible feature set that the kernel doesn't
	 * know about, it should refuse to mount the filesystem.
	 *
	 * e2fsck's requirements are more strict; if it doesn't know
	 * about a feature in either the compatible or incompatible
	 * feature set, it must abort and not try to meddle with
	 * things it doesn't understand...
	 */
	__le32	s_first_ino; 		/* First non-reserved inode */
	__le16   s_inode_size; 		/* size of inode structure */
	__le16	s_block_group_nr; 	/* block group # of this superblock */
	__le32	s_feature_compat; 	/* compatible feature set */
	__le32	s_feature_incompat; 	/* incompatible feature set */
	__le32	s_feature_ro_compat; 	/* readonly-compatible feature set */
	__u8	s_uuid[16];		/* 128-bit uuid for volume */
	char	s_volume_name[16]; 	/* volume name */
	char	s_last_mounted[64]; 	/* directory where last mounted */
	__le32	s_algorithm_usage_bitmap; /* For compression */
	/*
	 * Performance hints.  Directory preallocation should only
	 * happen if the EXT2_COMPAT_PREALLOC flag is on.
	 */
	__u8	s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
	__u8	s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
	__u16	s_padding1;
	/*
	 * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
	 */
	__u8	s_journal_uuid[16];	/* uuid of journal superblock */
	__u32	s_journal_inum;		/* inode number of journal file */
	__u32	s_journal_dev;		/* device number of journal file */
	__u32	s_last_orphan;		/* start of list of inodes to delete */
	__u32	s_hash_seed[4];		/* HTREE hash seed */
	__u8	s_def_hash_version;	/* Default hash version to use */
	__u8	s_reserved_char_pad;
	__u16	s_reserved_word_pad;
	__le32	s_default_mount_opts;
 	__le32	s_first_meta_bg; 	/* First metablock block group */
	__u32	s_reserved[190];	/* Padding to the end of the block */
};

/*
 * Codes for operating systems
 */
#define EXT2_OS_LINUX		0
#define EXT2_OS_HURD		1
#define EXT2_OS_MASIX		2
#define EXT2_OS_FREEBSD		3
#define EXT2_OS_LITES		4

/*
 * Revision levels
 */
#define EXT2_GOOD_OLD_REV	0	/* The good old (original) format */
#define EXT2_DYNAMIC_REV	1 	/* V2 format w/ dynamic inode sizes */

#define EXT2_CURRENT_REV	EXT2_GOOD_OLD_REV
#define EXT2_MAX_SUPP_REV	EXT2_DYNAMIC_REV

#define EXT2_GOOD_OLD_INODE_SIZE 128

/*
 * Feature set definitions
 */

#define EXT2_HAS_COMPAT_FEATURE(sb,mask)			\
	( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask)			\
	( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask)			\
	( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
#define EXT2_SET_COMPAT_FEATURE(sb,mask)			\
	EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask)			\
	EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
#define EXT2_SET_INCOMPAT_FEATURE(sb,mask)			\
	EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask)			\
	EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask)			\
	EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask)			\
	EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)

#define EXT2_FEATURE_COMPAT_DIR_PREALLOC	0x0001
#define EXT2_FEATURE_COMPAT_IMAGIC_INODES	0x0002
#define EXT3_FEATURE_COMPAT_HAS_JOURNAL		0x0004
#define EXT2_FEATURE_COMPAT_EXT_ATTR		0x0008
#define EXT2_FEATURE_COMPAT_RESIZE_INO		0x0010
#define EXT2_FEATURE_COMPAT_DIR_INDEX		0x0020
#define EXT2_FEATURE_COMPAT_ANY			0xffffffff

#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER	0x0001
#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE	0x0002
#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR	0x0004
#define EXT2_FEATURE_RO_COMPAT_ANY		0xffffffff

#define EXT2_FEATURE_INCOMPAT_COMPRESSION	0x0001
#define EXT2_FEATURE_INCOMPAT_FILETYPE		0x0002
#define EXT3_FEATURE_INCOMPAT_RECOVER		0x0004
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV	0x0008
#define EXT2_FEATURE_INCOMPAT_META_BG		0x0010
#define EXT2_FEATURE_INCOMPAT_ANY		0xffffffff

#define EXT2_FEATURE_COMPAT_SUPP	EXT2_FEATURE_COMPAT_EXT_ATTR
#define EXT2_FEATURE_INCOMPAT_SUPP	(EXT2_FEATURE_INCOMPAT_FILETYPE| \
					 EXT2_FEATURE_INCOMPAT_META_BG)
#define EXT2_FEATURE_RO_COMPAT_SUPP	(EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER| \
					 EXT2_FEATURE_RO_COMPAT_LARGE_FILE| \
					 EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED	~EXT2_FEATURE_RO_COMPAT_SUPP
#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED	~EXT2_FEATURE_INCOMPAT_SUPP

/*
 * Default values for user and/or group using reserved blocks
 */
#define	EXT2_DEF_RESUID		0
#define	EXT2_DEF_RESGID		0

/*
 * Default mount options
 */
#define EXT2_DEFM_DEBUG		0x0001
#define EXT2_DEFM_BSDGROUPS	0x0002
#define EXT2_DEFM_XATTR_USER	0x0004
#define EXT2_DEFM_ACL		0x0008
#define EXT2_DEFM_UID16		0x0010
    /* Not used by ext2, but reserved for use by ext3 */
#define EXT3_DEFM_JMODE		0x0060
#define EXT3_DEFM_JMODE_DATA	0x0020
#define EXT3_DEFM_JMODE_ORDERED	0x0040
#define EXT3_DEFM_JMODE_WBACK	0x0060

/*
 * Structure of a directory entry
 */
#define EXT2_NAME_LEN 255

struct ext2_dir_entry {
	__le32	inode;			/* Inode number */
	__le16	rec_len;		/* Directory entry length */
	__le16	name_len;		/* Name length */
	char	name[EXT2_NAME_LEN];	/* File name */
};

/*
 * The new version of the directory entry.  Since EXT2 structures are
 * stored in intel byte order, and the name_len field could never be
 * bigger than 255 chars, it's safe to reclaim the extra byte for the
 * file_type field.
 */
struct ext2_dir_entry_2 {
	__le32	inode;			/* Inode number */
	__le16	rec_len;		/* Directory entry length */
	__u8	name_len;		/* Name length */
	__u8	file_type;
	char	name[EXT2_NAME_LEN];	/* File name */
};

/*
 * Ext2 directory file types.  Only the low 3 bits are used.  The
 * other bits are reserved for now.
 */
enum {
	EXT2_FT_UNKNOWN		= 0,
	EXT2_FT_REG_FILE	= 1,
	EXT2_FT_DIR		= 2,
	EXT2_FT_CHRDEV		= 3,
	EXT2_FT_BLKDEV		= 4,
	EXT2_FT_FIFO		= 5,
	EXT2_FT_SOCK		= 6,
	EXT2_FT_SYMLINK		= 7,
	EXT2_FT_MAX
};

/*
 * EXT2_DIR_PAD defines the directory entries boundaries
 *
 * NOTE: It must be a multiple of 4
 */
#define EXT2_DIR_PAD		 	4
#define EXT2_DIR_ROUND 			(EXT2_DIR_PAD - 1)
#define EXT2_DIR_REC_LEN(name_len)	(((name_len) + 8 + EXT2_DIR_ROUND) & \
					 ~EXT2_DIR_ROUND)
#define EXT2_MAX_REC_LEN		((1<<16)-1)

#endif	/* _LINUX_EXT2_FS_H */

repo_name: aarf/bkauler

license: unknown


code:
#include<stdio.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<time.h>
int main(int argc,char **argv)
{
	char *tableName;
	int pad,a,i,align,pos=0,lineLen=8,totalLen=0;
	FILE *fin = stdin,*fout = stdout;

	if (argc < 2 || argc > 3) {
		fprintf(stderr, "%s tableName [pad] < inputFile > outputFile\n ", argv[0]);
		return 1;
	}
	tableName=argv[1];
	pad = argc == 3 ?  atoi(argv[2]) : 1;

	fprintf(fout, "unsigned char %s[] = {\n",tableName);
	fprintf(fout, "\t");
	for (a = fgetc(fin); a != EOF ; a = fgetc(fin)) {
		totalLen++;
		if (pos >= lineLen ) {
			fprintf(fout ,",\n\t");
			pos=0;
		} else if (pos > 0)
			fprintf(fout,", ");

		fprintf(fout, "0x%02x", a);
		pos++;

	}

	align= totalLen % pad;
	if (align != 0) {
		a = pad - align;
		totalLen+=a;
		for (i=0;i<a;i++) {
			if (pos >= lineLen ) {
				fprintf(fout, ",\n\t");
				pos=0;
			} else if (pos > 0)
				fprintf(fout, ", ");
			else
				fprintf(fout, "\t");
			fprintf(fout, "0x00");
			pos++;
		}
	}
	fprintf (fout, "\n};\n\nconst unsigned int %s_len = %i;\n", tableName, totalLen);

	struct stat st;
	if (fstat(fileno(fin), &st) == -1) {
		perror("fstat");
		return 1;
	}
	fprintf (fout,"\nconst int %s_mtime = %ld;\n", tableName, st.st_mtime);

	return 0;
}


code:
diff -Naur f2fs-tools-1.6.1ORIG/tools/f2fs_io_parse.c f2fs-tools-1.6.1/tools/f2fs_io_parse.c
--- f2fs-tools-1.6.1ORIG/tools/f2fs_io_parse.c	2016-03-23 05:06:51.000000000 +0800
+++ f2fs-tools-1.6.1/tools/f2fs_io_parse.c	2016-05-01 18:57:04.139668498 +0800
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <sys/queue.h>
+#include "queue.h"
 #include <assert.h>
 #include <locale.h>

diff -Naur f2fs-tools-1.6.1ORIG/tools/queue.h f2fs-tools-1.6.1/tools/queue.h
--- f2fs-tools-1.6.1ORIG/tools/queue.h	1970-01-01 08:00:00.000000000 +0800
+++ f2fs-tools-1.6.1/tools/queue.h	2015-10-02 03:45:31.000000000 +0800
@@ -0,0 +1,574 @@
+/*
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)queue.h	8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef	_SYS_QUEUE_H_
+#define	_SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list.  Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction.  Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define	LIST_HEAD(name, type)						\
+struct name {								\
+	struct type *lh_first;	/* first element */			\
+}
+
+#define	LIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	LIST_ENTRY(type)						\
+struct {								\
+	struct type *le_next;	/* next element */			\
+	struct type **le_prev;	/* address of previous next element */	\
+}
+
+/*
+ * List functions.
+ */
+#define	LIST_INIT(head) do {						\
+	(head)->lh_first = NULL;					\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
+	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
+		(listelm)->field.le_next->field.le_prev =		\
+		    &(elm)->field.le_next;				\
+	(listelm)->field.le_next = (elm);				\
+	(elm)->field.le_prev = &(listelm)->field.le_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.le_prev = (listelm)->field.le_prev;		\
+	(elm)->field.le_next = (listelm);				\
+	*(listelm)->field.le_prev = (elm);				\
+	(listelm)->field.le_prev = &(elm)->field.le_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_HEAD(head, elm, field) do {				\
+	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
+		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+	(head)->lh_first = (elm);					\
+	(elm)->field.le_prev = &(head)->lh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_REMOVE(elm, field) do {					\
+	if ((elm)->field.le_next != NULL)				\
+		(elm)->field.le_next->field.le_prev = 			\
+		    (elm)->field.le_prev;				\
+	*(elm)->field.le_prev = (elm)->field.le_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_FOREACH(var, head, field)					\
+	for ((var) = ((head)->lh_first);				\
+		(var);							\
+		(var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
+ */
+#define	LIST_EMPTY(head)		((head)->lh_first == NULL)
+#define	LIST_FIRST(head)		((head)->lh_first)
+#define	LIST_NEXT(elm, field)		((elm)->field.le_next)
+
+
+/*
+ * Singly-linked List definitions.
+ */
+#define	SLIST_HEAD(name, type)						\
+struct name {								\
+	struct type *slh_first;	/* first element */			\
+}
+
+#define	SLIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	SLIST_ENTRY(type)						\
+struct {								\
+	struct type *sle_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#define	SLIST_INIT(head) do {						\
+	(head)->slh_first = NULL;					\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
+	(elm)->field.sle_next = (slistelm)->field.sle_next;		\
+	(slistelm)->field.sle_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
+	(elm)->field.sle_next = (head)->slh_first;			\
+	(head)->slh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_REMOVE_HEAD(head, field) do {				\
+	(head)->slh_first = (head)->slh_first->field.sle_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_REMOVE(head, elm, type, field) do {			\
+	if ((head)->slh_first == (elm)) {				\
+		SLIST_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		struct type *curelm = (head)->slh_first;		\
+		while(curelm->field.sle_next != (elm))			\
+			curelm = curelm->field.sle_next;		\
+		curelm->field.sle_next =				\
+		    curelm->field.sle_next->field.sle_next;		\
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_FOREACH(var, head, field)					\
+	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
+#define	SLIST_FIRST(head)	((head)->slh_first)
+#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
+
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define	STAILQ_HEAD(name, type)					\
+struct name {								\
+	struct type *stqh_first;	/* first element */			\
+	struct type **stqh_last;	/* addr of last next element */		\
+}
+
+#define	STAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).stqh_first }
+
+#define	STAILQ_ENTRY(type)						\
+struct {								\
+	struct type *stqe_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define	STAILQ_INIT(head) do {						\
+	(head)->stqh_first = NULL;					\
+	(head)->stqh_last = &(head)->stqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)	\
+		(head)->stqh_last = &(elm)->field.stqe_next;		\
+	(head)->stqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.stqe_next = NULL;					\
+	*(head)->stqh_last = (elm);					\
+	(head)->stqh_last = &(elm)->field.stqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+		(head)->stqh_last = &(elm)->field.stqe_next;		\
+	(listelm)->field.stqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_REMOVE_HEAD(head, field) do {				\
+	if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+		(head)->stqh_last = &(head)->stqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_REMOVE(head, elm, type, field) do {			\
+	if ((head)->stqh_first == (elm)) {				\
+		STAILQ_REMOVE_HEAD((head), field);			\
+	} else {							\
+		struct type *curelm = (head)->stqh_first;		\
+		while (curelm->field.stqe_next != (elm))			\
+			curelm = curelm->field.stqe_next;		\
+		if ((curelm->field.stqe_next =				\
+			curelm->field.stqe_next->field.stqe_next) == NULL) \
+			    (head)->stqh_last = &(curelm)->field.stqe_next; \
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->stqh_first);				\
+		(var);							\
+		(var) = ((var)->field.stqe_next))
+
+#define	STAILQ_CONCAT(head1, head2) do {				\
+	if (!STAILQ_EMPTY((head2))) {					\
+		*(head1)->stqh_last = (head2)->stqh_first;		\
+		(head1)->stqh_last = (head2)->stqh_last;		\
+		STAILQ_INIT((head2));					\
+	}								\
+} while (/*CONSTCOND*/0)
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
+#define	STAILQ_FIRST(head)	((head)->stqh_first)
+#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
+
+
+/*
+ * Simple queue definitions.
+ */
+#define	SIMPLEQ_HEAD(name, type)					\
+struct name {								\
+	struct type *sqh_first;	/* first element */			\
+	struct type **sqh_last;	/* addr of last next element */		\
+}
+
+#define	SIMPLEQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).sqh_first }
+
+#define	SIMPLEQ_ENTRY(type)						\
+struct {								\
+	struct type *sqe_next;	/* next element */			\
+}
+
+/*
+ * Simple queue functions.
+ */
+#define	SIMPLEQ_INIT(head) do {						\
+	(head)->sqh_first = NULL;					\
+	(head)->sqh_last = &(head)->sqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)	\
+		(head)->sqh_last = &(elm)->field.sqe_next;		\
+	(head)->sqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.sqe_next = NULL;					\
+	*(head)->sqh_last = (elm);					\
+	(head)->sqh_last = &(elm)->field.sqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+		(head)->sqh_last = &(elm)->field.sqe_next;		\
+	(listelm)->field.sqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_REMOVE_HEAD(head, field) do {				\
+	if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+		(head)->sqh_last = &(head)->sqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_REMOVE(head, elm, type, field) do {			\
+	if ((head)->sqh_first == (elm)) {				\
+		SIMPLEQ_REMOVE_HEAD((head), field);			\
+	} else {							\
+		struct type *curelm = (head)->sqh_first;		\
+		while (curelm->field.sqe_next != (elm))			\
+			curelm = curelm->field.sqe_next;		\
+		if ((curelm->field.sqe_next =				\
+			curelm->field.sqe_next->field.sqe_next) == NULL) \
+			    (head)->sqh_last = &(curelm)->field.sqe_next; \
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->sqh_first);				\
+		(var);							\
+		(var) = ((var)->field.sqe_next))
+
+/*
+ * Simple queue access methods.
+ */
+#define	SIMPLEQ_EMPTY(head)		((head)->sqh_first == NULL)
+#define	SIMPLEQ_FIRST(head)		((head)->sqh_first)
+#define	SIMPLEQ_NEXT(elm, field)	((elm)->field.sqe_next)
+
+
+/*
+ * Tail queue definitions.
+ */
+#define	_TAILQ_HEAD(name, type, qual)					\
+struct name {								\
+	qual type *tqh_first;		/* first element */		\
+	qual type *qual *tqh_last;	/* addr of last next element */	\
+}
+#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)
+
+#define	TAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).tqh_first }
+
+#define	_TAILQ_ENTRY(type, qual)					\
+struct {								\
+	qual type *tqe_next;		/* next element */		\
+	qual type *qual *tqe_prev;	/* address of previous next element */\
+}
+#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue functions.
+ */
+#define	TAILQ_INIT(head) do {						\
+	(head)->tqh_first = NULL;					\
+	(head)->tqh_last = &(head)->tqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)	\
+		(head)->tqh_first->field.tqe_prev =			\
+		    &(elm)->field.tqe_next;				\
+	else								\
+		(head)->tqh_last = &(elm)->field.tqe_next;		\
+	(head)->tqh_first = (elm);					\
+	(elm)->field.tqe_prev = &(head)->tqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.tqe_next = NULL;					\
+	(elm)->field.tqe_prev = (head)->tqh_last;			\
+	*(head)->tqh_last = (elm);					\
+	(head)->tqh_last = &(elm)->field.tqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+		(elm)->field.tqe_next->field.tqe_prev = 		\
+		    &(elm)->field.tqe_next;				\
+	else								\
+		(head)->tqh_last = &(elm)->field.tqe_next;		\
+	(listelm)->field.tqe_next = (elm);				\
+	(elm)->field.tqe_prev = &(listelm)->field.tqe_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
+	(elm)->field.tqe_next = (listelm);				\
+	*(listelm)->field.tqe_prev = (elm);				\
+	(listelm)->field.tqe_prev = &(elm)->field.tqe_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_REMOVE(head, elm, field) do {				\
+	if (((elm)->field.tqe_next) != NULL)				\
+		(elm)->field.tqe_next->field.tqe_prev = 		\
+		    (elm)->field.tqe_prev;				\
+	else								\
+		(head)->tqh_last = (elm)->field.tqe_prev;		\
+	*(elm)->field.tqe_prev = (elm)->field.tqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_FOREACH(var, head, field)					\
+	for ((var) = ((head)->tqh_first);				\
+		(var);							\
+		(var) = ((var)->field.tqe_next))
+
+#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
+	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
+		(var);							\
+		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+#define	TAILQ_CONCAT(head1, head2, field) do {				\
+	if (!TAILQ_EMPTY(head2)) {					\
+		*(head1)->tqh_last = (head2)->tqh_first;		\
+		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
+		(head1)->tqh_last = (head2)->tqh_last;			\
+		TAILQ_INIT((head2));					\
+	}								\
+} while (/*CONSTCOND*/0)
+
+/*
+ * Tail queue access methods.
+ */
+#define	TAILQ_EMPTY(head)		((head)->tqh_first == NULL)
+#define	TAILQ_FIRST(head)		((head)->tqh_first)
+#define	TAILQ_NEXT(elm, field)		((elm)->field.tqe_next)
+
+#define	TAILQ_LAST(head, headname) \
+	(*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define	TAILQ_PREV(elm, headname, field) \
+	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+
+/*
+ * Circular queue definitions.
+ */
+#define	CIRCLEQ_HEAD(name, type)					\
+struct name {								\
+	struct type *cqh_first;		/* first element */		\
+	struct type *cqh_last;		/* last element */		\
+}
+
+#define	CIRCLEQ_HEAD_INITIALIZER(head)					\
+	{ (void *)&head, (void *)&head }
+
+#define	CIRCLEQ_ENTRY(type)						\
+struct {								\
+	struct type *cqe_next;		/* next element */		\
+	struct type *cqe_prev;		/* previous element */		\
+}
+
+/*
+ * Circular queue functions.
+ */
+#define	CIRCLEQ_INIT(head) do {						\
+	(head)->cqh_first = (void *)(head);				\
+	(head)->cqh_last = (void *)(head);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	(elm)->field.cqe_next = (listelm)->field.cqe_next;		\
+	(elm)->field.cqe_prev = (listelm);				\
+	if ((listelm)->field.cqe_next == (void *)(head))		\
+		(head)->cqh_last = (elm);				\
+	else								\
+		(listelm)->field.cqe_next->field.cqe_prev = (elm);	\
+	(listelm)->field.cqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {		\
+	(elm)->field.cqe_next = (listelm);				\
+	(elm)->field.cqe_prev = (listelm)->field.cqe_prev;		\
+	if ((listelm)->field.cqe_prev == (void *)(head))		\
+		(head)->cqh_first = (elm);				\
+	else								\
+		(listelm)->field.cqe_prev->field.cqe_next = (elm);	\
+	(listelm)->field.cqe_prev = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_HEAD(head, elm, field) do {			\
+	(elm)->field.cqe_next = (head)->cqh_first;			\
+	(elm)->field.cqe_prev = (void *)(head);				\
+	if ((head)->cqh_last == (void *)(head))				\
+		(head)->cqh_last = (elm);				\
+	else								\
+		(head)->cqh_first->field.cqe_prev = (elm);		\
+	(head)->cqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.cqe_next = (void *)(head);				\
+	(elm)->field.cqe_prev = (head)->cqh_last;			\
+	if ((head)->cqh_first == (void *)(head))			\
+		(head)->cqh_first = (elm);				\
+	else								\
+		(head)->cqh_last->field.cqe_next = (elm);		\
+	(head)->cqh_last = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_REMOVE(head, elm, field) do {				\
+	if ((elm)->field.cqe_next == (void *)(head))			\
+		(head)->cqh_last = (elm)->field.cqe_prev;		\
+	else								\
+		(elm)->field.cqe_next->field.cqe_prev =			\
+		    (elm)->field.cqe_prev;				\
+	if ((elm)->field.cqe_prev == (void *)(head))			\
+		(head)->cqh_first = (elm)->field.cqe_next;		\
+	else								\
+		(elm)->field.cqe_prev->field.cqe_next =			\
+		    (elm)->field.cqe_next;				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->cqh_first);				\
+		(var) != (const void *)(head);				\
+		(var) = ((var)->field.cqe_next))
+
+#define	CIRCLEQ_FOREACH_REVERSE(var, head, field)			\
+	for ((var) = ((head)->cqh_last);				\
+		(var) != (const void *)(head);				\
+		(var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define	CIRCLEQ_EMPTY(head)		((head)->cqh_first == (void *)(head))
+#define	CIRCLEQ_FIRST(head)		((head)->cqh_first)
+#define	CIRCLEQ_LAST(head)		((head)->cqh_last)
+#define	CIRCLEQ_NEXT(elm, field)	((elm)->field.cqe_next)
+#define	CIRCLEQ_PREV(elm, field)	((elm)->field.cqe_prev)
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field)				\
+	(((elm)->field.cqe_next == (void *)(head))			\
+	    ? ((head)->cqh_first)					\
+	    : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field)				\
+	(((elm)->field.cqe_prev == (void *)(head))			\
+	    ? ((head)->cqh_last)					\
+	    : (elm->field.cqe_prev))
+
+#endif	/* sys/queue.h */


code:
Port 8091
BindAddress 0.0.0.0
MaxHTTPConnections 30
MaxClients 20
MaxBandwidth 200000
CustomLog -

<Feed cam1.ffm>
File /tmp/cam1.ffm
FileMaxSize 100000K
#ACL allow 12.34.56.78
</Feed>

<Stream cam1.webm>
Feed cam1.ffm
Format webm
VideoCodec libvpx
VideoSize 640x480
VideoFrameRate 15
VideoGopSize 15
VideoBufferSize 1
AVOptionVideo flags +global_header
AVOptionVideo libvpx:cpu-used 10
#AVOptionVideo qmin [1|10]
#AVOptionVideo libvpx:qmin 1
#AVOptionVideo qmax [31|42]
#AVOptionVideo libvpx:qmax 31
#AVOptionVideo libvpx:quality good
VideoHighQuality
PreRoll 0
NoAudio StartSendOnKey
VideoBitRate 8192
</Stream>

<Stream stat.html>
Format status
#ACL allow 12.34.56.78
</Stream>


code:
--- mozilla-release.org/tools/profiler/LulElf.cpp
+++ mozilla-release/tools/profiler/LulElf.cpp
@@ -53,6 +53,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <arpa/inet.h>
+#include <libgen.h>

 #include <set>
 #include <string>


code:
--- a/xpcom/ds/nsMathUtils.h
+++ b/xpcom/ds/nsMathUtils.h
@@ -104,7 +104,7 @@
 #ifdef WIN32
   // NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
   return !!_finite(aNum);
-#elif defined(XP_DARWIN)
+#elif 1
   // Darwin has deprecated |finite| and recommends |isfinite|. The former is
   // not present in the iOS SDK.
   return std::isfinite(aNum);


code:
--- mozilla-release.org/nsprpub/pr/src/misc/prnetdb.c	2013-10-25 22:27:38.000000000 +0000
+++ mozilla-release/nsprpub/pr/src/misc/prnetdb.c	2013-10-31 00:53:23.677525286 +0000
@@ -89,6 +89,11 @@
 #define _PR_HAVE_5_ARG_GETPROTO_R
 #endif

+#undef _PR_HAVE_GETPROTO_R
+#undef _PR_HAVE_GETPROTO_R_INT
+#undef _PR_HAVE_GETPROTO_R_POINTER
+#undef _PR_HAVE_5_ARG_GETPROTO_R
+
 #if !defined(_PR_HAVE_GETPROTO_R)
 PRLock* _getproto_lock = NULL;
 #endif


code:
diff -r 06549f98901b ipc/chromium/src/base/file_util.h
--- a/ipc/chromium/src/base/file_util.h	Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/file_util.h	Fri Aug 02 14:42:20 2013 +0000
@@ -16,7 +16,11 @@
 #include <sys/stat.h>
 #elif defined(OS_POSIX)
 #include <sys/types.h>
+#ifndef __GLIBC__
+#define NO_FTS
+#else
 #include <fts.h>
+#endif
 #include <sys/stat.h>
 #endif

diff -r 06549f98901b ipc/chromium/src/base/file_util_posix.cc
--- a/ipc/chromium/src/base/file_util_posix.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/file_util_posix.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -8,13 +8,16 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <fnmatch.h>
-#ifndef ANDROID
+#ifndef __GLIBC__
+#define NO_FTS
+#endif
+#ifndef NO_FTS
 #include <fts.h>
 #endif
 #include <libgen.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/errno.h>
+#include <errno.h>
 #include <sys/mman.h>
 #define _DARWIN_USE_64_BIT_INODE // Use 64-bit inode data structures
 #include <sys/stat.h>
@@ -121,7 +124,7 @@
   if (!recursive)
     return (rmdir(path_str) == 0);

-#ifdef ANDROID
+#ifdef NO_FTS
   // XXX Need ftsless impl for bionic
   return false;
 #else
@@ -194,7 +197,7 @@
     return false;
   }

-#ifdef ANDROID
+#ifdef NO_FTS
   // XXX Need ftsless impl for bionic
   return false;
 #else
diff -r 06549f98901b ipc/chromium/src/base/time_posix.cc
--- a/ipc/chromium/src/base/time_posix.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/ipc/chromium/src/base/time_posix.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -65,8 +65,10 @@
   timestruct.tm_wday   = exploded.day_of_week;  // mktime/timegm ignore this
   timestruct.tm_yday   = 0;     // mktime/timegm ignore this
   timestruct.tm_isdst  = -1;    // attempt to figure it out
+#ifdef __GLIBC__
   timestruct.tm_gmtoff = 0;     // not a POSIX field, so mktime/timegm ignore
   timestruct.tm_zone   = NULL;  // not a POSIX field, so mktime/timegm ignore
+#endif

   time_t seconds;
 #ifdef ANDROID
diff -r 06549f98901b media/libcubeb/src/cubeb_alsa.c
--- a/media/libcubeb/src/cubeb_alsa.c	Fri Aug 02 14:36:52 2013 +0000
+++ b/media/libcubeb/src/cubeb_alsa.c	Fri Aug 02 14:42:20 2013 +0000
@@ -6,6 +6,7 @@
  */
 #undef NDEBUG
 #define _BSD_SOURCE
+#define _POSIX_C_SOURCE 200112L
 #define _XOPEN_SOURCE 500
 #include <pthread.h>
 #include <sys/time.h>
diff -r 06549f98901b media/webrtc/trunk/testing/gtest/src/gtest.cc
--- a/media/webrtc/trunk/testing/gtest/src/gtest.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/media/webrtc/trunk/testing/gtest/src/gtest.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -48,6 +48,8 @@
 #include <sstream>
 #include <vector>

+#include <sys/socket.h>
+
 #if GTEST_OS_LINUX

 // TODO(kenton@google.com): Use autoconf to detect availability of
diff -r 06549f98901b netwerk/sctp/src/netinet/sctp_os_userspace.h
--- a/netwerk/sctp/src/netinet/sctp_os_userspace.h	Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h	Fri Aug 02 14:42:20 2013 +0000
@@ -408,7 +407,7 @@
 /* #include <sys/param.h>  in FreeBSD defines MSIZE */
 /* #include <sys/ktr.h> */
 /* #include <sys/systm.h> */
-#if defined(__Userspace_os_Windows)
+#if defined(__Userspace_os_Windows) || 1
 #include <user_queue.h>
 #else
 #include <sys/queue.h>
diff -r 06549f98901b netwerk/sctp/src/netinet/sctp_pcb.c
--- a/netwerk/sctp/src/netinet/sctp_pcb.c	Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/netinet/sctp_pcb.c	Fri Aug 02 14:42:20 2013 +0000
@@ -30,6 +30,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */

+#define _BSD_SOURCE /* for IPPORT_RESERVED */
+
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 246687 2013-02-11 21:02:49Z tuexen $");
diff -r 06549f98901b netwerk/sctp/src/user_queue.h
--- a/netwerk/sctp/src/user_queue.h	Fri Aug 02 14:36:52 2013 +0000
+++ b/netwerk/sctp/src/user_queue.h	Fri Aug 02 14:42:20 2013 +0000
@@ -31,9 +31,6 @@
 #ifndef _USER_QUEUE_H_
 #define	_USER_QUEUE_H_

-#if !defined (__Userspace_os_Windows)
-#include <sys/cdefs.h>
-#endif
 /*
  * This file defines four types of data structures: singly-linked lists,
  * singly-linked tail queues, lists and tail queues.
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -46,6 +46,9 @@
 #include <sys/stat.h>
 #include <unistd.h>

+// [Gregor] POSIX specifies dirname/basename as in libgen.h
+#include <libgen.h>
+
 #include <iostream>
 #include <set>
 #include <string>
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -41,6 +41,10 @@

 #include "common/using_std_string.h"

+#ifndef N_UNDF
+#define N_UNDF 0
+#endif
+
 using std::vector;

 namespace google_breakpad {
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h	Fri Aug 02 14:42:20 2013 +0000
@@ -53,7 +53,7 @@
 #include <config.h>
 #endif

-#ifdef HAVE_A_OUT_H
+#if 0
 #include <a.out.h>
 #endif
 #ifdef HAVE_MACH_O_NLIST_H
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/stab.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/stab.h	Fri Aug 02 14:42:20 2013 +0000
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)stab.h	8.1 (Berkeley) 6/2/93
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _STAB_H_
+#define _STAB_H_
+
+/*
+ * The following are symbols used by various debuggers and by the Pascal
+ * compiler.  Each of them must have one (or more) of the bits defined by
+ * the N_STAB mask set.
+ */
+
+#define	N_GSYM		0x20	/* global symbol */
+#define	N_FNAME		0x22	/* F77 function name */
+#define	N_FUN		0x24	/* procedure name */
+#define	N_STSYM		0x26	/* data segment variable */
+#define	N_LCSYM		0x28	/* bss segment variable */
+#define	N_MAIN		0x2a	/* main function name */
+#define	N_PC		0x30	/* global Pascal symbol */
+#define	N_RSYM		0x40	/* register variable */
+#define	N_SLINE		0x44	/* text segment line number */
+#define	N_DSLINE	0x46	/* data segment line number */
+#define	N_BSLINE	0x48	/* bss segment line number */
+#define	N_SSYM		0x60	/* structure/union element */
+#define	N_SO		0x64	/* main source file name */
+#define	N_LSYM		0x80	/* stack variable */
+#define	N_BINCL		0x82	/* include file beginning */
+#define	N_SOL		0x84	/* included source file name */
+#define	N_PSYM		0xa0	/* parameter variable */
+#define	N_EINCL		0xa2	/* include file end */
+#define	N_ENTRY		0xa4	/* alternate entry point */
+#define	N_LBRAC		0xc0	/* left bracket */
+#define	N_EXCL		0xc2	/* deleted include file */
+#define	N_RBRAC		0xe0	/* right bracket */
+#define	N_BCOMM		0xe2	/* begin common */
+#define	N_ECOMM		0xe4	/* end common */
+#define	N_ECOML		0xe8	/* end common (local name) */
+#define	N_LENG		0xfe	/* length of preceding entry */
+
+#endif
diff -r 06549f98901b toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h	Fri Aug 02 14:42:20 2013 +0000
@@ -2813,7 +2813,7 @@
     LSS_INLINE _syscall6(void*, mmap,              void*, s,
                          size_t,                   l, int,               p,
                          int,                      f, int,               d,
-                         __off64_t,                o)
+                         off_t,                o)

     LSS_INLINE _syscall4(int, newfstatat,         int,   d,
                          const char *,            p,
diff -r 06549f98901b toolkit/mozapps/update/common/updatedefines.h
--- a/toolkit/mozapps/update/common/updatedefines.h	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/mozapps/update/common/updatedefines.h	Fri Aug 02 14:42:20 2013 +0000
@@ -106,8 +106,10 @@
 #ifdef SOLARIS
 # include <sys/stat.h>
 #else
+#if !defined(__linux__) || defined(__GLIBC__)
 # include <fts.h>
 #endif
+#endif
 # include <dirent.h>

 #ifdef XP_MACOSX
diff -r 06549f98901b toolkit/mozapps/update/updater/updater.cpp
--- a/toolkit/mozapps/update/updater/updater.cpp	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/mozapps/update/updater/updater.cpp	Fri Aug 02 14:42:20 2013 +0000
@@ -3369,6 +3369,7 @@
 int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
 {
   int rv = OK;
+#if !defined(__linux__) || defined(__GLIBC__)
   FTS *ftsdir;
   FTSENT *ftsdirEntry;
   NS_tchar searchpath[MAXPATHLEN];
@@ -3471,6 +3472,7 @@
   }

   fts_close(ftsdir);
+#endif

   return rv;
 }
diff -r 06549f98901b toolkit/xre/nsSigHandlers.cpp
--- a/toolkit/xre/nsSigHandlers.cpp	Fri Aug 02 14:36:52 2013 +0000
+++ b/toolkit/xre/nsSigHandlers.cpp	Fri Aug 02 14:42:20 2013 +0000
@@ -15,6 +15,7 @@
 #include <signal.h>
 #include <stdio.h>
 #include <string.h>
+#include <sys/types.h>
 #include "prthread.h"
 #include "plstr.h"
 #include "prenv.h"
@@ -152,7 +153,7 @@
   status->__invalid = status->__denorm = status->__zdiv = status->__ovrfl = status->__undfl =
     status->__precis = status->__stkflt = status->__errsumm = 0;

-  __uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
+  u_int32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
   *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
   *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
 #endif
@@ -172,13 +173,13 @@
   *sw &= ~FPU_STATUS_FLAGS;
 #endif
 #if defined(__amd64__)
-  __uint16_t *cw = &uc->uc_mcontext.fpregs->cwd;
+  u_int16_t *cw = &uc->uc_mcontext.fpregs->cwd;
   *cw |= FPU_EXCEPTION_MASK;

-  __uint16_t *sw = &uc->uc_mcontext.fpregs->swd;
+  u_int16_t *sw = &uc->uc_mcontext.fpregs->swd;
   *sw &= ~FPU_STATUS_FLAGS;

-  __uint32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
+  u_int32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
   *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
   *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
 #endif
@@ -187,24 +188,24 @@
   ucontext_t *uc = (ucontext_t *)context;

 #if defined(__i386)
-  uint32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
+  u_int32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
   *cw |= FPU_EXCEPTION_MASK;

-  uint32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
+  u_int32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
   *sw &= ~FPU_STATUS_FLAGS;

   /* address of the instruction that caused the exception */
-  uint32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
+  u_int32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
   uc->uc_mcontext.gregs[REG_PC] = *ip;
 #endif
 #if defined(__amd64__)
-  uint16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
+  u_int16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
   *cw |= FPU_EXCEPTION_MASK;

-  uint16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
+  u_int16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
   *sw &= ~FPU_STATUS_FLAGS;

-  uint32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
+  u_int32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
   *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
   *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
 #endif
diff -r 06549f98901b tools/profiler/platform-linux.cc
--- a/tools/profiler/platform-linux.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/tools/profiler/platform-linux.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -66,7 +66,7 @@

 #define SIGNAL_SAVE_PROFILE SIGUSR2

-#if defined(__GLIBC__)
+#if 1
 // glibc doesn't implement gettid(2).
 #include <sys/syscall.h>
 pid_t gettid()
diff -r 06549f98901b tools/profiler/shared-libraries-linux.cc
--- a/tools/profiler/shared-libraries-linux.cc	Fri Aug 02 14:36:52 2013 +0000
+++ b/tools/profiler/shared-libraries-linux.cc	Fri Aug 02 14:42:20 2013 +0000
@@ -35,7 +35,9 @@
 #ifdef ANDROID
 #include "ElfLoader.h" // dl_phdr_info
 #else
+extern "C" { // [Gregor] musl bug
 #include <link.h> // dl_phdr_info
+}
 #endif
 #include <features.h>
 #include <dlfcn.h>


code:
--- mozilla-release.org/extensions/spellcheck/hunspell/src/hunspell_alloc_hooks.h	2013-10-25 22:27:17.000000000 +0000
+++ mozilla-release/extensions/spellcheck/hunspell/src/hunspell_alloc_hooks.h	2013-10-31 03:12:59.431910714 +0000
@@ -31,6 +31,7 @@
  *
  ******* END LICENSE BLOCK *******/

+#define alloc_hooks_h__
 #ifndef alloc_hooks_h__
 #define alloc_hooks_h__


code:
--- mozilla-release.org/tools/profiler/UnwinderThread2.cpp	2013-10-25 22:27:44.000000000 +0000
+++ mozilla-release/tools/profiler/UnwinderThread2.cpp	2013-10-31 02:52:32.435000745 +0000
@@ -8,6 +8,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
+#include <sys/types.h>

 #ifdef MOZ_VALGRIND
 # include <valgrind/helgrind.h>
--- mozilla-release.org/tools/profiler/local_debug_info_symbolizer.cc	2013-10-25 22:27:44.000000000 +0000
+++ mozilla-release/tools/profiler/local_debug_info_symbolizer.cc	2013-10-31 02:55:40.353986956 +0000
@@ -3,6 +3,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

+#include <sys/types.h>
 #include "PlatformMacros.h"
 #include "nsAutoPtr.h"

--- mozilla-release.org/tools/profiler/platform-linux.cc
+++ mozilla-release/tools/profiler/platform-linux.cc
@@ -560,12 +560,14 @@

 void TickSample::PopulateContext(void* aContext)
 {
+#ifdef __GLIBC__
   MOZ_ASSERT(aContext);
   ucontext_t* pContext = reinterpret_cast<ucontext_t*>(aContext);
   if (!getcontext(pContext)) {
     context = pContext;
     SetSampleContext(this, aContext);
   }
+#endif
 }

 void OS::SleepMicro(int microseconds)


code:
--- mozilla-release/python/virtualenv/virtualenv.py
+++ mozilla-release.patched/python/virtualenv/virtualenv.py
@@ -448,7 +448,46 @@
     else:
         shutil.copy2(src, dest)

+def symlinkfileordir(src, dest):
+    if os.path.exists(dest):
+        return
+    if os.path.isdir(src):
+        if not os.path.exists(dest):
+            os.makedirs(dest)
+        for fn in os.listdir(src):
+            symlinkfileordir(os.path.join(src, fn), os.path.join(dest, fn))
+    else:
+        if not os.path.exists(os.path.dirname(dest)):
+            os.makedirs(os.path.dirname(dest))
+        if not os.path.islink(src):
+            srcpath = os.path.abspath(src)
+        else:
+            srcpath = os.readlink(src)
+            if not srcpath[0] == '/':
+                # relative symlink, needs to be prefixed with absolute source path
+                srcpath = os.path.join(os.path.dirname(src), srcpath)
+                srcpath = os.path.abspath(srcpath)
+
+        logger.info('Symlinking %s :: %s -> %s', src, srcpath,  dest)
+        os.symlink(srcpath, dest)
+
+def install_executable(src, dest):
+	logger.info("foobar")
+	newdest = dest + ".org"
+	shutil.copyfile(src, newdest)
+	make_exe(newdest)
+	destprefix=os.path.dirname(dest)
+	destprefix=os.path.dirname(destprefix)
+	wrapper = "#!/bin/sh\nexport PYTHONHOME=%s\n" % destprefix
+	wrapper = wrapper + newdest + ' "$@"'
+	f = open(dest, "w")
+	f.write(wrapper)
+	f.close()
+	make_exe(dest)
+
 def copyfile(src, dest, symlink=True):
+    if symlink:
+        return symlinkfileordir(src, dest)
     if not os.path.exists(src):
         # Some bad symlink in the src
         logger.warn('Cannot find file %s (bad symlink)', src)
@@ -463,16 +502,19 @@
         srcpath = os.path.abspath(src)
     else:
         srcpath = os.readlink(src)
-    if symlink and hasattr(os, 'symlink') and not is_win:
-        logger.info('Symlinking %s', dest)
+        if not srcpath[0] == '/':
+		# relative symlink, needs to be prefixed with absolute source path
+		srcpath = os.path.join(os.path.dirname(src), srcpath)
+    if symlink and hasattr(os, 'symlink') and not is_win and not os.path.isdir(srcpath):
+        logger.info('Symlinking %s :: %s -> %s', src, srcpath,  dest)
         try:
             os.symlink(srcpath, dest)
         except (OSError, NotImplementedError):
             logger.info('Symlinking failed, copying to %s', dest)
-            copyfileordir(src, dest, symlink)
+            copyfileordir(srcpath, dest)
     else:
         logger.info('Copying to %s', dest)
-        copyfileordir(src, dest, symlink)
+        copyfileordir(srcpath, dest)

 def writefile(dest, content, overwrite=True):
     if not os.path.exists(dest):
@@ -763,7 +805,7 @@
     if 'adjust_options' in globals():
         adjust_options(options, args)

-    verbosity = options.verbose - options.quiet
+    verbosity = 1 - options.quiet
     logger = Logger([(Logger.level_for_integer(2 - verbosity), sys.stdout)])

     if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
@@ -1244,8 +1286,9 @@
     if sys.executable != py_executable:
         ## FIXME: could I just hard link?
         executable = sys.executable
-        shutil.copyfile(executable, py_executable)
-        make_exe(py_executable)
+
+        install_executable(executable, py_executable)
+
         if is_win or is_cygwin:
             pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe')
             if os.path.exists(pythonw):
@@ -1303,8 +1346,9 @@
                         % (expected_exe, secondary_exe, py_executable))
         else:
             logger.notify('Also creating executable in %s' % secondary_exe)
-            shutil.copyfile(sys.executable, secondary_exe)
-            make_exe(secondary_exe)
+            install_executable(sys.executable, secondary_exe)
+#            shutil.copyfile(sys.executable, secondary_exe)
+#            make_exe(secondary_exe)

     if '.framework' in prefix:
         if 'Python.framework' in prefix:
@@ -1485,6 +1529,12 @@
     home_dir = os.path.abspath(home_dir)
     ## FIXME: this is breaking things, removing for now:
     #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir
+    logger.warn("XXX overwriting distutils init.py %s" % os.path.join(distutils_path, '__init__.py'))
+    # we need to remove the old __init__.py, otherwise we'll overwrite it if it's a symlink
+    os.unlink(os.path.join(distutils_path, '__init__.py'))
+    if os.path.exists(os.path.join(distutils_path, '__init__.py')):
+        logger.warn("XXX the file still exists, wtf ?")
+        sys.exit(1)
     writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT)
     writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False)


code:
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -74,6 +74,10 @@
 #include "nsTraceRefcnt.h"
 #include "nsHashKeys.h"

+#ifndef BLOCK_SIZE
+#define BLOCK_SIZE  1024
+#endif
+
 using namespace mozilla;

 #define ENSURE_STAT_CACHE()                     \


code:
--- mozilla-esr38/gfx/skia/trunk/src/core/SkUtilsArm.cpp.org
+++ mozilla-esr38/gfx/skia/trunk/src/core/SkUtilsArm.cpp
@@ -47,6 +47,15 @@
 #  endif
 #endif

+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+  (__extension__                                  \
+    ({ long int __result;                             \
+       do __result = (long int) (expression);                     \
+       while (__result == -1L && errno == EINTR);                 \
+       __result; }))
+#endif
+
 // A function used to determine at runtime if the target CPU supports
 // the ARM NEON instruction set. This implementation is Linux-specific.
 static bool sk_cpu_arm_check_neon(void) {


code:
--- a/toolkit/library/libxul.mk
+++ b/toolkit/library/libxul.mk
@@ -58,8 +58,9 @@
 get_first_and_last = $(TOOLCHAIN_PREFIX)nm -g $1 | grep _NSModule$$ | grep -vw refptr | sort | sed -n 's/^.* _*\([^ ]*\)$$/\1/;1p;$$p'
 endif

-LOCAL_CHECKS = test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo "NSModules are not ordered appropriately" && exit 1 || exit 0
+# LOCAL_CHECKS = test "$$($(get_first_and_last) | xargs echo)" != "start_kPStaticModules_NSModule end_kPStaticModules_NSModule" && echo "NSModules are not ordered appropriately" && exit 1 || exit 0

 ifeq (Linux,$(OS_ARCH))
-LOCAL_CHECKS += ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0
+# LOCAL_CHECKS += ; test "$$($(TOOLCHAIN_PREFIX)readelf -l $1 | awk '$1 == "LOAD" { t += 1 } END { print t }')" -le 1 && echo "Only one PT_LOAD segment" && exit 1 || exit 0
+
 endif


code:
--- fuse-2.9.3.org/include/fuse_common.h
+++ fuse-2.9.3/include/fuse_common.h
@@ -28,8 +28,8 @@
 #define FUSE_MAKE_VERSION(maj, min)  ((maj) * 10 + (min))
 #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)

-/* This interface uses 64 bit off_t */
-#if _FILE_OFFSET_BITS != 64
+/* This interface uses 64 bit off_t, and only glibc has an implementation with 2 different sizes */
+#if defined(__GLIBC__) && _FILE_OFFSET_BITS != 64
 #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
 #endif


code:
--- fuse-2.9.3.org/lib/fuse_lowlevel.c
+++ fuse-2.9.3/lib/fuse_lowlevel.c
@@ -24,6 +24,7 @@
 #include <limits.h>
 #include <errno.h>
 #include <assert.h>
+#include <sys/file.h>

 #ifndef F_LINUX_SPECIFIC_BASE
 #define F_LINUX_SPECIFIC_BASE       1024
--- fuse-2.9.3.org/lib/fuse.c
+++ fuse-2.9.3/lib/fuse.c
@@ -37,6 +37,7 @@
 #include <sys/uio.h>
 #include <sys/time.h>
 #include <sys/mman.h>
+#include <sys/file.h>

 #define FUSE_NODE_SLAB 1


code:
--- fuse-2.9.3.org/lib/mount_util.c
+++ fuse-2.9.3/lib/mount_util.c
@@ -16,6 +16,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <limits.h>
+#include <paths.h>
 #ifndef __NetBSD__
 #include <mntent.h>
 #endif
--- fuse-2.9.3.org/util/fusermount.c
+++ fuse-2.9.3/util/fusermount.c
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <pwd.h>
+#include <paths.h>
 #include <mntent.h>
 #include <sys/wait.h>
 #include <sys/stat.h>


code:
--- gcc-3.4.6.org/gcc/mklibgcc.in
+++ gcc-3.4.6/gcc/mklibgcc.in
@@ -442,7 +442,7 @@

   libgcc_a_objs="$libgcc_objs $libgcc_st_objs"

-  if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
+  if [ "@libgcc_visibility@" = yes ]; then
     libgcc_a_objs=
     echo ""
     echo "libgcc/${dir}/stacknote.s: stmp-dirs"


code:
Stolen from Gentoo.  Thanks Mike Frysinger.
Following the logic of the binutils change upstream (the addition of the
new unlink_if_ordinary() function), we update collect2 so that it will
only unlink files if they are 'ordinary' (in other words, a regular file
or a symlink).

This allows us to do fun things like `gcc test.c -o /dev/null` and not
have to worry about the toolchain doing unlink(/dev/null) on us (cause
that sucks huge wang).  For example, this is common on a parisc/mips
machine:
# gcc test.c -o /dev/null
/usr/hppa2.0-unknown-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
# ls /dev/null
ls: /dev/null: No such file or directory

http://bugs.gentoo.org/79836

this has been fixed in upstream gcc via different means

--- gcc/gcc/collect2.c
+++ gcc/gcc/collect2.c
@@ -34,6 +34,12 @@
 #if ! defined( SIGCHLD ) && defined( SIGCLD )
 #  define SIGCHLD SIGCLD
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif

 #ifdef vfork /* Autoconf may define this to fork for us.  */
 # define VFORK_STRING "fork"
@@ -1574,14 +1603,24 @@
   do_wait (prog);
 }

-/* Unlink a file unless we are debugging.  */
-
+/* Unlink a file unless we are debugging or file is not normal.  */
+#ifndef S_ISLNK
+#ifdef S_IFLNK
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#else
+#define S_ISLNK(m) 0
+#define lstat stat
+#endif
+#endif
 static void
 maybe_unlink (const char *file)
 {
-  if (!debug)
-    unlink (file);
-  else
+  if (!debug) {
+    struct stat st;
+    if (lstat (file, &st) == 0
+        && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
+      unlink (file);
+  } else
     notice ("[Leaving %s]\n", file);
 }


code:
--- gcc-4.2.4.org/gcc/mklibgcc.in
+++ gcc-4.2.4/gcc/mklibgcc.in
@@ -148,7 +148,7 @@
 # Flag whether we need eh_dummy.c
 need_eh_dummy=

-if [ "$SHLIB_LINK" ]; then
+if true; then
   # Test -fvisibility=hidden.  We need both a -fvisibility=hidden on
   # the command line, and a #define to prevent libgcc2.h etc from
   # overriding that with #pragmas.  The dance with @ is to prevent


code:
--- gcc-4.5.3/configure
+++ gcc-patched/configure
@@ -3006,6 +3006,21 @@
 # Noconfigdirs are removed loudly.
 noconfigdirs=""

+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
+# Make sure we don't let target-libstdc++ be added if we didn't want it.
+if test x$with_target_libstdcxx = xno ; then
+  noconfigdirs="$noconfigdirs target-libstdc++-v3"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
--- gcc-4.5.3/configure.ac
+++ gcc-patched/configure.ac
@@ -252,6 +252,21 @@
 # Noconfigdirs are removed loudly.
 noconfigdirs=""

+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
+# Make sure we don't let target-libstdc++ be added if we didn't want it.
+if test x$with_target_libstdcxx = xno ; then
+  noconfigdirs="$noconfigdirs target-libstdc++-v3"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then


code:
--- gcc-4.5.3/gcc/configure
+++ gcc-patched/gcc/configure
@@ -5707,7 +5707,7 @@
   *)

 cat >>confdefs.h <<_ACEOF
-#define int8_t $ac_cv_c_int8_t
+//#define int8_t $ac_cv_c_int8_t
 _ACEOF
 ;;
 esac
@@ -5849,7 +5849,7 @@
        || ac_type='long int'

 cat >>confdefs.h <<_ACEOF
-#define intmax_t $ac_type
+//#define intmax_t $ac_type
 _ACEOF

 fi
@@ -8527,7 +8527,7 @@
 else

 cat >>confdefs.h <<_ACEOF
-#define ssize_t int
+//#define ssize_t int
 _ACEOF

 fi
@@ -8538,7 +8538,7 @@
 else

 cat >>confdefs.h <<_ACEOF
-#define caddr_t char *
+//#define caddr_t char *
 _ACEOF

 fi
@@ -8699,7 +8699,7 @@
 else

 cat >>confdefs.h <<_ACEOF
-#define pid_t int
+//#define pid_t int
 _ACEOF

 fi
@@ -9820,7 +9820,7 @@

 else

-$as_echo "#define rlim_t long" >>confdefs.h
+$as_echo "//#define rlim_t long" >>confdefs.h

 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext


code:
--- gcc-4.5.4.org/gcc/config/rs6000/linux-unwind.h	2012-11-22 20:11:07.264000002 +0100
+++ gcc-4.5.4/gcc/config/rs6000/linux-unwind.h	2012-11-22 20:16:39.769000002 +0100
@@ -175,6 +175,8 @@
 }
 #endif

+#ifdef __GLIBC__
+
 /* Find an entry in the process auxiliary vector.  The canonical way to
    test for VMX is to look at AT_HWCAP.  */

@@ -207,6 +209,8 @@
   return 0;
 }

+#endif
+
 /* Do code reading to identify a signal frame, and set the frame
    state data appropriately.  See unwind-dw2.c for the structs.  */

@@ -252,7 +256,11 @@

   if (hwcap == 0)
     {
+#ifdef __GLIBC__
       hwcap = ppc_linux_aux_vector (16);
+#else
+      hwcap = -1;
+#endif
       /* These will already be set if we found AT_HWCAP.  A nonzero
 	 value stops us looking again if for some reason we couldn't
 	 find AT_HWCAP.  */


code:
Fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
wrong warning when using the universal zero initializer {0}

Backported to GCC 4.7.4

Subject: 2014-06-05  S. Gilles  <sgilles@terpmail.umd.edu>
X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/95cdf3fdf2d440eb7775def8e35ab970651c33d9?hp=14a3093e9943937cbc63dfbf4d51ca60f8325b29
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211289 138bc75d-0d04-0410-961f-82ee72b054a4

--- gcc-4.7.4/gcc/c-typeck.c	2012-09-20 22:50:17.000000000 +0200
+++ gcc-4.7.4.patched/gcc/c-typeck.c	2014-08-03 16:26:14.515016910 +0200
@@ -68,9 +68,9 @@
 /* The level of nesting inside "typeof".  */
 int in_typeof;

-/* Nonzero if we've already printed a "missing braces around initializer"
-   message within this initializer.  */
-static int missing_braces_mentioned;
+/* Nonzero if we might need to print a "missing braces around
+   initializer" message within this initializer.  */
+static int found_missing_braces;

 static int require_constant_value;
 static int require_constant_elements;
@@ -6455,6 +6455,9 @@
 /* 1 if this constructor is erroneous so far.  */
 static int constructor_erroneous;

+/* 1 if this constructor is the universal zero initializer { 0 }.  */
+static int constructor_zeroinit;
+
 /* Structure for managing pending initializer elements, organized as an
    AVL tree.  */

@@ -6616,7 +6619,7 @@
   constructor_stack = 0;
   constructor_range_stack = 0;

-  missing_braces_mentioned = 0;
+  found_missing_braces = 0;

   spelling_base = 0;
   spelling_size = 0;
@@ -6711,6 +6714,7 @@
   constructor_type = type;
   constructor_incremental = 1;
   constructor_designated = 0;
+  constructor_zeroinit = 1;
   designator_depth = 0;
   designator_erroneous = 0;

@@ -6908,11 +6912,8 @@
 	set_nonincremental_init (braced_init_obstack);
     }

-  if (implicit == 1 && warn_missing_braces && !missing_braces_mentioned)
-    {
-      missing_braces_mentioned = 1;
-      warning_init (OPT_Wmissing_braces, "missing braces around initializer");
-    }
+  if (implicit == 1)
+    found_missing_braces = 1;

   if (TREE_CODE (constructor_type) == RECORD_TYPE
 	   || TREE_CODE (constructor_type) == UNION_TYPE)
@@ -7045,17 +7046,23 @@
 	}
     }

+  if (VEC_length (constructor_elt, constructor_elements) != 1)
+    constructor_zeroinit = 0;
+
+  /* Warn when some structs are initialized with direct aggregation.  */
+  if (!implicit && found_missing_braces && warn_missing_braces
+      && !constructor_zeroinit)
+    {
+      warning_init (OPT_Wmissing_braces,
+		    "missing braces around initializer");
+    }
+
   /* Warn when some struct elements are implicitly initialized to zero.  */
   if (warn_missing_field_initializers
       && constructor_type
       && TREE_CODE (constructor_type) == RECORD_TYPE
       && constructor_unfilled_fields)
     {
-	bool constructor_zeroinit =
-	 (VEC_length (constructor_elt, constructor_elements) == 1
-	  && integer_zerop
-	      (VEC_index (constructor_elt, constructor_elements, 0)->value));
-
 	/* Do not warn for flexible array members or zero-length arrays.  */
 	while (constructor_unfilled_fields
 	       && (!DECL_SIZE (constructor_unfilled_fields)
@@ -8170,6 +8177,9 @@
   designator_depth = 0;
   designator_erroneous = 0;

+  if (!implicit && value.value && !integer_zerop (value.value))
+    constructor_zeroinit = 0;
+
   /* Handle superfluous braces around string cst as in
      char x[] = {"foo"}; */
   if (string_flag


code:
--- gcc-4.8.1/boehm-gc/os_dep.c.orig	2013-09-17 07:46:00.969884340 +0000
+++ gcc-4.8.1/boehm-gc/os_dep.c	2013-09-17 06:53:53.629884946 +0000
@@ -26,7 +26,7 @@
 #     define __KERNEL__
 #     include <asm/signal.h>
 #     undef __KERNEL__
-#   else
+#   elif defined(__GLIBC__)
       /* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
       /* struct sigcontext.  libc6 (glibc2) uses "struct sigcontext" in     */
       /* prototypes, so we have to include the top-level sigcontext.h to    */
--- gcc-4.8.2/boehm-gc/dyn_load.c.orig	2014-02-17 14:13:09.519850231 +0200
+++ gcc-4.8.2/boehm-gc/dyn_load.c	2014-02-17 14:14:27.906093514 +0200
@@ -459,9 +459,7 @@
 /* For glibc 2.2.4+.  Unfortunately, it doesn't work for older	*/
 /* versions.  Thanks to Jakub Jelinek for most of the code.	*/

-# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
-     && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-         || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+# if (defined(LINUX) || defined (__GLIBC__))

 /* We have the header files for a glibc that includes dl_iterate_phdr.	*/
 /* It may still not be available in the library on the target system.   */
--- gcc-4.8.2/boehm-gc/include/private/gcconfig.h.orig	2014-02-17 14:14:36.026049422 +0200
+++ gcc-4.8.2/boehm-gc/include/private/gcconfig.h	2014-02-17 14:17:11.345207887 +0200
@@ -684,7 +684,7 @@
 #       ifdef __ELF__
 #            define DYNAMIC_LOADING
 #	     include <features.h>
-#	     if defined(__GLIBC__)&& __GLIBC__>=2
+#	     if 1
 #              define SEARCH_FOR_DATA_START
 #	     else /* !GLIBC2 */
                extern char **__environ;
@@ -1147,7 +1147,7 @@
 #              define DATASTART ((ptr_t)((((word) (_etext)) + 0xfff) & ~0xfff))
 #	     endif
 #	     include <features.h>
-#	     if defined(__GLIBC__) && __GLIBC__ >= 2
+#	     if 1
 #		 define SEARCH_FOR_DATA_START
 #	     else
      	         extern char **__environ;
@@ -1367,7 +1367,7 @@
 #       define HBLKSIZE 4096
 #     endif
 #     define USE_GENERIC_PUSH_REGS
-#     if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2
+#     if 1
 #        define LINUX_STACKBOTTOM
 #     else
 #        define STACKBOTTOM 0x80000000
@@ -1858,7 +1858,7 @@
 #       ifdef __ELF__
 #            define DYNAMIC_LOADING
 #	     include <features.h>
-#	     if defined(__GLIBC__) && __GLIBC__ >= 2
+#	     if 1
 #		 define SEARCH_FOR_DATA_START
 #	     else
      	         extern char **__environ;


code:
--- gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc.orig	2014-02-18 18:46:14.897880526 +0200
+++ gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc	2014-02-18 18:50:08.766613550 +0200
@@ -24,6 +24,13 @@

 #ifdef HAVE_ICONV
 #include <iconv.h>
+#include <endian.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define UCS2_CHARSET "UCS-2BE"
+#else
+#define UCS2_CHARSET "UCS-2LE"
+#endif

 template<typename T>
 static inline size_t
@@ -45,7 +52,7 @@
   _Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
   buffer[len] = '\0';

-  iconv_t h = iconv_open ("UCS-2", buffer);
+  iconv_t h = iconv_open (UCS2_CHARSET, buffer);
   if (h == (iconv_t) -1)
     throw new ::java::io::UnsupportedEncodingException (encoding);

@@ -99,18 +106,6 @@
 	throw new ::java::io::CharConversionException ();
     }

-  if (iconv_byte_swap)
-    {
-      size_t max = (old_out - outavail) / sizeof (jchar);
-      for (size_t i = 0; i < max; ++i)
-	{
-	  // Byte swap.
-	  jchar c = (((out[outpos + i] & 0xff) << 8)
-		     | ((out[outpos + i] >> 8) & 0xff));
-	  outbuf[i] = c;
-	}
-    }
-
   inpos += old_in - inavail;
   return (old_out - outavail) / sizeof (jchar);
 #else /* HAVE_ICONV */
@@ -145,7 +140,7 @@
   _Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
   buffer[len] = '\0';

-  iconv_t h = iconv_open (buffer, "UCS-2");
+  iconv_t h = iconv_open (buffer, UCS2_CHARSET);
   if (h == (iconv_t) -1)
     throw new ::java::io::UnsupportedEncodingException (encoding);

@@ -187,20 +182,6 @@
   char *inbuf = (char *) &chars[inpos];
   char *outbuf = (char *) &out[count];

-  if (iconv_byte_swap)
-    {
-      // Ugly performance penalty -- don't use losing systems!
-      temp_buffer = (jchar *) _Jv_Malloc (inlength * sizeof (jchar));
-      for (int i = 0; i < inlength; ++i)
-	{
-	  // Byte swap.
-	  jchar c = (((chars[inpos + i] & 0xff) << 8)
-		     | ((chars[inpos + i] >> 8) & 0xff));
-	  temp_buffer[i] = c;
-	}
-      inbuf = (char *) temp_buffer;
-    }
-
   size_t loop_old_in = old_in;
   while (1)
     {
@@ -252,44 +233,7 @@
 jboolean
 gnu::gcj::convert::IOConverter::iconv_init (void)
 {
-  // Some versions of iconv() always return their UCS-2 results in
-  // big-endian order, and they also require UCS-2 inputs to be in
-  // big-endian order.  For instance, glibc 2.1.3 does this.  If the
-  // UTF-8=>UCS-2 iconv converter has this feature, then we assume
-  // that all UCS-2 converters do.  (This might not be the best
-  // heuristic, but is is all we've got.)
-  jboolean result = false;
-#ifdef HAVE_ICONV
-  iconv_t handle = iconv_open ("UCS-2", "UTF-8");
-  if (handle != (iconv_t) -1)
-    {
-      jchar c;
-      unsigned char in[4];
-      char *inp, *outp;
-      size_t inc, outc, r;
-
-      // This is the UTF-8 encoding of \ufeff.  At least Tru64 UNIX libiconv
-      // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
-      in[0] = 0xef;
-      in[1] = 0xbb;
-      in[2] = 0xbf;
-      in[3] = 0x00;
-
-      inp = (char *) in;
-      inc = 4;
-      outp = (char *) &c;
-      outc = 2;
-
-      r = iconv_adapter (iconv, handle, &inp, &inc, &outp, &outc);
-      // Conversion must be complete for us to use the result.
-      if (r != (size_t) -1 && inc == 0 && outc == 0)
-	result = (c != 0xfeff);
-
-      // Release iconv handle.
-      iconv_close (handle);
-    }
-#endif /* HAVE_ICONV */
-  return result;
+  return false;
 }

 void


code:
--- gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc.orig	2014-02-18 10:55:08.617678779 +0200
+++ gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc	2014-02-18 10:56:31.927227453 +0200
@@ -289,7 +289,7 @@
   // just default to `en_US'.
   setlocale (LC_ALL, "");
   char *locale = setlocale (LC_MESSAGES, "");
-  if (locale && strlen (locale) >= 2)
+  if (locale && strlen (locale) >= 2 && (locale[2] == '\0' || locale[2] == '_'))
     {
       char buf[3];
       buf[2] = '\0';
--- gcc-4.8.2/libjava/posix-threads.cc.orig	2014-02-18 13:22:01.789933726 +0200
+++ gcc-4.8.2/libjava/posix-threads.cc	2014-02-18 13:29:50.924058875 +0200
@@ -657,6 +657,7 @@
   struct sched_param param;
   pthread_attr_t attr;
   struct starter *info;
+  size_t ss;

   if (data->flags & FLAG_START)
     return;
@@ -675,8 +676,25 @@
   // Set stack size if -Xss option was given.
   if (gcj::stack_size > 0)
     {
-      int e = pthread_attr_setstacksize (&attr, gcj::stack_size);
+      ss = gcj::stack_size;
+    }
+  else
+    {
+      int e = pthread_attr_getstacksize (&attr, &ss);
+      if (e != 0)
+        JvFail (strerror (e));
+
+      // Request at least 1meg of stack
+      if (ss >= 1024 * 1024)
+        ss = 0;
+      else
+        ss = 1024 * 1024;
+    }
+
+  if (ss)
+    {
+      int e = pthread_attr_setstacksize (&attr, ss);
       if (e != 0)
 	JvFail (strerror (e));
     }

   info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter));


code:
--- gcc-4.7.3/libitm/config/arm/hwcap.cc	2011-12-15 03:24:05.000000000 +0000
+++ gcc-4.7.3.patched/libitm/config/arm/hwcap.cc	2013-07-10 13:57:20.977000004 +0000
@@ -40,7 +40,7 @@

 #ifdef __linux__
 #include <unistd.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <elf.h>

 static void __attribute__((constructor))


code:
# HG changeset patch
# Parent 65cd23493c45f2a531ca15ffea563d6110143cdd
New config.sub for GCC versions too early for the update.

diff -r 65cd23493c45 -r 355cec477536 config.sub
--- a/config.sub	Tue Aug 27 15:49:27 2013 -0400
+++ b/config.sub	Tue Aug 27 15:51:14 2013 -0400
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 #   2011 Free Software Foundation, Inc.

-timestamp='2011-10-29'
+timestamp='2011-03-23'

 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -125,6 +125,7 @@
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | \
   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | \
   kopensolaris*-gnu* | \
@@ -251,17 +252,13 @@
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
 	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-        | be32 | be64 \
 	| bfin \
 	| c4x | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
 	| fido | fr30 | frv \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
-	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
 	| maxq | mb | microblaze | mcore | mep | metag \
@@ -295,7 +292,7 @@
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
-	| rl78 | rx \
+	| rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
@@ -304,7 +301,7 @@
 	| spu \
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| v850 | v850e \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -361,7 +358,6 @@
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
-	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| clipper-* | craynv-* | cydra-* \
@@ -370,10 +366,8 @@
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
-	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@@ -407,7 +401,7 @@
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
+	| romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
@@ -415,11 +409,10 @@
 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
 	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
+	| tile-* | tilegx-* \
 	| tron-* \
 	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
+	| v850-* | v850e-* | vax-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -820,10 +813,6 @@
 		basic_machine=i370-ibm
 		os=-mvs
 		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
 	ncr3000)
 		basic_machine=i486-ncr
 		os=-sysv4
@@ -1132,8 +1121,13 @@
 		basic_machine=t90-cray
 		os=-unicos
 		;;
+	# This must be matched before tile*.
+	tilegx*)
+		basic_machine=tilegx-unknown
+		os=-linux-gnu
+		;;
 	tile*)
-		basic_machine=$basic_machine-unknown
+		basic_machine=tile-unknown
 		os=-linux-gnu
 		;;
 	tx39)
@@ -1346,6 +1340,7 @@
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-uclibc* \
+	      | -linux-musl* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \


code:
--- gcc-4.7.3/gcc/configure
+++ gcc-4.7.3patched/gcc/configure
@@ -26886,7 +26886,9 @@

 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dl_iterate_phdr in target C library" >&5
 $as_echo_n "checking dl_iterate_phdr in target C library... " >&6; }
-gcc_cv_target_dl_iterate_phdr=unknown
+
+# musl specific patch - we always set gcc_cv_target_dl_iterate_phdr to yes
+gcc_cv_target_dl_iterate_phdr=yes
 case "$target" in
   # Restrict to Solaris 11+.  While most of the Solaris 11 linker changes
   # were backported to Solaris 10 Update 10, dl_iterate_phdr only lives in


code:
From: amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 15 Feb 2013 13:53:40 +0000 (+0000)
Subject: 	PR target/55431
X-Git-Tag: gcc-4_8_0-release~416
X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/2a0bfd56d1b6a8ece8fb852691ea32713c7891b3

	PR target/55431
	* config/rs6000/linux-unwind.h (ppc_linux_aux_vector): Delete.
	(ppc_fallback_frame_state): Always set up save locations for fp
	and altivec.  Don't bother with non-callee-saved regs, r0-r13
	except for r2 on ppc64, fr0-fr13, v0-v19, vscr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196077 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/libgcc/config/rs6000/linux-unwind.h b/libgcc/config/rs6000/linux-unwind.h
index 3a2da6e..c9273c4 100644
--- a/libgcc/config/rs6000/linux-unwind.h
+++ b/libgcc/config/rs6000/linux-unwind.h
@@ -26,7 +26,6 @@
 #define R_CR2		70
 #define R_VR0		77
 #define R_VRSAVE	109
-#define R_VSCR		110

 struct gcc_vregs
 {
@@ -175,38 +174,6 @@ get_regs (struct _Unwind_Context *context)
 }
 #endif

-/* Find an entry in the process auxiliary vector.  The canonical way to
-   test for VMX is to look at AT_HWCAP.  */
-
-static long
-ppc_linux_aux_vector (long which)
-{
-  /* __libc_stack_end holds the original stack passed to a process.  */
-  extern long *__libc_stack_end;
-  long argc;
-  char **argv;
-  char **envp;
-  struct auxv
-  {
-    long a_type;
-    long a_val;
-  } *auxp;
-
-  /* The Linux kernel puts argc first on the stack.  */
-  argc = __libc_stack_end[0];
-  /* Followed by argv, NULL terminated.  */
-  argv = (char **) __libc_stack_end + 1;
-  /* Followed by environment string pointers, NULL terminated. */
-  envp = argv + argc + 1;
-  while (*envp++)
-    continue;
-  /* Followed by the aux vector, zero terminated.  */
-  for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp)
-    if (auxp->a_type == which)
-      return auxp->a_val;
-  return 0;
-}
-
 /* Do code reading to identify a signal frame, and set the frame
    state data appropriately.  See unwind-dw2.c for the structs.  */

@@ -216,8 +183,8 @@ static _Unwind_Reason_Code
 ppc_fallback_frame_state (struct _Unwind_Context *context,
 			  _Unwind_FrameState *fs)
 {
-  static long hwcap = 0;
   struct gcc_regs *regs = get_regs (context);
+  struct gcc_vregs *vregs;
   long new_cfa;
   int i;

@@ -229,12 +196,15 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
   fs->regs.cfa_reg = STACK_POINTER_REGNUM;
   fs->regs.cfa_offset = new_cfa - (long) context->cfa;

-  for (i = 0; i < 32; i++)
-    if (i != STACK_POINTER_REGNUM)
-      {
-	fs->regs.reg[i].how = REG_SAVED_OFFSET;
-	fs->regs.reg[i].loc.offset = (long) &regs->gpr[i] - new_cfa;
-      }
+#ifdef __powerpc64__
+  fs->regs.reg[2].how = REG_SAVED_OFFSET;
+  fs->regs.reg[2].loc.offset = (long) &regs->gpr[2] - new_cfa;
+#endif
+  for (i = 14; i < 32; i++)
+    {
+      fs->regs.reg[i].how = REG_SAVED_OFFSET;
+      fs->regs.reg[i].loc.offset = (long) &regs->gpr[i] - new_cfa;
+    }

   fs->regs.reg[R_CR2].how = REG_SAVED_OFFSET;
   /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit
@@ -250,57 +220,35 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
   fs->retaddr_column = ARG_POINTER_REGNUM;
   fs->signal_frame = 1;

-  if (hwcap == 0)
+  /* If we have a FPU...  */
+  for (i = 14; i < 32; i++)
     {
-      hwcap = ppc_linux_aux_vector (16);
-      /* These will already be set if we found AT_HWCAP.  A nonzero
-	 value stops us looking again if for some reason we couldn't
-	 find AT_HWCAP.  */
-#ifdef __powerpc64__
-      hwcap |= 0xc0000000;
-#else
-      hwcap |= 0x80000000;
-#endif
+      fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
+      fs->regs.reg[i + 32].loc.offset = (long) &regs->fpr[i] - new_cfa;
     }

-  /* If we have a FPU...  */
-  if (hwcap & 0x08000000)
-    for (i = 0; i < 32; i++)
-      {
-	fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
-	fs->regs.reg[i + 32].loc.offset = (long) &regs->fpr[i] - new_cfa;
-      }
-
   /* If we have a VMX unit...  */
-  if (hwcap & 0x10000000)
-    {
-      struct gcc_vregs *vregs;
 #ifdef __powerpc64__
-      vregs = regs->vp;
+  vregs = regs->vp;
 #else
-      vregs = &regs->vregs;
+  vregs = &regs->vregs;
 #endif
-      if (regs->msr & (1 << 25))
+  if (regs->msr & (1 << 25))
+    {
+      for (i = 20; i < 32; i++)
 	{
-	  for (i = 0; i < 32; i++)
-	    {
-	      fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET;
-	      fs->regs.reg[i + R_VR0].loc.offset
-		= (long) &vregs->vr[i] - new_cfa;
-	    }
-
-	  fs->regs.reg[R_VSCR].how = REG_SAVED_OFFSET;
-	  fs->regs.reg[R_VSCR].loc.offset = (long) &vregs->vscr - new_cfa;
+	  fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET;
+	  fs->regs.reg[i + R_VR0].loc.offset = (long) &vregs->vr[i] - new_cfa;
 	}
-
-      fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET;
-      fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa;
     }

+  fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET;
+  fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa;
+
   /* If we have SPE register high-parts... we check at compile-time to
      avoid expanding the code for all other PowerPC.  */
 #ifdef __SPE__
-  for (i = 0; i < 32; i++)
+  for (i = 14; i < 32; i++)
     {
       fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].how = REG_SAVED_OFFSET;
       fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].loc.offset


code:
--- gcc-4.7.3.org/libgcc/unwind-dw2-fde-dip.c
+++ gcc-4.7.3/libgcc/unwind-dw2-fde-dip.c
@@ -47,28 +47,13 @@
 #include "unwind-compat.h"
 #include "gthr.h"

-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
-    && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-	|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
 # define USE_PT_GNU_EH_FRAME
-#endif
-
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
-    && defined(__FreeBSD__) && __FreeBSD__ >= 7
-# define ElfW __ElfN
-# define USE_PT_GNU_EH_FRAME
-#endif
-
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
-    && defined(__OpenBSD__)
-# define ElfW(type) Elf_##type
-# define USE_PT_GNU_EH_FRAME
-#endif
-
-#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
-    && defined(TARGET_DL_ITERATE_PHDR) \
-    && defined(__sun__) && defined(__svr4__)
-# define USE_PT_GNU_EH_FRAME
+# ifdef __OpenBSD__
+#  define ElfW(type) Elf_##typ
+# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
+#  define ElfW __ElfN
+# endif
 #endif

 #if defined(USE_PT_GNU_EH_FRAME)


code:
--- gcc-4.7.4.old/libgcc/Makefile.in
+++ gcc-4.7.4/libgcc/Makefile.in
@@ -207,7 +207,7 @@
 export toolexecdir
 export toolexeclibdir

-version := $(shell $(CC) -dumpversion)
+version := $(shell cat $(srcdir)/../gcc/BASE-VER)

 ifeq ($(decimal_float),yes)
 ifeq ($(enable_decimal_float),bid)


code:
--- gcc-4.7.4.org/gcc/gcc.c
+++ gcc-4.7.4/gcc/gcc.c
@@ -603,7 +603,7 @@

 #ifndef LINK_SSP_SPEC
 #ifdef TARGET_LIBC_PROVIDES_SSP
-#define LINK_SSP_SPEC "%{fstack-protector:}"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
 #else
 #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
 #endif