lsof/lsof.patch

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 36
88242dc55a66
child 464
3e2a08d916c6
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

     1 Index: Configure
     2 diff -Nau Configure.orig Configure
     3 --- Configure.orig	2009-03-25 20:24:01.000000000 +0100
     4 +++ Configure	2009-04-01 18:03:19.553379145 +0200
     5 @@ -417,7 +417,7 @@
     6        fi	# }
     7      fi	# }
     8      LSOF_TGT="aix"
     9 -    echo $LSOF_CC | grep gcc > /dev/null
    10 +    $LSOF_CC --version | grep GCC > /dev/null
    11      if test $? -eq 0	# {
    12      then
    14 @@ -571,7 +571,7 @@
    16  	    rm -f dialects/aix/aix5/j2/j2_snapshot.h
    17  	  fi	# }
    18 -	  echo $LSOF_CC | grep gcc > /dev/null
    19 +	  $LSOF_CC --version | grep GCC > /dev/null
    20  	  if test $? -eq 0	# {
    21  	  then
    23 @@ -609,7 +609,7 @@
    24        # This is AIX >= 5 on ia64.
    26  	LSOF_TSTK64=1
    27 -	echo $LSOF_CC | grep gcc > /dev/null
    28 +	$LSOF_CC --version | grep GCC > /dev/null
    29  	if test $? -eq 0	# {
    30  	then
    32 @@ -686,7 +686,7 @@
    33  	  fi	# }
    34  	  LSOF_TSTK64=1
    35  	  LSOF_TMP1=1
    36 -	  echo $LSOF_CC | grep gcc > /dev/null
    37 +	  $LSOF_CC --version | grep GCC > /dev/null
    38  	  if test $? -eq 0	# {
    39  	  then
    40  	    LSOF_CFGF="$LSOF_CFGF -maix64"
    41 @@ -733,7 +733,7 @@
    42      fi	#}
    43      LSOF_CFGF="$LSOF_CFGF -DAIXV=$LSOF_VERS"
    44      LSOF_DIALECT_DIR=aix
    45 -    echo $LSOF_CC | grep gcc > /dev/null
    46 +    $LSOF_CC --version | grep GCC > /dev/null
    47      if test $? -eq 0 	# {
    48      then
    50 @@ -2193,7 +2193,7 @@
    51  	fi	# }
    52        fi	# }
    53      fi	# }
    54 -    echo $LSOF_CC | grep gcc > /dev/null
    55 +    $LSOF_CC --version | grep GCC > /dev/null
    56      if test $? -eq 0	# {
    57      then
    58        LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
    59 @@ -2247,7 +2247,7 @@
    60        then
    61  	LSOF_CFGF="$LSOF_CFGF -Ae +DD32"
    62        else
    63 -	echo $LSOF_CC | grep -q gcc
    64 +	$LSOF_CC --version | grep -q GCC
    65  	if test $? -ne 0	# {
    66  	then
    67  	  LSOF_CFGF="$LSOF_CFGF +DD32"
    68 @@ -2331,7 +2331,7 @@
    69  	    echo "* NOTICE!  Configuring for 64 bit HP-UX *"
    70  	    echo "*                                       *"
    71  	    echo "*****************************************"
    72 -	    echo $LSOF_CC | grep gcc > /dev/null
    73 +	    $LSOF_CC --version | grep GCC > /dev/null
    74  	    if test $? -eq 0	# {
    75  	    then
    77 @@ -2400,7 +2400,7 @@
    78  	  else
    79  	    LSOF_CFGF="$LSOF_CFGF -D_FILE_OFFSET_BITS=64"
    80  	    LSOF_CINFO="${LSOF_CINFO}, 32 bit HP-UX"
    81 -	    echo $LSOF_CC | grep gcc > /dev/null
    82 +	    $LSOF_CC --version | grep GCC > /dev/null
    83  	    if test $? -ne 0	# {
    84  	    then
    85  	      LSOF_CFGF="$LSOF_CFGF +DAportable"
    86 @@ -3609,7 +3609,7 @@
    87  	LSOF_CCV=`$LSOF_CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'`
    88        fi	# }
    89      fi	# }
    90 -    echo $LSOF_CC | grep gcc > /dev/null
    91 +    $LSOF_CC --version | grep GCC > /dev/null
    92      if test $? -eq 0	# {
    93      then
    94        LSOF_CFGL="-w"
    95 @@ -4246,6 +4246,17 @@
    96  	LSOF_TSTBIGF=" "
    97  	LSOF_TSTLFLG="-lsocket -lnsl"
    98  	LSOF_VERS="100000"
    99 + 	if [ ".`isainfo -k`" = .amd64 ]; then
   100 + 	    LSOF_CFGL="$LSOF_CFGL -lmp -lmd5 -lscf -ldoor -luutil"
   101 + 	fi
   102 +	;;
   103 +      5.11*)
   104 +	LSOF_TSTBIGF=" "
   105 +	LSOF_TSTLFLG="-lsocket -lnsl"
   106 +	LSOF_VERS="110000"
   107 + 	if [ ".`isainfo -k`" = .amd64 ]; then
   108 + 	    LSOF_CFGL="$LSOF_CFGL -lmp -lmd5 -lscf -ldoor -luutil"
   109 + 	fi
   110  	;;
   111        *)
   112  	echo Unknown Solaris version: $LSOF_VSTR
   113 @@ -4323,7 +4334,7 @@
   114        ;;
   115      20500|20501)
   116        ;;
   117 -    20600|70000|80000|90000|100000)
   118 +    20600|70000|80000|90000|100000|110000)
   119        if test "X$SOLARIS_26PR_GWINDOWS" = "X"	# {
   120        then
   121  	rm -f ${LSOF_TMPC}.*
   122 @@ -4332,7 +4343,7 @@
   123  	echo "main(){" >> ${LSOF_TMPC}.c
   124  	echo "enum prnodetype p=PR_GWINDOWS;}" >> ${LSOF_TMPC}.c
   125  	echo "Testing prdata.h for PR_GWINDOWS, using $LSOF_CC"
   126 -	echo $LSOF_CC | grep gcc > /dev/null
   127 +	$LSOF_CC --version | grep GCC > /dev/null
   128  	if test $? -eq 0	# {
   129  	then
   130  	  $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x  > /dev/null 2>&1
   131 @@ -4357,7 +4368,7 @@
   132  	echo "main(){" >> ${LSOF_TMPC}.c
   133  	echo "enum prnodetype p=PR_LDT;}" >> ${LSOF_TMPC}.c
   134  	echo "Testing prdata.h for PR_LDT, using $LSOF_CC"
   135 -	echo $LSOF_CC | grep gcc > /dev/null
   136 +	$LSOF_CC --version | grep GCC > /dev/null
   137  	if test $? -eq 0	# {
   138  	then
   139  	  $LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
   140 @@ -4391,7 +4402,7 @@
   141  	echo $SOLARIS_KERNBITS | grep 64 > /dev/null
   142  	if test $? -eq 0	# {
   143  	then
   144 -	  echo $LSOF_CC | grep gcc > /dev/null
   145 +	  $LSOF_CC --version | grep GCC > /dev/null
   146  	  if test $? -eq 0	# {
   147  	  then
   149 @@ -4597,7 +4608,7 @@
   151        # Check for Solaris 10 or higher ZFS.
   153 -      if test -r ${LSOF_INCLUDE}/sys/fs/zfs.h	# {
   154 +      if false	# {
   155        then
   157        # Check for required ZFS kernel header files.
   158 @@ -4712,7 +4723,7 @@
   159        echo "main(){" >> ${LSOF_TMPC}.c
   160        echo "enum vtype p=VSOCK;}" >> ${LSOF_TMPC}.c
   161        echo "Testing vnode.h for VSOCK, using $LSOF_CC"
   162 -      echo $LSOF_CC | grep gcc > /dev/null
   163 +      $LSOF_CC --version | grep GCC > /dev/null
   164        if test $? -eq 0	# {
   165        then
   166  	$LSOF_CC ${LSOF_TMPC}.c -o ${LSOF_TMPC}.x > /dev/null 2>&1
   167 @@ -5398,7 +5409,7 @@
   168      echo "$i" >> $LSOF_TSTCFLG
   169    done	# }
   170  fi	# }
   171 -echo $LSOF_CC | grep gcc > /dev/null 2>&1
   172 +$LSOF_CC --version | grep GCC > /dev/null 2>&1
   173  if test $? -eq 0	# {
   174  then
   175    echo "-DLT_GCC" >> $LSOF_TSTCFLG
   176 Index: dialects/freebsd/machine.h
   177 diff -Nau dialects/freebsd/machine.h.orig dialects/freebsd/machine.h
   178 --- dialects/freebsd/machine.h.orig	2008-10-21 18:16:15.000000000 +0200
   179 +++ dialects/freebsd/machine.h	2009-04-01 18:07:54.041381807 +0200
   180 @@ -441,6 +441,11 @@
   181   */
   183  /* #define	HASSECURITY	1 */
   184 +#if    FREEBSDV>=6000
   185 +#define        HASSECURITY     1
   186 +#define        HAS_SI_PRIV     1
   187 +#endif /* FREEBSDV>=6000 */
   188 +
   191  /*
   192 Index: dialects/sun/dnode.c
   193 diff -Nau dialects/sun/dnode.c.orig dialects/sun/dnode.c
   194 --- dialects/sun/dnode.c.orig	2009-03-25 20:22:21.000000000 +0100
   195 +++ dialects/sun/dnode.c	2009-04-01 18:07:54.041381807 +0200
   196 @@ -92,6 +92,8 @@
   197  #define	LOOKDEV_ALL	(LOOKDEV_TAB | LOOKDEV_CLONE | LOOKDEV_PSEUDO)
   198  					/* look all places */
   200 +#define NOOP ((void)0)
   201 +
   203  /*
   204   * SAM-FS definitions
   205 @@ -2078,7 +2080,9 @@
   206  	    if (kvs && kv.vfs_data
   207  	    && !kread((KA_T)kv.vfs_data, (char *)&pcfs, sizeof(pcfs))) {
   209 -#if	solaris>=70000
   210 +#if	solaris>=110000  /* pcfs_entps doesn't exist any more */
   211 +		NOOP;
   212 +#elif	solaris>=70000
   213  		Lf->inode = (INODETYPE)pc_makenodeid(pc.pc_eblkno,
   214  			    pc.pc_eoffset,
   215  			    pc.pc_entry.pcd_attr,
   216 @@ -2092,7 +2096,7 @@
   217  			    pc.pc_eoffset,
   218  			    &pc.pc_entry,
   219  			    pcfs.pcfs_entps);
   220 -#endif	/* solaris>=70000 */
   221 +#endif	/* solaris>=110000 */
   223  		Lf->inp_ty = 1;
   224  	    }

mercurial