2011年12月21日 星期三

gcc-4.5.2 regression test

1) Compile zlib-1.2.3
(x86)
./configure --prefix=/home/user/mingfeng_wu/installed/zlib
make clean
make
make install

(ARM)
./configure --prefix=/home/user/mingfeng_wu/installed/arm-uc-zlib

# !!!Modify Makefile manually
# -CC=gcc
# +CROSS=/home/user/mingfeng_wu/installed/crosstool-4.5.2/bin/arm-unknown-linux-uclibcgnueabi-
# +CC=$(CROSS)gcc
# -LDSHARED=gcc
# -CPP=gcc -E
# +LDSHARED=$(CROSS)gcc
# +CPP=$(CROSS)gcc -E
# -AR=ar rc
# +AR=$(CROSS)ar rc
# -RANLIB=ranlib
# +RANLIB=$(CROSS)ranlib

make clean
make
make install

2) Compile openssl-1.0.0d
(x86)
./Configure --prefix=/home/user/mingfeng_wu/installed/openssl os/compiler:gcc

make clean
make
make install

(ARM)
./Configure --prefix=/home/user/mingfeng_wu/installed/arm-uc-openssl os/compiler:arm-unknown-linux-uclibcgnueabi-gcc

make clean
make
make install

3) Compile openssh-5.9p1

Modify sshd_config with "Subsystem       sftp    /usr/local/libexec/sftp-server"

(x86)
./configure --prefix=/home/user/mingfeng_wu/installed/openssh \
            --with-libs \
            --with-zlib=/home/user/mingfeng_wu/installed/zlib \
            --with-ssl-dir=/home/user/mingfeng_wu/installed/openssl \
            --disable-etc-default-login \
            CC=gcc \
            AR=ar \
            RANLIB=ranlib

make clean
make
make install

(ARM)
./configure --host=arm-unknown-linux-uclibcgnueabi \
            --with-libs \
            --with-zlib=/home/user/mingfeng_wu/installed/arm-uc-zlib \
            --with-ssl-dir=/home/user/mingfeng_wu/installed/arm-uc-openssl \
            --disable-etc-default-login \
       CC=arm-unknown-linux-uclibcgnueabi-gcc \
       AR=arm-unknown-linux-uclibcgnueabi-ar \
       RANLIB=arm-unknown-linux-uclibcgnueabi-ranlib

make clean
make

/home/user/mingfeng/installed/crosstool-4.5.2/bin/arm-linux-strip scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan sftp-server ssh-key
sign sshd

4) readme.ssh-transparent-login
1. Generate on your LOCAL machine a keypair with:

# ssh-keygen -t rsa (dont type in any password, just keep hitting enter) .

This will generate public/private rsa key pair in the directory of /root/.ssh:

/root/.ssh/id_rsa            (private key)

/root/.ssh/id_rsa.pub        (public key)

2. Make sure your private key resides under /root/.ssh on your LOCAL machine.

3. Also transfer the PRIVATE key to the machine which you want to automatically

login to. Put it under the directory /usr/local/etc.

4. Transfer the PUBLIC key to the machine which you want to automatically login to.

  Under the directory /root/.ssh (create it if necessary) concatenate your public key

with the file authorized_keys (create file if needed) .

5. Make sure the authorized_keys on the REMOTE machine is not read or modifiable by

group or others by doing chmod 700 /root/.ssh/authorized_keys.

6. Make sure the /root/.ssh directory on the REMOTE machine is not read or modifiable

by group or others by doing chmod 700 /root/.ssh

7. You may need to enable empty password authentication (need root access) on the

REMOTE machine in the config file sshd_config. Make "Permitemptypasswords yes".

You also need to modify "Protocol 2,1" to "Protocol 2" and modify "HostKey

/etc/ssh/ssh_host_rsa_key" to "/usr/local/etc/id_rsa". Please refer to the attached.

8. Restart /usr/local/sbin/sshd daemon on REMOTE, and you can automatically login with

ssh/sftp without password on LOCAL.

5) gcc-4.5.2-no-mtune-sshscp.exp
# Board definition file for board "myboard_sshscp"
# How to compile C programs for this board
set_board_info compiler /home/user/mingfeng_wu/installed/crosstool-4.5.2/bin/arm-unknown-linux-uclibcgnueabi-gcc
set_board_info cflags ""

# Network address of board
set_board_info hostname 172.18.116.241

# How to log into this board via ssh and copy files via scp.
# Ideally, you'll set it up to not need a password to log in via ssh
# (see e.g. http://www-csli.stanford.edu/semlab/muri/system/howto/ssh.html).
set_board_info username root

#set_board_info shell_prompt    "[root@platform]#"
# For DejaGnu 1.4.3 and above; DejaGnu 1.4.2.x (Debian 3.0) ignores these settings!
set_board_info rsh_prog /usr/bin/ssh
set_board_info rcp_prog /usr/bin/scp

6) test_installed.remote
#! /bin/sh

# (C) 1998, 2000, 2002, 2003, 2007 Free Software Foundation
# Originally by Alexandre Oliva <oliva@dcc.unicamp.br>

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# This scripts assumes it lives in the contrib directory of the GCC
# source tree, so it will find the testsuite tree from its location.
# If you move it elsewhere, or want to use another testsuite tree, you
# can override the defaults with --srcdir=/some/dir/GCC or
# --testsuite=/some/dir/GCC/gcc/testsuite.  If you specify
# --testsuite, --srcdir will be ignored; otherwise, `/gcc/testsuite'
# will be appended to the srcdir.

# You may specify where the binaries to be tested should be picked up
# from.  If you specify --prefix=/some/dir, gcc, g++ and gfortran will be
# looked for at /some/dir/bin.  Each one may be overridden by
# specifying --with-gcc=/pathname/to/gcc, --with-g++=/pathname/to/g++
# and --with-gfortran=/pathname/to/gfortran.  If you specify --without-gcc,
# --without-g++ or --without-gfortran, the test for the specified program
# will be skipped.  By default, gcc, g++ and gfortran will be searched in
# the PATH.

# An additional argument may specify --tmpdir=/some/dir; by default,
# temporaries will be stored in the current directory, where the log
# files will be stored.

# The script will interpret arguments until it finds one it does not
# understand.  The remaining ones will be passed to `runtest'.  A
# double-dash can be used to explicitly separate the arguments to
# `test_installed' from the ones to `runtest'.

# This script should be run in an empty directory; it will refuse to
# run if it finds a file named site.exp in the current directory.


if test -f site.exp; then
    echo site.exp already exists >&2
    exit 1
fi

while true; do
  case "$1" in
  --with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;

  --prefix=*) prefix=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --with-gfortran=*) GFORTRAN_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --without-gcc) GCC_UNDER_TEST=no; shift;;
  --without-g++) GXX_UNDER_TEST=no; shift;;
  --without-gfortran) GFORTRAN_UNDER_TEST=no; shift;;
  --without-objc) OBJC_UNDER_TEST=no; shift;;

  --tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;

  --help) cat <<\EOF
Runs the testsuite for an installed version of gcc/g++/gfortran/objc
Copyright (C) 1998  Free Software Foundation
by Alexandre Oliva <oliva@dcc.unicamp.br>

Supported arguments:

--help                        prints this page

--with-testsuite=/some/dir/gcc/testsuite   specify the testsuite directory
--srcdir=/some/dir            same as --with-testsuite=/some/dir/gcc/testsuite
                              [deduced from shell-script pathname]

--prefix=/some/dir            use gcc, g++ and gfortran from /some/dir/bin [PATH]
--with-gcc=/some/dir/bin/gcc  use specified gcc program [gcc]
--with-g++=/some/dir/bin/g++  use specified g++ program [g++]
--with-gfortran=/some/dir/bin/gfortran  use specified gfortran program [gfortran]
--without-gcc                 do not run gcc testsuite
--without-g++                 do not run g++ testsuite
--without-gfortran            do not run gfortran testsuite
--without-objc                do not run objc testsuite

--tmpdir=/some/dir            create temporaries and leave failed programs
                              at specified directory [.]

--   end of argument list; following arguments are passed to runtest
EOF
    exit
  ;;

  --) shift; break;;
  *) break;;
  esac
done

if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then
  file=$0
  while [ -h $file ]; do
    file=`ls -l $file | sed s/'.* -> '//`
  done
  srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}`
fi

CROSS_COMPILE=arm-unknown-linux-uclibcgnueabi-

cat >site.exp <<EOF
lappend boards_dir "/root/toolchain/gcc-test"
lappend boards_dir "/usr/share/dejagnu"
set rootme "."
set tmpdir "${tmpdir-`${PWDCMD-pwd}`}"
set srcdir "${testsuite-${srcdir}/gcc/testsuite}"
set CFLAGS ""
set CXXFLAGS ""
set HOSTCC "cc"
set HOSTCFLAGS ""
set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}gcc}"
set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}g++}"
set GFORTRAN_UNDER_TEST "${GFORTRAN_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}gfortran}"
set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}gcc}"
set target_triplet arm-unknown-linux-uclibcgnueabi
set target_alias arm-none-linux-uclibcgnueabi
EOF

test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}
test x"${GFORTRAN_UNDER_TEST}" = x"no" || runtest --tool gfortran ${1+"$@"}
test x"${OBJC_UNDER_TEST}" = x"no" || runtest --tool objc ${1+"$@"}

exit 0

7) run-gcc-4.5.2-sshscp.sh
#!/bin/bash

# increase stack size to 64MB to prevent limits-exprparen.c from segmentation fault
ulimit -s 65536
DATE=`date +%Y%m%d`

GCC=/home/user/mingfeng_wu/installed/crosstool-4.5.2

REGRESSION=/home/user/mingfeng_wu/work/GCC
rm -rf $REGRESSION/gcc-regression-test-${DATE}
mkdir -p $REGRESSION/gcc-regression-test-${DATE}
cd $REGRESSION/gcc-regression-test-${DATE}

DEJAGNULIBS="/usr/share/dejagnu" sh $REGRESSION/gcc-4.5.2/contrib/test_installed.remote --srcdir=$REGRESSION/gcc-4.5.2 --without-gfortran --without-objc --wi
th-gcc=${GCC}/bin/arm-unknown-linux-uclibcgnueabi-gcc --with-g++=${GCC}/bin/arm-unknown-linux-uclibcgnueabi-g++ --target_board=gcc-4.5.2-no-mtune-sshscp


8) For arm-unknown-linux-uclibcgnueabi-* toolchain to run gcc regression test
[mingfeng, 2011-11-07]

In host-Linux (not embedded Linux):
1. Do ssh/sftp transparent login. Please see "readme.ssh-transparent-login".
2. Copy "gcc-4.5.2-sshscp.exp" to /usr/share/dejagnu.
3. Copy "test_installed.remote" to gcc-4.5.2/contrib/.
4. Run script file "run-gcc-4.5.2-sshscp.sh"
5. Generate log
   $ cd gcc-regression-test-20111107
   $ ../gcc-4.5.2/contrib/test_summary > gcc-4.5.2-test_summary.log

沒有留言:

張貼留言