From c7b7c7d4ce2f5a6947e42ff37d9584d26eb52ba4 Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 3 Oct 2006 00:00:45 +0000 Subject: [PATCH] toolchain mods, glibc and gcc still need some checking --- doc/CHANGELOG | 5 +++ packages/toolchain/binutils/binutils | 35 ++++++++++---------- packages/toolchain/gcc/gcc | 11 ++----- packages/toolchain/glibc/glibc | 6 ++-- packages/toolchain/linux/linux | 6 ++-- scripts/Build | 40 +++++++++++------------ scripts/Build-Distro | 2 +- scripts/Config | 49 ++++++++++++++-------------- scripts/optimization | 8 ++--- 9 files changed, 80 insertions(+), 82 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index aefaced..de3881c 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,8 @@ +*) 2006-10-03 + +- updated toolchain +- new Config file + *) 2006-06-19 - added hdlmaker package (somehow not nice ...) diff --git a/packages/toolchain/binutils/binutils b/packages/toolchain/binutils/binutils index e6a78bd..fce7aa1 100644 --- a/packages/toolchain/binutils/binutils +++ b/packages/toolchain/binutils/binutils @@ -2,27 +2,23 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.16.91.0.1 +# [V] 2.17 # [S] 0-1 0-4 0-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/ if [ "$priority" = "1" ] ; then confopt="$confopt --disable-nls" - # use host system tools - hdw_arch_prefix="" ; hdw_cflags="" - . ./scripts/optimization - unset CFLAGS libpath="$prefix/lib" fi if [ "$priority" = "4" ] ; then custmain=1 custmain() { - # install binutils linking against new libc - cd $root/tmp/src.binutils/binutils-build - make -C ld install - cd - - rm -rf $root/tmp/src.binutils + # install the ld linking against new libc + mv -v $bindir/{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 # show new linker to gcc SPECFILE="`gcc --print-file specs`" && @@ -30,9 +26,14 @@ if [ "$priority" = "4" ] ; then -e "s@/lib/ld-linux.so.2@$prefix/lib/ld-linux.so.2@g" \ $SPECFILE > tempspecfile mv tempspecfile $SPECFILE + + INCDIR="`dirname $SPECFILE`/include" unset SPECFILE - rm -f $prefix/lib/gcc-lib/*/*/include/pthread.h - rm -f $prefix/lib/gcc-lib/*/*/include/bits/sigthread.h + + # 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 @@ -54,11 +55,9 @@ build_main() { } post_install() { - # linkers default library path (where our glibc will go) + # build ld-new with changed linkers default library search path + # (glibc will go there) make -C ld clean make -C ld LIB_PATH=$libpath - # __very__ ___ugly___ - # store binutils tree to reinstall after glibc build - cd $root && mkdir -p tmp - rm -rf tmp/src.binutils && mv src.binutils tmp/ + cp -v ld/ld-new $bindir } diff --git a/packages/toolchain/gcc/gcc b/packages/toolchain/gcc/gcc index c058efe..71ed73b 100644 --- a/packages/toolchain/gcc/gcc +++ b/packages/toolchain/gcc/gcc @@ -2,9 +2,9 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 3.4.4 +# [V] 4.1.1 # [S] 0-1 0-4 -# [D] gcc-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/ extraver="-$ver" @@ -13,16 +13,9 @@ extraver="-$ver" confopt="$confopt --enable-shared --with-local-prefix=$prefix" confopt="$confopt --libexecdir=$prefix/lib" -unset CFLAGS - if [ "$priority" = "1" ] ; then confopt="$confopt --enable-languages=c --disable-nls" - # use host system tools - hdw_arch_prefix="" ; hdw_cflags="" - . ./scripts/optimization - unset CFLAGS - post_install() { ln -sf gcc $prefix/bin/cc } diff --git a/packages/toolchain/glibc/glibc b/packages/toolchain/glibc/glibc index 279407b..ea6d099 100644 --- a/packages/toolchain/glibc/glibc +++ b/packages/toolchain/glibc/glibc @@ -2,10 +2,10 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.3.5 +# [V] 2.4 # [S] 0-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/ ## [D] glibc.tar.bz2 cvs:anoncvs:sources.redhat.com:cvs/glibc:libc kernver=`grep '^#\ \[V\]' $confdir/../linux/linux | awk '{ print $3 }'` diff --git a/packages/toolchain/linux/linux b/packages/toolchain/linux/linux index 95083d9..d7248df 100644 --- a/packages/toolchain/linux/linux +++ b/packages/toolchain/linux/linux @@ -2,12 +2,12 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.6.16.19 +# [V] 2.6.18 # [S] 0-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/ skip=1 -s_reason="i think thats obsolete now ..." +s_reason="obsolete, there is a linux libc headers package now." build_main() { # care for crossbuild diff --git a/scripts/Build b/scripts/Build index 41a2fa0..a3ed9a8 100755 --- a/scripts/Build +++ b/scripts/Build @@ -5,7 +5,7 @@ # this script is used to build hdw-linux packages. # -hdw_status="" +stage="" package="" no_src_del="" priority="" @@ -13,7 +13,7 @@ dir="*" while [ "$1" ] ; do case "$1" in - -stage) hdw_status=$2 ; shift 2 ;; + -stage) stage=$2 ; shift 2 ;; -package) package=$2 ; shift 2 ;; -no_src_del) no_src_del="1" ; shift 1 ;; -priority) priority=$2 ; shift 2 ;; @@ -34,7 +34,7 @@ if [ -z "$package" ]; then exit 1 fi -if [ -z "$hdw_status" ]; then +if [ -z "$stage" ]; then echo "stage level not specified. something went wrong ... hey," echo "this is a development version ;)" exit 1 @@ -47,13 +47,13 @@ fi export priority # load config andsubroutines -. ./scripts/Config -stage $hdw_status +. ./scripts/Config -stage $stage . ./scripts/subroutines # optimization . ./scripts/optimization # check for dietlibc -if [ "$hdw_status" != "1" -a "$hdw_use_dietlibc" = "1" ] ; then +if [ "$stage" != "1" -a "$hdw_use_dietlibc" = "1" ] ; then export CC="diet-dyn $CC -nostdinc" export CXX="diet-dyn $CXX -nostdinc" fi @@ -120,17 +120,17 @@ echo "found $package config file ..." make_conf=""; install_conf="" prefix=""; docdir="" - if [ "$hdw_status" -lt "2" ] ; then + if [ "$stage" -lt "2" ] ; then # use the symlink as prefix prefix="/${s1_prefix}" docdir="$prefix/share/doc/$package" install_conf="PREFIX=$prefix" else - if [ "$hdw_status" = "2" -o "$hdw_status" = "3" ] ; then + if [ "$stage" = "2" -o "$stage" = "3" ] ; then prefix="$root/usr"; docdir="$root/usr/doc/$package" localstatedir="$root/var" sysconfdir="$root/etc" - elif [ "$hdw_status" = "4" ] ; then + elif [ "$stage" = "4" ] ; then prefix="$root/opt/$package" docdir="$root/opt/$package/doc" localstatedir="$root/var/opt/$package" @@ -150,7 +150,7 @@ echo "found $package config file ..." confopt="$confopt --datadir=$prefix/share" confopt="$confopt --infodir=$prefix/info" confopt="$confopt --mandir=$prefix/man" - if [ "$hdw_status" -gt "1" ] ; then + if [ "$stage" -gt "1" ] ; then confopt="$confopt --localstatedir=$localstatedir" confopt="$confopt --sysconfdir=$sysconfdir" fi @@ -186,7 +186,7 @@ echo "found $package config file ..." # flist find variables/command flist_path="bin/ boot/ etc/ lib/ opt/ sbin/ usr/ var/" - [ "$hdw_status" -lt "2" ] && flist_path="${flist_path} ${s1_prefix}/" + [ "$stage" -lt "2" ] && flist_path="${flist_path} ${s1_prefix}/" flist_cmd="find \$flist_path \( -cnewer $root/.time_$package -o \ -newer $root/.time_$package \) \( -not -type d -o \ -type d -empty \) -print" @@ -203,7 +203,7 @@ echo "found $package config file ..." umask 0022 # run ldconfig to, maybe we installed some libs before! - if [ "$hdw_status" != "1" ] ; then + if [ "$stage" != "1" ] ; then echo "running ldconfig ..." ldconfig fi @@ -284,7 +284,7 @@ echo "found $package config file ..." done fi # stage specific patches - for xtra_patch in `ls $confdir/*.patch.${hdw_status} 2> /dev/null`; do + for xtra_patch in `ls $confdir/*.patch.${stage} 2> /dev/null`; do echo "applying patch $xtra_patch ..." patch -Nfp1 < $xtra_patch done @@ -310,7 +310,7 @@ echo "found $package config file ..." done fi # setup scripts - if [ "$hdw_status" != "1" ] ; then + if [ "$stage" != "1" ] ; then for my_setup in `ls $confdir/*.setup 2> /dev/null`; do create_setup_scripts $my_setup done @@ -326,23 +326,23 @@ echo "found $package config file ..." # let's create the flist append="" - [ "$hdw_status" = "0" ] && append=".stage0" - [ "$hdw_status" = "1" ] && append=".stage1" + [ "$stage" = "0" ] && append=".stage0" + [ "$stage" = "1" ] && append=".stage1" append="${append}-${priority}" export package export append - export hdw_status + export stage export priority awk '\ BEGIN { package=ENVIRON["package"] ; append=ENVIRON["append"] ; \ - stage=ENVIRON["hdw_status"] ; priority=ENVIRON["priority"] } \ + stage=ENVIRON["stage"] ; priority=ENVIRON["priority"] } \ { print package ": " $0 } \ END { print package ": " "var/adm/logs/" stage "-" priority "-" \ package ; \ print package ": " "var/adm/flists/" package append }' \ $root/flist.$package > $root/var/adm/flists/${package}${append} # manually add dependency files, calculated after flist - if [ "$hdw_status" -ge "3" ] ; then + if [ "$stage" -ge "3" ] ; then echo "${package}: var/adm/deps/build/$package" >> \ $root/var/adm/flists/${package}${append} echo "${package}: var/adm/deps/run/$package" >> \ @@ -352,13 +352,13 @@ echo "found $package config file ..." # build/runtime dependencies (just libs >= stage 3, # default is 'hardcoded') # still in development !! - if [ "$hdw_status" -ge "3" ] ; then + if [ "$stage" -ge "3" ] ; then # build deps rm -f $root/var/adm/deps/build/$package echo -n "calculating build dependencies ... " alldeps="" for lib in `grep '\ -l[A-Za-z]' \ - $root/var/adm/logs/${hdw_status}-${priority}-$package.out`; do + $root/var/adm/logs/${stage}-${priority}-$package.out`; do if [ -n "`echo $lib | grep '^-l'`" ] ; then lib=${lib//-l/lib} for dep in `grep "/$lib\." \ diff --git a/scripts/Build-Distro b/scripts/Build-Distro index 79f2cd3..70d501e 100755 --- a/scripts/Build-Distro +++ b/scripts/Build-Distro @@ -114,7 +114,7 @@ for stage in $stages; do echo_g "done, `date | awk '{ print $4 }'`" # make binary tar package if [ "$hdw_make_package" = "1" -a \ - "$hdw_status" -ge "2" ] ; then + "$stage" -ge "2" ] ; then echo -n "creating binary package ..." if [ -d binaries/{$hdw_arch}-${hdw_arch_opt}/$package ] ; then echo -n " (deleting old first)" diff --git a/scripts/Config b/scripts/Config index 9d85cc0..c1581e7 100755 --- a/scripts/Config +++ b/scripts/Config @@ -1,26 +1,27 @@ # # hdw-linux Config script # -# author: hackbard +# author: hackbard@hackdaworld.org # # script initializing environment # -hdw_status="" +stage="" while [ "$1" ] ; do case "$1" in - -stage) hdw_status="$2" ; shift 2 ;; + -stage) stage="$2" ; shift 2 ;; *) echo echo "Usage:" echo echo " ./scripts/Config -stage " - echo ;; + echo + shift 1 ; exit 1 ;; esac done -if [ -z "$hdw_status" ]; then - echo "something went wrong. stage needs to be specified." +if [ -z "$stage" ]; then + echo "something went wrong, no stage specified." exit 1 fi @@ -39,17 +40,12 @@ else exit 1 fi -# define the stage 0/1 prefix to use -# default "static", though no static linking is done anymore in stage1 -if [ -z "$hdw_stage1_prefix" ] ; then - s1_prefix="static" # default -else - s1_prefix=$hdw_stage1_prefix -fi +# define the toolchain name, default: "toolchain" +[ -z "$hdw_tc_name" ] && hdw_tc_name="toolchain" # lets see what root is: root="" -if [ "$hdw_crossbuild" != "0" -o "$hdw_status" -lt "2" ] ; then +if [ "$hdw_crossbuild" != "0" -o "$stage" -lt "2" ] ; then # check for properly configured build directory if [ -z "$hdw_build_dir" ] ; then echo "please set hdw_build_dir in ./Config!" @@ -67,8 +63,8 @@ fi set +h umask 022 export LC_ALL=POSIX -[ "$hdw_status" -lt "2" -o "$hdw_crossbuild" != "0" ] && \ - export PATH="$root/${s1_prefix}/bin:$PATH" +[ "$stage" -lt "2" -o "$hdw_crossbuild" != "0" ] && \ + export PATH="$root/${hdw_tc_name}/bin:$PATH" # let's do optimization and care for crossbuilds # @@ -133,24 +129,29 @@ esac # --host: system where the created executable runs on. hdw_arch_host=${hdw_arch_build} -[ "$hdw_status" != "0" ] && hdw_arch_host=${hdw_arch_target} +[ "$stage" != "0" -a "$hdw_crossbuild" = "0" ] && \ + hdw_arch_host=${hdw_arch_target} # -O flag # optimization only at stages >= 1 -[ -n "$hdw_opt" ] && hdw_cflags="-O${hdw_opt} $hdw_cflags" +if [ -n "$hdw_opt" -a "$stage" != "0" ] ; then + hdw_cflags="-O${hdw_opt} $hdw_cflags" +else + unset hdw_cflags +fi # build tools to use -# should be the same like host imho, right? -hdw_arch_prefix="$hdw_arch_host-" +hdw_arch_prefix="" +[ "$stage" != "0" ] && hdw_arch_prefix="$hdw_arch_target-" # print decissions for debugging ... echo "root variable set to '$root'" echo "hdw_arch_target variable set to $hdw_arch_target" echo "hdw_arch_build variable set to $hdw_arch_build" -echo "hdw_arch_host variable ste to $hdw_arch_host" -echo "hdw_arch_prefix variable set to $hdw_arch_prefix" -echo "hdw_cflags variable set to $hdw_cflags" -[ "$hdw_status" = "1" ] && echo "hdw_stage1_prefix set to '$s1_prefix'" +echo "hdw_arch_host variable set to $hdw_arch_host" +echo "hdw_arch_prefix variable set to '$hdw_arch_prefix'" +echo "hdw_cflags variable set to '$hdw_cflags'" +echo "hdw_tc_name set to '$hdw_tc_name'" # lets see what we are going to build if [ -z $hdw_target ] ; then diff --git a/scripts/optimization b/scripts/optimization index 10224e0..a324f69 100755 --- a/scripts/optimization +++ b/scripts/optimization @@ -1,22 +1,22 @@ # hdw - linux ./scripts/optimization # -# author: hackbard@hackdaworld.dyndns.org +# author: hackbard@hackdaworld.org # # this script defines optmization flags # the tools export CC="${hdw_arch_prefix}gcc" -#export CPP="${hdw_arch_prefix}cpp" export CXX="${hdw_arch_prefix}c++" +#export CPP="${hdw_arch_prefix}cpp" #export AS="${hdw_arch_prefix}as" #export STRIP="${hdw_arch_prefix}strip" #export LD="${hdw_arch_prefix}ld" -export GASP="${hdw_arch_prefix}gasp" +#export GASP="${hdw_arch_prefix}gasp" #export AR="${hdw_arch_prefix}ar" #export RANLIB="${hdw_arch_prefix}ranlib" #export NM="${hdw_arch_prefix}nm" -export KCC="${hdw_arch_prefix}kcc" +#export KCC="${hdw_arch_prefix}kcc" # flags - edit this at own risk export CFLAGS="${hdw_cflags}" -- 2.39.2