OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [ld/] [testsuite/] [config/] [default.exp] - Diff between revs 38 and 156

Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
# Basic expect script for LD Regression Tests
# Basic expect script for LD Regression Tests
#   Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2001, 2003, 2007
#   Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2001, 2003, 2007
#   Free Software Foundation, Inc.
#   Free Software Foundation, Inc.
#
#
# This file is part of the GNU Binutils.
# This file is part of the GNU Binutils.
#
#
# This file is free software; you can redistribute it and/or modify
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
# MA 02110-1301, USA.
#
#
# Written by Jeffrey Wheat (cassidy@cygnus.com)
# Written by Jeffrey Wheat (cassidy@cygnus.com)
#
#
if ![info exists ld] then {
if ![info exists ld] then {
    set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
    set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
}
}
if ![info exists as] then {
if ![info exists as] then {
    set as [findfile $base_dir/../gas/as-new $base_dir/../gas/as-new [transform as]]
    set as [findfile $base_dir/../gas/as-new $base_dir/../gas/as-new [transform as]]
}
}
if ![info exists nm] then {
if ![info exists nm] then {
    set nm [findfile $base_dir/../binutils/nm-new $base_dir/../binutils/nm-new [transform nm]]
    set nm [findfile $base_dir/../binutils/nm-new $base_dir/../binutils/nm-new [transform nm]]
}
}
if ![info exists objdump] then {
if ![info exists objdump] then {
    set objdump [findfile $base_dir/../binutils/objdump]
    set objdump [findfile $base_dir/../binutils/objdump]
}
}
if ![info exists objcopy] then {
if ![info exists objcopy] then {
    set objcopy [findfile $base_dir/../binutils/objcopy]
    set objcopy [findfile $base_dir/../binutils/objcopy]
}
}
if ![info exists ar] then {
if ![info exists ar] then {
    set ar [findfile $base_dir/../binutils/ar]
    set ar [findfile $base_dir/../binutils/ar]
}
}
if ![info exists strip] then {
if ![info exists strip] then {
    set strip [findfile $base_dir/../binutils/strip-new $base_dir/../binutils/strip-new [transform strip]]
    set strip [findfile $base_dir/../binutils/strip-new $base_dir/../binutils/strip-new [transform strip]]
}
}
remote_exec host "mkdir -p tmpdir"
remote_exec host "mkdir -p tmpdir"
# Make a symlink from tmpdir/as to the assembler in the build tree, so
# Make a symlink from tmpdir/as to the assembler in the build tree, so
# that we can use a -B option to gcc to force it to use the newly
# that we can use a -B option to gcc to force it to use the newly
# built assembler.
# built assembler.
if {![file isdirectory tmpdir/gas]} then {
if {![file isdirectory tmpdir/gas]} then {
    catch "exec mkdir tmpdir/gas" status
    catch "exec mkdir tmpdir/gas" status
    catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
    catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
}
}
set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
# Make a symlink from tmpdir/ld to the linker in the build tree, so
# Make a symlink from tmpdir/ld to the linker in the build tree, so
# that we can use a -B option to gcc to force it to use the newly
# that we can use a -B option to gcc to force it to use the newly
# built linker.
# built linker.
if {![file isdirectory tmpdir/ld]} then {
if {![file isdirectory tmpdir/ld]} then {
    catch "exec mkdir tmpdir/ld" status
    catch "exec mkdir tmpdir/ld" status
    catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
    catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
}
}
set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
# load the linker path
# load the linker path
if {[file exists tmpdir/libpath.exp]} {
if {[file exists tmpdir/libpath.exp]} {
    load_lib tmpdir/libpath.exp
    load_lib tmpdir/libpath.exp
    foreach dir $libpath {
    foreach dir $libpath {
        set gcc_ld_flag "$gcc_ld_flag -L$dir"
        set gcc_ld_flag "$gcc_ld_flag -L$dir"
    }
    }
}
}
# The "make check" target in the Makefile passes in
# The "make check" target in the Makefile passes in
# "CC=$(CC_FOR_TARGET)".  But, if the user invokes runtest directly
# "CC=$(CC_FOR_TARGET)".  But, if the user invokes runtest directly
# (as when testing an installed linker), these flags may not be set.
# (as when testing an installed linker), these flags may not be set.
if {![info exists CC]} {
if {![info exists CC]} {
    set CC [find_gcc]
    set CC [find_gcc]
}
}
if {![info exists CFLAGS]} {
if {![info exists CFLAGS]} {
    set CFLAGS "-g -O2"
    set CFLAGS "-g -O2"
}
}
if {![info exists CXX]} {
if {![info exists CXX]} {
    set CXX [find_g++]
    set CXX [find_g++]
}
}
if {![info exists CXXFLAGS]} {
if {![info exists CXXFLAGS]} {
    set CXXFLAGS ""
    set CXXFLAGS ""
}
}
# The mips64-*-linux-gnu compiler defaults to the N32 ABI after
# The mips64-*-linux-gnu compiler defaults to the N32 ABI after
# installed, but to the O32 ABI in the build tree, because of some
# installed, but to the O32 ABI in the build tree, because of some
# specs-file hacks.  Make sure we use an ABI that is compatible with
# specs-file hacks.  Make sure we use an ABI that is compatible with
# the one we expect.
# the one we expect.
if {[istarget mips64*-*-linux*] &&
if {[istarget mips64*-*-linux*] &&
    (![board_info [target_info name] exists multilib_flags] ||
    (![board_info [target_info name] exists multilib_flags] ||
     ![string match "*-mabi" [board_info [target_info name] multilib_flags]])
     ![string match "*-mabi" [board_info [target_info name] multilib_flags]])
   } {
   } {
    append gcc_gas_flag " -mabi=n32"
    append gcc_gas_flag " -mabi=n32"
}
}
# load the utility procedures
# load the utility procedures
load_lib ld-lib.exp
load_lib ld-lib.exp
proc get_link_files {varname} {
proc get_link_files {varname} {
    global $varname
    global $varname
    global target_triplet
    global target_triplet
    global srcdir
    global srcdir
    global CC
    global CC
    if ![info exists $varname] {
    if ![info exists $varname] {
        set status [catch "exec sh -c \"host='$target_triplet' && CC='$CC' && . $srcdir/../configure.host && eval echo \\$$varname\"" result]
        set status [catch "exec sh -c \"host='$target_triplet' && CC='$CC' && . $srcdir/../configure.host && eval echo \\$$varname\"" result]
        if $status { error "Error getting native link files: $result" }
        if $status { error "Error getting native link files: $result" }
        set $varname $result
        set $varname $result
    }
    }
}
}
proc get_target_emul {} {
proc get_target_emul {} {
    global target_triplet
    global target_triplet
    global srcdir
    global srcdir
    set status [catch "exec sh -c \"targ='$target_triplet' && . $srcdir/../configure.tgt && echo \\\$targ_emul\"" result]
    set status [catch "exec sh -c \"targ='$target_triplet' && . $srcdir/../configure.tgt && echo \\\$targ_emul\"" result]
    if $status { error "Error getting emulation name: $result" }
    if $status { error "Error getting emulation name: $result" }
    return $result
    return $result
}
}
if [isnative] {
if [isnative] {
    foreach x {HOSTING_CRT0 HOSTING_LIBS} {
    foreach x {HOSTING_CRT0 HOSTING_LIBS} {
        get_link_files $x
        get_link_files $x
    }
    }
} else {
} else {
    foreach x {HOSTING_CRT0 HOSTING_LIBS} { set $x "" }
    foreach x {HOSTING_CRT0 HOSTING_LIBS} { set $x "" }
}
}
if ![info exists HOSTING_EMU] { set HOSTING_EMU "-m [get_target_emul]" }
if ![info exists HOSTING_EMU] { set HOSTING_EMU "-m [get_target_emul]" }
#
#
# ld_version -- extract and print the version number of ld compiler (GCC)
# ld_version -- extract and print the version number of ld compiler (GCC)
#
#
proc ld_version {} {
proc ld_version {} {
    global ld
    global ld
    default_ld_version $ld
    default_ld_version $ld
}
}
#
#
# ld_exit -- just a stub for ld
# ld_exit -- just a stub for ld
#
#
proc ld_exit {} {
proc ld_exit {} {
}
}
#
#
# ld_start
# ld_start
#       relink the linker
#       relink the linker
#
#
proc ld_start { ld target } {
proc ld_start { ld target } {
        #
        #
}
}
#
#
# ld_relocate
# ld_relocate
#       link an object using relocation
#       link an object using relocation
#
#
proc ld_relocate { ld target objects } {
proc ld_relocate { ld target objects } {
        default_ld_relocate $ld $target $objects
        default_ld_relocate $ld $target $objects
}
}
#
#
# ld_link
# ld_link
#       link a program using ld
#       link a program using ld
#
#
proc ld_link { ld target objects } {
proc ld_link { ld target objects } {
        default_ld_link $ld $target $objects
        default_ld_link $ld $target $objects
}
}
#
#
# ld_simple_link
# ld_simple_link
#       link a program using ld, without including any libraries
#       link a program using ld, without including any libraries
#
#
proc ld_simple_link { ld target objects } {
proc ld_simple_link { ld target objects } {
        default_ld_simple_link $ld $target $objects
        default_ld_simple_link $ld $target $objects
}
}
#
#
# ld_compile
# ld_compile
#       compile an object using $cc
#       compile an object using $cc
#
#
proc ld_compile { cc source object } {
proc ld_compile { cc source object } {
        default_ld_compile $cc $source $object
        default_ld_compile $cc $source $object
}
}
#
#
# ld_assemble
# ld_assemble
#       assemble a file
#       assemble a file
#
#
proc ld_assemble { as source object } {
proc ld_assemble { as source object } {
        default_ld_assemble $as $source $object
        default_ld_assemble $as $source $object
}
}
#
#
# ld_nm
# ld_nm
#       run nm on a file
#       run nm on a file
#
#
proc ld_nm { nm nmflags object } {
proc ld_nm { nm nmflags object } {
        default_ld_nm $nm $nmflags $object
        default_ld_nm $nm $nmflags $object
}
}
#
#
# ld_exec
# ld_exec
#       execute ithe target
#       execute ithe target
#
#
proc ld_exec { target output } {
proc ld_exec { target output } {
        default_ld_exec $target $output
        default_ld_exec $target $output
}
}
# From gas-defs.exp, to support run_dump_test.
# From gas-defs.exp, to support run_dump_test.
if ![info exists AS] then {
if ![info exists AS] then {
    set AS $as
    set AS $as
}
}
if ![info exists GASP] then {
if ![info exists GASP] then {
    set GASP [findfile $base_dir/../gas/gasp-new $base_dir/../gas/gasp-new [transform gasp]]
    set GASP [findfile $base_dir/../gas/gasp-new $base_dir/../gas/gasp-new [transform gasp]]
}
}
if ![info exists ASFLAGS] then {
if ![info exists ASFLAGS] then {
    set ASFLAGS ""
    set ASFLAGS ""
}
}
if ![info exists OBJDUMP] then {
if ![info exists OBJDUMP] then {
    set OBJDUMP $objdump
    set OBJDUMP $objdump
}
}
if ![info exists OBJDUMPFLAGS] then {
if ![info exists OBJDUMPFLAGS] then {
    set OBJDUMPFLAGS {}
    set OBJDUMPFLAGS {}
}
}
if ![info exists NM] then {
if ![info exists NM] then {
    set NM $nm
    set NM $nm
}
}
if ![info exists NMFLAGS] then {
if ![info exists NMFLAGS] then {
    set NMFLAGS {}
    set NMFLAGS {}
}
}
if ![info exists OBJCOPY] then {
if ![info exists OBJCOPY] then {
    set OBJCOPY $objcopy
    set OBJCOPY $objcopy
}
}
if ![info exists OBJCOPYFLAGS] then {
if ![info exists OBJCOPYFLAGS] then {
    set OBJCOPYFLAGS {}
    set OBJCOPYFLAGS {}
}
}
if ![info exists READELF] then {
if ![info exists READELF] then {
    set READELF [findfile $base_dir/../binutils/readelf]
    set READELF [findfile $base_dir/../binutils/readelf]
}
}
if ![info exists READELFFLAGS] then {
if ![info exists READELFFLAGS] then {
    set READELFFLAGS {}
    set READELFFLAGS {}
}
}
if ![info exists LD] then {
if ![info exists LD] then {
    set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
    set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
}
}
if ![info exists LDFLAGS] then {
if ![info exists LDFLAGS] then {
    set LDFLAGS {}
    set LDFLAGS {}
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.