From 504579d0d381b02fc33fe1c696d64f96135a15a8 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 15 Oct 2006 01:15:41 +0000 Subject: [PATCH] toolchain modoifications --- doc/CHANGELOG | 4 ++ packages/base/00-dirtree/00-dirtree | 2 +- .../00-small-base-conf/00-small-base-conf | 4 +- packages/base/binutils/binutils | 40 +++++++++++-------- packages/base/gcc/gcc | 24 +++++++---- packages/base/gcc/no_fix_includes.patch | 21 ---------- packages/base/glibc/glibc | 15 +++++-- packages/base/linux/linux | 4 +- packages/base/udev/udev | 2 +- packages/toolchain/binutils/binutils | 21 +++++----- packages/toolchain/gcc/gcc | 13 ++++-- packages/toolchain/glibc/glibc | 2 +- scripts/Build | 11 +++-- scripts/Build-Distro | 16 ++++---- scripts/Build-Package | 2 + scripts/Config | 1 + 16 files changed, 99 insertions(+), 83 deletions(-) delete mode 100644 packages/base/gcc/no_fix_includes.patch diff --git a/doc/CHANGELOG b/doc/CHANGELOG index de3881c..77e13cc 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,7 @@ +*) 2006-10-15 + +- toolchain modifications + *) 2006-10-03 - updated toolchain diff --git a/packages/base/00-dirtree/00-dirtree b/packages/base/00-dirtree/00-dirtree index 0220d67..0aa7629 100644 --- a/packages/base/00-dirtree/00-dirtree +++ b/packages/base/00-dirtree/00-dirtree @@ -14,7 +14,7 @@ flist_pruned="this_hopefully_never_exists" custmain() { # Create directory stage1 prefix ... -mkdir -p $root/${s1_prefix} +mkdir -p $root/${tc_name} # Create directory bin ... mkdir -p $root/bin # Create directory boot ... diff --git a/packages/base/00-small-base-conf/00-small-base-conf b/packages/base/00-small-base-conf/00-small-base-conf index dfd3505..6130609 100644 --- a/packages/base/00-small-base-conf/00-small-base-conf +++ b/packages/base/00-small-base-conf/00-small-base-conf @@ -11,10 +11,10 @@ custmain="1" if [ "$hdw_status" = "1" ] ; then custmain() { for i in bash pwd cat stty; do - ln -sf ../$s1_prefix/bin/$i $root/bin/$i + ln -sf ../$tc_name/bin/$i $root/bin/$i done ln -sf bash $root/bin/sh - ln -sf ../../$s1_prefix/bin/perl $root/usr/bin/perl + ln -sf ../../$tc_name/bin/perl $root/usr/bin/perl } else custmain() { diff --git a/packages/base/binutils/binutils b/packages/base/binutils/binutils index b79e233..27d0946 100644 --- a/packages/base/binutils/binutils +++ b/packages/base/binutils/binutils @@ -2,41 +2,47 @@ # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.16.91.0.1 +# [V] 2.17 # [S] 2-4 2-5 -# [D] binutils-2.16.91.0.1.tar.bz2 http://ftp.kernel.org/pub/linux/devel/binutils/ +# [D] binutils-2.17.tar.bz2 http://ftp.gnu.org/gnu/binutils/ libpath="/usr/lib:/lib" if [ "$priority" = "4" ] ; then - flist_path="$flist_path ${s1_prefix}/" + flist_path="$flist_path ${tc_name}/" flist_pruned="$flist_pruned|specs" custmain=1 custmain() { - # install binutils linking against new libc - cd $root/tmp/src.binutils/binutils-build - make -C ld INSTALL=/${s1_prefix}/bin/install install - cd - - rm -rf $root/tmp/src.binutils + install ld linking against new libc + mv -v /${tc_name}/bin/{ld,ld-old} + mv -v /${tc_name}/`gcc -dumpmachine`/bin/{ld,ld-old} + mv -v /${tc_name}/bin/{ld-new,ld} + ln -sv /${tc_name}/bin/ld /tools/`gcc -dumpmachine`/bin/ld # show new linker to gcc - cr="" ; [ "$hdw_crossbuild" != "0" ] && cr=/${s1_prefix} - SPECFILE="`gcc --print-file specs`" - sed -e "s@ /${s1_prefix}/lib/ld-linux.so.2@ $cr/lib/ld-linux.so.2@g" \ - -e "s@ /${s1_prefix}/lib/ld.so.1@ $cr/lib/ld.so.1@g" \ - $SPECFILE > tempspecfile - mv tempspecfile $SPECFILE + SPECFILE="`gcc --print-libgcc-file-name`" + SPECFILE="`dirname $SPECFILE`/specs" + gcc -dumpspecs | \ + sed -e "s@ /${tc_name}/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g" \ + -e "s@ /${tc_name}/lib/ld.so.1@ /lib/ld.so.1@g" \ + -e "s@\*startfile_prefix_spec:@& /usr/lib@g" > $SPECFILE + + INCDIR="`dirname $SPECFILE`/include" unset SPECFILE + + # remove fixed includes from gcc's private include dir + find $INCDIR/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; + rm -vf `grep -l "DO NOT EDIT THIS FILE" $INCDIR/*` + unset INCDIR } fi if [ "$priority" = "5" ] ; then - confopt="$confopt --enable-shared --disable-nls" + confopt="$confopt --enable-shared" # no --disable-nls make_conf="tooldir=$root/usr" install_conf="tooldir=$root/usr" post_install() { - cp ../binutils-$ver/include/libiberty.h \ - $prefix/include + cp -v ../binutils-$ver/include/libiberty.h $prefix/include } build_main() { diff --git a/packages/base/gcc/gcc b/packages/base/gcc/gcc index ec68c98..0d9abbe 100644 --- a/packages/base/gcc/gcc +++ b/packages/base/gcc/gcc @@ -2,11 +2,11 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 3.4.4 +# [V] 4.1.1 # [S] 2-5 -# [D] gcc-3.4.4.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-3.4.4/ -# [D] gcc-g++-3.4.4.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-3.4.4/ -# [D] gcc-g77-3.4.4.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-3.4.4/ +# [D] gcc-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/ +# [D] gcc-g++-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/ +# [D] gcc-g77-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/ extraver="-${ver}" [ "$ver" = "cvs" ] && extraver="" @@ -22,9 +22,19 @@ pre_install() { echo "extracting c++ and fortran sources ..." tar --use-compress-program=$compress -xvf $archdir/gcc-g++-$ver.tar.bz2 tar --use-compress-program=$compress -xvf $archdir/gcc-g77-$ver.tar.bz2 - echo "patching source (libiberty) ..." - mv ./libiberty/Makefile.in ./tmp~ - sed 's%install_to_$(INSTALL_DEST) %%' ./tmp~ > ./libiberty/Makefile.in + + echo "patching Makefile (libiberty) ..." + sed 's%install_to_$(INSTALL_DEST) %%' libiberty/Makefile.in > tmp~ + mv tmp~ libiberty/Makefile.in + + echo "patching Makefile (gcc) ..." + sed -e 's@^XCFLAGS =$@& -fomit-frame-pointer@' \ + -e 's@\./fixincl\.sh@-c true@' gcc/Makefile.in > tmp~ + mv tmp~ gcc/Makefile.in + + echo "patching gccbug ..." + sed 's/@have_mktemp_command@/yes/' gcc/gccbug.in > tmp~ + mv tmp~ gcc/gccbug.in } post_install() { diff --git a/packages/base/gcc/no_fix_includes.patch b/packages/base/gcc/no_fix_includes.patch deleted file mode 100644 index 658f882..0000000 --- a/packages/base/gcc/no_fix_includes.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ./gcc/Makefile.in.orig 2004-06-30 15:35:15.000000000 +0200 -+++ ./gcc/Makefile.in 2004-06-30 15:36:23.000000000 +0200 -@@ -2341,10 +2341,6 @@ - rm -f include/limits.h - cp xlimits.h include/limits.h - chmod a+r include/limits.h --# Install the README -- rm -f include/README -- cp $(srcdir)/README-fixinc include/README -- chmod a+r include/README - $(STAMP) $@ - - # fixinc.sh depends on this, not on specs directly. -@@ -2386,7 +2382,6 @@ - (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \ - SHELL='$(SHELL)' ;\ - export TARGET_MACHINE srcdir SHELL ; \ -- $(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \ - rm -f include/syslimits.h; \ - if [ -f include/limits.h ]; then \ - mv include/limits.h include/syslimits.h; \ diff --git a/packages/base/glibc/glibc b/packages/base/glibc/glibc index c47473c..95617f0 100644 --- a/packages/base/glibc/glibc +++ b/packages/base/glibc/glibc @@ -2,10 +2,10 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.3.5 +# [V] 2.3.6 # [S] 2-3 -# [D] glibc-2.3.5.tar.bz2 ftp://sources.redhat.com/pub/glibc/releases/ -# [D] glibc-linuxthreads-2.3.5.tar.bz2 ftp://sources.redhat.com/pub/glibc/releases/ +# [D] glibc-2.3.6.tar.bz2 ftp://sources.redhat.com/pub/glibc/releases/ +# [D] glibc-linuxthreads-2.3.6.tar.bz2 ftp://sources.redhat.com/pub/glibc/releases/ kernver=`grep '^#\ \[V\]' $confdir/../linux/linux | awk '{ print $3 }'` kernver=`echo $kernver | awk -F. '{ print $1 "." $2 }'` @@ -22,6 +22,15 @@ pre_install() { [ ! -f $root/etc/ld.so.conf ] && touch $root/etc/ld.so.conf [ ! -c $root/dev/null ] && mknod -m 0666 $root/dev/null c 1 3 echo "done (file creating)" + + echo "patching ..." + sed 's/vi_VN.TCVN/d' localedata/SUPPORTED > tmp~ + mv tmp~ localedata/SUPPORTED + echo "patching install test (warning, might not work for every arch)" + sed -e \ + 's|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \ + scripts/test-installation.pl > tmp~ + mv tmp~ scripts/test-installation.pl } build_main() { diff --git a/packages/base/linux/linux b/packages/base/linux/linux index 442c02c..c07b6f2 100644 --- a/packages/base/linux/linux +++ b/packages/base/linux/linux @@ -2,9 +2,9 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.6.16.19 +# [V] 2.6.18 # [S] 2-2 -# [D] linux-2.6.16.19.tar.bz2 ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ +# [D] linux-2.6.18.tar.bz2 ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ custmain="1" custmain() { diff --git a/packages/base/udev/udev b/packages/base/udev/udev index 1bc0fa1..ea34f43 100644 --- a/packages/base/udev/udev +++ b/packages/base/udev/udev @@ -14,7 +14,7 @@ make_conf="udevdir=/dev EXTRAS=$extras $make_conf" install_conf="udevdir=/dev EXTRAS=$extras" u_root=$root -[ "$hdw_status" = "1" ] && u_root=/${s1_prefix} +[ "$hdw_status" = "1" ] && u_root=/${tc_name} if [ "$hdw_status" = "1" ] ; then make_conf="prefix=$prefix etcdir=$prefix/etc $make_conf" diff --git a/packages/toolchain/binutils/binutils b/packages/toolchain/binutils/binutils index fce7aa1..0fa39e2 100644 --- a/packages/toolchain/binutils/binutils +++ b/packages/toolchain/binutils/binutils @@ -14,18 +14,19 @@ fi if [ "$priority" = "4" ] ; then custmain=1 custmain() { - # install the ld linking against new libc - mv -v $bindir/{ld,ld-old} + # install the ld linking against toolchain libc + mv -v $prefix/bin/{ld,ld-old} mv -v $prefix/`gcc -dumpmachine`/bin/{ld,ld-old} - mv -v $bindir/{ld-new,ld} - ln -sfv $bindir/ld $prefix/`gcc -dumpmachine`/bin/ld + mv -v $prefix/bin/{ld-new,ld} + ln -sfv $prefix/bin/ld $prefix/`gcc -dumpmachine`/bin/ld # show new linker to gcc - SPECFILE="`gcc --print-file specs`" && + SPECFILE="`gcc -print-libgcc-file-name`" + SPECFILE="`dirname $SPECFILE`/specs" + gcc -dumpspecs | sed -e "s@/lib/ld.so.1@$prefix/lib/ld.so.1@g" \ - -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \ - $SPECFILE > tempspecfile - mv tempspecfile $SPECFILE + -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" > \ + $SPECFILE INCDIR="`dirname $SPECFILE`/include" unset SPECFILE @@ -38,7 +39,7 @@ if [ "$priority" = "4" ] ; then fi if [ "$priority" = "5" ] ; then - confopt="$confopt --enable-shared --with-lib-path=$prefix/lib" + confopt="$confopt --disable-nls --with-lib-path=$prefix/lib" if [ "$hdw_crossbuild" = "0" ] ; then libpath="/usr/lib:/lib" else @@ -59,5 +60,5 @@ post_install() { # (glibc will go there) make -C ld clean make -C ld LIB_PATH=$libpath - cp -v ld/ld-new $bindir + cp -v ld/ld-new $prefix/bin } diff --git a/packages/toolchain/gcc/gcc b/packages/toolchain/gcc/gcc index 71ed73b..128d8d0 100644 --- a/packages/toolchain/gcc/gcc +++ b/packages/toolchain/gcc/gcc @@ -17,7 +17,7 @@ if [ "$priority" = "1" ] ; then confopt="$confopt --enable-languages=c --disable-nls" post_install() { - ln -sf gcc $prefix/bin/cc + ln -vsf gcc $prefix/bin/cc } fi @@ -28,6 +28,14 @@ if [ "$priority" = "4" ] ; then make_conf="" pre_install() { + # no fix includes + echo "patching (no fixincludes)" + sed -e 's@\./fixinc\.sh@-c true@' \ + -e 's@^XCFLAGS =$@/& -fomit-frame-pointer@' \ + gcc/Makefile.in > tmp~ + mv tmp~ gcc/Makefile.in + + # specs echo "patching gcc specs now" for i in gcc/config/*/{pa-,}linux*.h; do echo "patching $i ..." @@ -52,9 +60,6 @@ if [ "$priority" = "4" ] ; then echo "patching gcc/config/linux.h ..." echo "#undef STANDARD_INCLUDE_DIR" >> gcc/config/linux.h echo "#define STANDARD_INCLUDE_DIR 0" >> gcc/config/linux.h - # no fix includes - [ -f $hdw_home_dir/packages/base/gcc/no_fix_includes.patch ] && \ - patch -Nfp1 < $hdw_home_dir/packages/base/gcc/no_fix_includes.patch } fi diff --git a/packages/toolchain/glibc/glibc b/packages/toolchain/glibc/glibc index ea6d099..b3543fe 100644 --- a/packages/toolchain/glibc/glibc +++ b/packages/toolchain/glibc/glibc @@ -2,7 +2,7 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.4 +# [V] 2.3.6 # [S] 0-3 # [D] glibc-2.3.6.tar.bz2 ftp://sources.redhat.com/pub/glibc/releases/ # [D] glibc-linuxthreads-2.3.6.tar.bz2 ftp://sources.redhat.com/pub/glibc/releases/ diff --git a/scripts/Build b/scripts/Build index a3ed9a8..cd55771 100755 --- a/scripts/Build +++ b/scripts/Build @@ -35,8 +35,7 @@ if [ -z "$package" ]; then fi if [ -z "$stage" ]; then - echo "stage level not specified. something went wrong ... hey," - echo "this is a development version ;)" + echo "no stage level specified, abort." exit 1 fi @@ -122,7 +121,7 @@ echo "found $package config file ..." prefix=""; docdir="" if [ "$stage" -lt "2" ] ; then # use the symlink as prefix - prefix="/${s1_prefix}" + prefix="/${tc_name}" docdir="$prefix/share/doc/$package" install_conf="PREFIX=$prefix" else @@ -186,7 +185,7 @@ echo "found $package config file ..." # flist find variables/command flist_path="bin/ boot/ etc/ lib/ opt/ sbin/ usr/ var/" - [ "$stage" -lt "2" ] && flist_path="${flist_path} ${s1_prefix}/" + [ "$stage" -lt "2" ] && flist_path="${flist_path} ${tc_name}/" flist_cmd="find \$flist_path \( -cnewer $root/.time_$package -o \ -newer $root/.time_$package \) \( -not -type d -o \ -type d -empty \) -print" @@ -391,7 +390,7 @@ echo "found $package config file ..." grep -v '^ldd'`; do for rpkg in `grep $rdep -r \ $root/var/adm/flists | \ - grep -v $s1_prefix | \ + grep -v $tc_name | \ awk -F: '{ print $2 }'`; do add=1 for cmp in $alldeps; do @@ -411,7 +410,7 @@ echo "found $package config file ..." grep -v '^ldd'`; do for rpkg in `grep $rdep -r \ $root/var/adm/flists | \ - grep -v $s1_prefix | \ + grep -v $tc_name | \ awk -F: '{ print $2 }'`; do add=1 for cmp in $alldeps; do diff --git a/scripts/Build-Distro b/scripts/Build-Distro index 70d501e..0f0f62f 100755 --- a/scripts/Build-Distro +++ b/scripts/Build-Distro @@ -80,14 +80,14 @@ for stage in $stages; do [ ! -d ${hdw_build_dir}/var/adm/deps ] && \ mkdir -p ${hdw_build_dir}/var/adm/deps/{run,build} # symlinking the stage 0/1 prefix to hostsystem root - if [ -d /$s1_prefix ]; then - if [ ! -L /$s1_prefix ]; then + if [ -d /$tc_name ]; then + if [ ! -L /$tc_name ]; then echo_r "WARNING: " - echo_w "move /$s1_prefix to /${s1_prefix}_old" - mv /$s1_prefix /${s1_prefix}_old + echo_w "move /$tc_name to /${tc_name}_old" + mv /$tc_name /${tc_name}_old fi fi - ln -sf $hdw_build_dir/$s1_prefix / + ln -sf $hdw_build_dir/$tc_name / fi # build according buildorder @@ -199,7 +199,7 @@ for stage in $stages; do echo_c "preparing chroot commands ..." cat > $root/chroot.sh <<- EOT # PATH -export PATH="\$PATH:/${s1_prefix}/bin:/${s1_prefix}/sbin" +export PATH="\$PATH:/${tc_name}/bin:/${tc_name}/sbin" # create essential device nodes mknod -m 600 /dev/console c 5 1 mknod -m 666 /dev/null c 1 3 @@ -240,9 +240,9 @@ EOT mount -t devpts devpts $root/dev/pts echo_w "entering chroot and start building now ..." echo - chroot $hdw_build_dir /${s1_prefix}/bin/env PS1='\u@\w\$ ' \ + chroot $hdw_build_dir /${tc_name}/bin/env PS1='\u@\w\$ ' \ PATH="/bin:/usr/bin:/sbin:/usr/sbin" HOME=/root \ - /${s1_prefix}/bin/bash --login +h /chroot.sh + /${tc_name}/bin/bash --login +h /chroot.sh if [ ! "$?" = "0" ]; then echo_r "something failed in the chroot, aborting." exit 1 diff --git a/scripts/Build-Package b/scripts/Build-Package index dce018c..c93ce3b 100755 --- a/scripts/Build-Package +++ b/scripts/Build-Package @@ -11,6 +11,8 @@ bappend="" priority="x" dir="" + + if [ -z "$1" ] ; then echo "usage: $0 [-stage ]" exit 1 diff --git a/scripts/Config b/scripts/Config index c1581e7..42c877a 100755 --- a/scripts/Config +++ b/scripts/Config @@ -42,6 +42,7 @@ fi # define the toolchain name, default: "toolchain" [ -z "$hdw_tc_name" ] && hdw_tc_name="toolchain" +export tc_name=$hdw_tc_name # lets see what root is: root="" -- 2.39.2