Submitted By: Jim Gifford (patches at jg555 dot com) Date: 2007-02-14 Initial Package Version: 4.1.2 Origin: Jim Gifford Rediffed against 4.1.0 by Chris Staub Rediffed against 4.1.2 by Jim Gifford Rediffed and additions against 4.2.0 by Joe Ciccone Rediffed against 4.2.1 by Joe Ciccone Upstream Status: On Hold Description: Makes GCC Posix Compliant diff -Naur gcc-4.2.1.orig/contrib/test_summary gcc-4.2.1/contrib/test_summary --- gcc-4.2.1.orig/contrib/test_summary 2004-08-26 01:51:22.000000000 -0400 +++ gcc-4.2.1/contrib/test_summary 2007-07-22 19:31:03.000000000 -0400 @@ -106,7 +106,7 @@ srcdir = configflags; sub(/\/configure .*/, "", srcdir); printf "LAST_UPDATED: "; - system("tail -1 " srcdir "/LAST_UPDATED"); + system("tail -n 1 " srcdir "/LAST_UPDATED"); print ""; sub(/^[^ ]*\/configure */, " ", configflags); diff -Naur gcc-4.2.1.orig/gcc/configure gcc-4.2.1/gcc/configure --- gcc-4.2.1.orig/gcc/configure 2007-01-01 22:44:31.000000000 -0500 +++ gcc-4.2.1/gcc/configure 2007-07-22 19:31:03.000000000 -0400 @@ -14120,7 +14120,7 @@ # Therefore, use diff -b for the comparisons. if test x$gcc_cv_objdump != x \ && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \ - | tail -3 > conftest.got \ + | tail -n 3 > conftest.got \ && { diff -b conftest.lit conftest.got > /dev/null 2>&1 \ || diff -b conftest.big conftest.got > /dev/null 2>&1; } then diff -Naur gcc-4.2.1.orig/gcc/configure.ac gcc-4.2.1/gcc/configure.ac --- gcc-4.2.1.orig/gcc/configure.ac 2007-01-01 22:44:31.000000000 -0500 +++ gcc-4.2.1/gcc/configure.ac 2007-07-22 19:31:03.000000000 -0400 @@ -2227,7 +2227,7 @@ # Therefore, use diff -b for the comparisons. if test x$gcc_cv_objdump != x \ && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \ - | tail -3 > conftest.got \ + | tail -n 3 > conftest.got \ && { diff -b conftest.lit conftest.got > /dev/null 2>&1 \ || diff -b conftest.big conftest.got > /dev/null 2>&1; } then diff -Naur gcc-4.2.1.orig/gcc/testsuite/ada/acats/run_all.sh gcc-4.2.1/gcc/testsuite/ada/acats/run_all.sh --- gcc-4.2.1.orig/gcc/testsuite/ada/acats/run_all.sh 2006-09-14 06:12:03.000000000 -0400 +++ gcc-4.2.1/gcc/testsuite/ada/acats/run_all.sh 2007-07-22 19:31:03.000000000 -0400 @@ -68,7 +68,7 @@ ls ${i}?.adb > ${i}.lst 2> /dev/null ls ${i}*m.adb >> ${i}.lst 2> /dev/null ls ${i}.adb >> ${i}.lst 2> /dev/null - main=`tail -1 ${i}.lst` + main=`tail -n 1 ${i}.lst` } EXTERNAL_OBJECTS="" diff -Naur gcc-4.2.1.orig/libgomp/acinclude.m4 gcc-4.2.1/libgomp/acinclude.m4 --- gcc-4.2.1.orig/libgomp/acinclude.m4 2007-03-18 09:45:56.000000000 -0400 +++ gcc-4.2.1/libgomp/acinclude.m4 2007-07-22 19:31:03.000000000 -0400 @@ -147,7 +147,7 @@ # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. changequote(,) - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` changequote([,]) libgomp_gnu_ld_version=`echo $ldver | \ diff -Naur gcc-4.2.1.orig/libgomp/configure gcc-4.2.1/libgomp/configure --- gcc-4.2.1.orig/libgomp/configure 2007-07-19 10:33:56.000000000 -0400 +++ gcc-4.2.1/libgomp/configure 2007-07-22 19:31:03.000000000 -0400 @@ -9314,7 +9314,7 @@ # Start by getting the version number. I think the libtool test already # does some of this, but throws away the result. - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` libgomp_gnu_ld_version=`echo $ldver | \ diff -Naur gcc-4.2.1.orig/libjava/classpath/configure gcc-4.2.1/libjava/classpath/configure --- gcc-4.2.1.orig/libjava/classpath/configure 2007-01-17 13:10:26.000000000 -0500 +++ gcc-4.2.1/libjava/classpath/configure 2007-07-22 19:31:03.000000000 -0400 @@ -18514,7 +18514,7 @@ fi # shortcircut to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -n 1` else ac_cv_stdint_message="using $CC" fi diff -Naur gcc-4.2.1.orig/libjava/classpath/ltcf-c.sh gcc-4.2.1/libjava/classpath/ltcf-c.sh --- gcc-4.2.1.orig/libjava/classpath/ltcf-c.sh 2006-01-17 13:09:40.000000000 -0500 +++ gcc-4.2.1/libjava/classpath/ltcf-c.sh 2007-07-22 19:31:03.000000000 -0400 @@ -153,7 +153,7 @@ # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; diff -Naur gcc-4.2.1.orig/libjava/classpath/ltcf-gcj.sh gcc-4.2.1/libjava/classpath/ltcf-gcj.sh --- gcc-4.2.1.orig/libjava/classpath/ltcf-gcj.sh 2005-09-23 17:31:04.000000000 -0400 +++ gcc-4.2.1/libjava/classpath/ltcf-gcj.sh 2007-07-22 19:31:03.000000000 -0400 @@ -156,7 +156,7 @@ # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; diff -Naur gcc-4.2.1.orig/libjava/classpath/m4/ax_create_stdint_h.m4 gcc-4.2.1/libjava/classpath/m4/ax_create_stdint_h.m4 --- gcc-4.2.1.orig/libjava/classpath/m4/ax_create_stdint_h.m4 2006-01-17 13:09:40.000000000 -0500 +++ gcc-4.2.1/libjava/classpath/m4/ax_create_stdint_h.m4 2007-07-22 19:31:03.000000000 -0400 @@ -217,7 +217,7 @@ fi # shortcircut to system "stdint.h" # ------------------ PREPARE VARIABLES ------------------------------ if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` +ac_cv_stdint_message="using gnu compiler "`$CC --version | head -n 1` else ac_cv_stdint_message="using $CC" fi diff -Naur gcc-4.2.1.orig/libjava/configure gcc-4.2.1/libjava/configure --- gcc-4.2.1.orig/libjava/configure 2007-07-19 10:33:56.000000000 -0400 +++ gcc-4.2.1/libjava/configure 2007-07-22 19:31:03.000000000 -0400 @@ -7025,8 +7025,8 @@ echo $ECHO_N "checking whether 'ld' is at least 2.13... $ECHO_C" >&6 LD_PROG=`$CC --print-prog-name=ld` LD_VERSION=`$LD_PROG --version` -LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4` -LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2` +LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4` +LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2` if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then LD_OK="ok" else diff -Naur gcc-4.2.1.orig/libjava/mingwld.m4 gcc-4.2.1/libjava/mingwld.m4 --- gcc-4.2.1.orig/libjava/mingwld.m4 2005-08-22 18:36:35.000000000 -0400 +++ gcc-4.2.1/libjava/mingwld.m4 2007-07-22 19:31:03.000000000 -0400 @@ -3,8 +3,8 @@ AC_MSG_CHECKING(whether 'ld' is at least 2.13) LD_PROG=`$CC --print-prog-name=ld` LD_VERSION=`$LD_PROG --version` -LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4` -LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2` +LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4` +LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2` if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then LD_OK="ok" else diff -Naur gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 gcc-4.2.1/libstdc++-v3/acinclude.m4 --- gcc-4.2.1.orig/libstdc++-v3/acinclude.m4 2007-06-28 19:02:05.000000000 -0400 +++ gcc-4.2.1/libstdc++-v3/acinclude.m4 2007-07-22 19:31:03.000000000 -0400 @@ -234,7 +234,7 @@ if test x"$with_gnu_ld" = x"yes"; then AC_MSG_CHECKING([for ld version]) changequote(,) - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` changequote([,]) glibcxx_gnu_ld_version=`echo $ldver | \ diff -Naur gcc-4.2.1.orig/libstdc++-v3/configure gcc-4.2.1/libstdc++-v3/configure --- gcc-4.2.1.orig/libstdc++-v3/configure 2007-06-28 19:02:05.000000000 -0400 +++ gcc-4.2.1/libstdc++-v3/configure 2007-07-22 19:31:03.000000000 -0400 @@ -8541,7 +8541,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -54451,7 +54451,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -75811,7 +75811,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -77334,7 +77334,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -78825,7 +78825,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -100715,7 +100715,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -101560,7 +101560,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -102961,7 +102961,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -104754,7 +104754,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -105997,7 +105997,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ @@ -107024,7 +107024,7 @@ echo "$as_me:$LINENO: checking for ld version" >&5 echo $ECHO_N "checking for ld version... $ECHO_C" >&6 - ldver=`$LD --version 2>/dev/null | head -1 | \ + ldver=`$LD --version 2>/dev/null | head -n 1 | \ sed -e 's/GNU ld \(version \)\{0,1\}\(([^)]*) \)\{0,1\}\([0-9.][0-9.]*\).*/\3/'` glibcxx_gnu_ld_version=`echo $ldver | \ diff -Naur gcc-4.2.1.orig/ltcf-c.sh gcc-4.2.1/ltcf-c.sh --- gcc-4.2.1.orig/ltcf-c.sh 2005-11-18 17:53:08.000000000 -0500 +++ gcc-4.2.1/ltcf-c.sh 2007-07-22 19:31:03.000000000 -0400 @@ -153,7 +153,7 @@ # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; diff -Naur gcc-4.2.1.orig/ltcf-gcj.sh gcc-4.2.1/ltcf-gcj.sh --- gcc-4.2.1.orig/ltcf-gcj.sh 2005-07-15 22:30:53.000000000 -0400 +++ gcc-4.2.1/ltcf-gcj.sh 2007-07-22 19:31:03.000000000 -0400 @@ -156,7 +156,7 @@ # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then + archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def;