r1043 - in trunk: . scripts/patches scripts/scripts scripts/scripts/cross-scripts scripts/scripts/funcs

ryan at linuxfromscratch.org ryan at linuxfromscratch.org
Thu Jan 12 00:56:47 PST 2006


Author: ryan
Date: 2006-01-12 01:56:45 -0700 (Thu, 12 Jan 2006)
New Revision: 1043

Added:
   trunk/scripts/patches/glibc-20051024-localedef_segfault-1.patch
Modified:
   trunk/
   trunk/scripts/scripts/build-cross.sh
   trunk/scripts/scripts/cross-scripts/cross-glibc-full.sh
   trunk/scripts/scripts/funcs/glibc-funcs.sh
Log:
 r1079 at rei:  lfs | 2006-01-12 19:13:09 +1100
 Update for glibc-2.3.6
 Also add option to skip libgcc_s.so.1 creation (to match cross-lfs book)



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 27a90bee-6a05-0410-9baa-d6d48c78a963:/local:705
27a90bee-6a05-0410-9baa-d6d48c78a963:/trunk:1078
c4644617-e5f8-0310-a1f2-9ce34ac0f9cb:/cross-lfs:564
   + 27a90bee-6a05-0410-9baa-d6d48c78a963:/local:705
27a90bee-6a05-0410-9baa-d6d48c78a963:/trunk:1079
c4644617-e5f8-0310-a1f2-9ce34ac0f9cb:/cross-lfs:564

Added: trunk/scripts/patches/glibc-20051024-localedef_segfault-1.patch
===================================================================
--- trunk/scripts/patches/glibc-20051024-localedef_segfault-1.patch	2006-01-12 08:56:27 UTC (rev 1042)
+++ trunk/scripts/patches/glibc-20051024-localedef_segfault-1.patch	2006-01-12 08:56:45 UTC (rev 1043)
@@ -0,0 +1,56 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2005-09-29
+Initial Package Version: 2.3.2
+Origin: Debian
+Upstream Status: Unknown
+Description: Fixes Segfault when using localdef.
+             This problem is only noticed when using PaX
+             and some architectures besides x86.
+	     See debian bug # 231438
+
+ 
+--- glibc-20050926/locale/programs/3level.h.orig	2005-09-30 06:00:37.000000000 +0000
++++ glibc-20050926/locale/programs/3level.h	2005-09-30 06:01:02.000000000 +0000
+@@ -204,6 +204,42 @@
+ 	}
+     }
+ }
++
++/* GCC ATM seems to do a poor job with pointers to nested functions passed
++   to inlined functions.  Help it a little bit with this hack.  */
++#define wchead_table_iterate(tp, fn) \
++do									      \
++  {									      \
++    struct wchead_table *t = (tp);					      \
++    uint32_t index1;							      \
++    for (index1 = 0; index1 < t->level1_size; index1++)			      \
++      {									      \
++	uint32_t lookup1 = t->level1[index1];				      \
++	if (lookup1 != ((uint32_t) ~0))					      \
++	  {								      \
++	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
++	    uint32_t index2;						      \
++	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
++	      {								      \
++		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
++		if (lookup2 != ((uint32_t) ~0))				      \
++		  {							      \
++		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
++		    uint32_t index3;					      \
++		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
++		      {							      \
++			struct element_t *lookup3			      \
++			  = t->level3[index3 + lookup2_shifted];	      \
++			if (lookup3 != NULL)				      \
++			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
++			      lookup3);					      \
++		      }							      \
++		  }							      \
++	      }								      \
++	  }								      \
++      }									      \
++  } while (0)
++
+ #endif
+ 
+ #ifndef NO_FINALIZE

Modified: trunk/scripts/scripts/build-cross.sh
===================================================================
--- trunk/scripts/scripts/build-cross.sh	2006-01-12 08:56:27 UTC (rev 1042)
+++ trunk/scripts/scripts/build-cross.sh	2006-01-12 08:56:45 UTC (rev 1043)
@@ -89,39 +89,42 @@
    script_list="cross-kern-hdrs.sh"
 }
 
-test "Y" = "${MULTIARCH}" &&
-{
-   script_list="${script_list}
+script_list="${script_list}
 cross-binutils.sh
 cross-glibc-hdrs.sh
-cross-gcc-static.sh
+cross-gcc-static.sh"
+
+if [ ! "Y" = "${NO_GCC_EH}" ]; then
+   if [ "Y" = "${MULTIARCH}" ]; then
+      script_list="${script_list}
 cross-glibc-crtobjs-32.sh
 cross-glibc-crtobjs-64.sh
 cross-gcc-shared.sh"
+   else
+      script_list="${script_list}
+cross-glibc-crtobjs.sh
+cross-gcc-shared.sh"
+   fi
+fi
 
-   test "N" = "${DEFAULT_64}" &&
-   {
+
+if [ "Y" = "${MULTIARCH}" ]; then
+   if [ "N" = "${DEFAULT_64}" ]; then 
       script_list="${script_list}
 cross-glibc-full-64.sh
 cross-glibc-full-32.sh
 cross-gcc-final.sh"
-   } || {
+   else
       script_list="${script_list}
 cross-glibc-full-32.sh
 cross-glibc-full-64.sh
 cross-gcc-final.sh"
-   }
-
-} || {
+   fi
+else
    script_list="${script_list}
-cross-binutils.sh
-cross-glibc-hdrs.sh
-cross-gcc-static.sh
-cross-glibc-crtobjs.sh
-cross-gcc-shared.sh
 cross-glibc-full.sh
 cross-gcc-final.sh"
-}
+fi
 
 SCRIPTLIST=`echo "${script_list}" | \
   sed "s@\(.*\)@${scripts_dir}/\1@"`

Modified: trunk/scripts/scripts/cross-scripts/cross-glibc-full.sh
===================================================================
--- trunk/scripts/scripts/cross-scripts/cross-glibc-full.sh	2006-01-12 08:56:27 UTC (rev 1042)
+++ trunk/scripts/scripts/cross-scripts/cross-glibc-full.sh	2006-01-12 08:56:45 UTC (rev 1043)
@@ -83,6 +83,7 @@
 # see funcs/glibc_funcs.sh
 apply_glibc_patches
 
+
 # HACK: nptl for sparc64 wont build
 case ${TGT_ARCH} in
    sparc64 )
@@ -90,6 +91,12 @@
    ;;
 esac
 
+if [ "Y" = "${NO_GCC_EH}" ]; then
+   cd ${SRC}/${PKGDIR}
+   if [ ! -f Makeconfig-ORIG ]; then cp -p Makeconfig Makeconfig-ORIG ; fi
+   sed 's/-lgcc_eh//g' Makeconfig-ORIG > Makeconfig
+fi
+
 if [ "Y" = "${USE_NPTL}" ]; then
    # remove linuxthreads dirs if they exist
    # (CVS source contains linuxthreads)

Modified: trunk/scripts/scripts/funcs/glibc-funcs.sh
===================================================================
--- trunk/scripts/scripts/funcs/glibc-funcs.sh	2006-01-12 08:56:27 UTC (rev 1042)
+++ trunk/scripts/scripts/funcs/glibc-funcs.sh	2006-01-12 08:56:45 UTC (rev 1043)
@@ -24,9 +24,27 @@
       4.* )
          echo " o compiling with gcc 4.x"
          case ${target_glibc_ver} in
-            2.3.[6-9]* | 2.4.* ) ;;
+            2.3.[7-9]* | 2.4.* ) ;;
+            2.3.6 )
+               apply_patch glibc-20051024-localedef_segfault-1
+
+               case ${TGT_ARCH} in
+               sparc* )
+                  # fix CFLAGS-rtld to remove deprecated sparc compiler options
+                  # from sysdeps/unix/sysv/linux/sparc/sparc32/Makefile 
+                  # ( -mv8 is no longer supported ). Use -mcpu -mtune options 
+                  # from TGT_CFLAGS (which get passed regardless)
+                  echo "   - removing deprecated gcc options from sysdeps/unix/sysv/linux/sparc/sparc32/Makefile"
+                  file="sysdeps/unix/sysv/linux/sparc/sparc32/Makefile"
+                  if [ ! -f ${file}-ORIG ]; then cp -p ${file} ${file}-ORIG ; fi
+                  grep -v \\-mv8 ${file}-ORIG > ${file}
+               ;;
+               esac
+
+            ;;
             2.3.5 )
                # gcc4 support is working in CVS glibc
+
                if [ ! -d ${SRC}/${PKGDIR}/CVS ]; then
                   echo "   - applying gcc4 fixes"
                   apply_patch glibc-2.3.4-gcc4_elf_fixes
@@ -37,6 +55,7 @@
                   apply_patch glibc-2.3.5-allow-gcc4-symbols
                   apply_patch glibc-2.3.5-allow-gcc4-wcstol_l
                fi
+
                case ${TGT_ARCH} in
                sparc* )
                   # fix CFLAGS-rtld to remove deprecated sparc compiler options
@@ -117,6 +136,7 @@
 #include <linux/compiler.h>' \
             ${fname}-ORIG > ${fname}
          }
+
          case ${TGT_ARCH} in
             m68k* )
                echo - applying m68k no-precision-timers patch
@@ -124,6 +144,7 @@
             ;;
             arm* ) apply_patch glibc-arm-ctl_bus_isa ;;
          esac
+
       ;;
       2.4.2[4-9] | 2.4.3* )
          case ${TGT_ARCH} in




More information about the cross-lfs mailing list