OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [ld/] [testsuite/] [ld-shared/] [shared.exp] - Diff between revs 157 and 166

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

Rev 157 Rev 166
# Expect script for ld-shared tests
# Expect script for ld-shared tests
#   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
#   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
#   2004, 2005, 2007, 2008, 2009, 2010
#   2004, 2005, 2007, 2008, 2009, 2010
#   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 program is free software; you can redistribute it and/or modify
# This program 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 Ian Lance Taylor (ian@cygnus.com)
# Written by Ian Lance Taylor (ian@cygnus.com)
#
#
# Make sure that ld can generate ELF shared libraries.
# Make sure that ld can generate ELF shared libraries.
# Note that linking against ELF shared libraries is tested by the
# Note that linking against ELF shared libraries is tested by the
# bootstrap test.
# bootstrap test.
# This test can only be run if ld generates native executables.
# This test can only be run if ld generates native executables.
if ![isnative] then {return}
if ![isnative] then {return}
# This test can only be run on a couple of ELF platforms.
# This test can only be run on a couple of ELF platforms.
# Square bracket expressions seem to confuse istarget.
# Square bracket expressions seem to confuse istarget.
if { ![istarget hppa*64*-*-hpux*] \
if { ![istarget hppa*64*-*-hpux*] \
     && ![istarget hppa*-*-linux*] \
     && ![istarget hppa*-*-linux*] \
     && ![istarget i?86-*-sysv4*] \
     && ![istarget i?86-*-sysv4*] \
     && ![istarget i?86-*-unixware] \
     && ![istarget i?86-*-unixware] \
     && ![istarget i?86-*-elf*] \
     && ![istarget i?86-*-elf*] \
     && ![istarget i?86-*-linux*] \
     && ![istarget i?86-*-linux*] \
     && ![istarget i?86-*-gnu*] \
     && ![istarget i?86-*-gnu*] \
     && ![istarget ia64-*-elf*] \
     && ![istarget ia64-*-elf*] \
     && ![istarget ia64-*-linux*] \
     && ![istarget ia64-*-linux*] \
     && ![istarget m68k-*-linux*] \
     && ![istarget m68k-*-linux*] \
     && ![istarget mips*-*-irix5*] \
     && ![istarget mips*-*-irix5*] \
     && ![istarget mips*-*-linux*] \
     && ![istarget mips*-*-linux*] \
     && ![istarget powerpc*-*-elf*] \
     && ![istarget powerpc*-*-elf*] \
     && ![istarget powerpc*-*-linux*] \
     && ![istarget powerpc*-*-linux*] \
     && ![istarget powerpc*-*-sysv4*] \
     && ![istarget powerpc*-*-sysv4*] \
     && ![istarget sparc*-*-elf] \
     && ![istarget sparc*-*-elf] \
     && ![istarget sparc*-*-solaris2*] \
     && ![istarget sparc*-*-solaris2*] \
     && ![istarget sparc*-*-sunos4*] \
     && ![istarget sparc*-*-sunos4*] \
     && ![istarget sparc*-*-linux*] \
     && ![istarget sparc*-*-linux*] \
     && ![istarget arm*-*-linux*] \
     && ![istarget arm*-*-linux*] \
     && ![istarget alpha*-*-linux*] \
     && ![istarget alpha*-*-linux*] \
     && ![istarget rs6000*-*-aix*] \
     && ![istarget rs6000*-*-aix*] \
     && ![istarget powerpc*-*-aix*] \
     && ![istarget powerpc*-*-aix*] \
     && ![istarget s390*-*-linux*] \
     && ![istarget s390*-*-linux*] \
     && ![istarget x86_64-*-linux*] } {
     && ![istarget x86_64-*-linux*] } {
    return
    return
}
}
if { [istarget *-*-linux*aout*] \
if { [istarget *-*-linux*aout*] \
     || [istarget *-*-linux*oldld*] } {
     || [istarget *-*-linux*oldld*] } {
    return
    return
}
}
set tmpdir tmpdir
set tmpdir tmpdir
set SHCFLAG ""
set SHCFLAG ""
set shared_needs_pic "no"
set shared_needs_pic "no"
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
    # AIX shared libraries do not seem to support useful features,
    # AIX shared libraries do not seem to support useful features,
    # like overriding the shared library function or letting the
    # like overriding the shared library function or letting the
    # shared library refer to objects defined in the main program.  We
    # shared library refer to objects defined in the main program.  We
    # avoid testing those features.
    # avoid testing those features.
    set SHCFLAG "-DXCOFF_TEST"
    set SHCFLAG "-DXCOFF_TEST"
    # The AIX 3.2.5 loader appears to randomly fail when loading
    # The AIX 3.2.5 loader appears to randomly fail when loading
    # shared libraries from NSF mounted partitions, so we avoid any
    # shared libraries from NSF mounted partitions, so we avoid any
    # potential problems by using a local directory.
    # potential problems by using a local directory.
    catch {exec /bin/sh -c "echo $$"} pid
    catch {exec /bin/sh -c "echo $$"} pid
    set tmpdir /usr/tmp/ld.$pid
    set tmpdir /usr/tmp/ld.$pid
    catch "exec mkdir $tmpdir" exec_status
    catch "exec mkdir $tmpdir" exec_status
    # On AIX, we need to explicitly export the symbols the shared
    # On AIX, we need to explicitly export the symbols the shared
    # library is going to provide, and need.
    # library is going to provide, and need.
    set file [open $tmpdir/xcoff.exp w]
    set file [open $tmpdir/xcoff.exp w]
    puts $file shlibvar1
    puts $file shlibvar1
    puts $file shlibvar2
    puts $file shlibvar2
    puts $file shlib_shlibvar1
    puts $file shlib_shlibvar1
    puts $file shlib_shlibvar2
    puts $file shlib_shlibvar2
    puts $file shlib_shlibcall
    puts $file shlib_shlibcall
    puts $file shlib_shlibcalled
    puts $file shlib_shlibcalled
    puts $file shlib_checkfunptr1
    puts $file shlib_checkfunptr1
    puts $file shlib_getfunptr1
    puts $file shlib_getfunptr1
    puts $file shlib_check
    puts $file shlib_check
    close $file
    close $file
}
}
if [istarget arm*-*-linux*] {
if [istarget arm*-*-linux*] {
    # On ARM section anchors can change the symbol pre-emptability for
    # On ARM section anchors can change the symbol pre-emptability for
    # non-PIC shared libraries, causing these tests to fail.  Turn section
    # non-PIC shared libraries, causing these tests to fail.  Turn section
    # anchors off.
    # anchors off.
    set SHCFLAG "-fno-section-anchors"
    set SHCFLAG "-fno-section-anchors"
    # On targets that have MOVW the compiler will emit relocations which
    # On targets that have MOVW the compiler will emit relocations which
    # the linker doesn't support when compiling -shared without -fpic.  The
    # the linker doesn't support when compiling -shared without -fpic.  The
    # test to find out whether we want to XFAIL the non-PIC tests requires
    # test to find out whether we want to XFAIL the non-PIC tests requires
    # a compile - so we pre-calculate it here.  We also note that this can
    # a compile - so we pre-calculate it here.  We also note that this can
    # only affect arm*-*-*eabi targets as the old ABI doesn't support v7.
    # only affect arm*-*-*eabi targets as the old ABI doesn't support v7.
    if [istarget arm*-*-*eabi] {
    if [istarget arm*-*-*eabi] {
        set file [open $tmpdir/movw-detect.c w]
        set file [open $tmpdir/movw-detect.c w]
        puts $file "void foo(void) { __asm (\"movw r0, #0\"); }"
        puts $file "void foo(void) { __asm (\"movw r0, #0\"); }"
        close $file
        close $file
        if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] {
        if [run_host_cmd_yesno "$CC" "$CFLAGS -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] {
            set shared_needs_pic "yes"
            set shared_needs_pic "yes"
        }
        }
    }
    }
}
}
# The test procedure.
# The test procedure.
proc shared_test { progname testname main sh1 sh2 dat args } {
proc shared_test { progname testname main sh1 sh2 dat args } {
    global CC
    global CC
    global srcdir
    global srcdir
    global subdir
    global subdir
    global exec_output
    global exec_output
    global host_triplet
    global host_triplet
    global tmpdir
    global tmpdir
    if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" }
    if [llength $args] { set shldflags [lindex $args 0] } else { set shldflags "" }
    # Build the shared library.
    # Build the shared library.
    # On AIX, we need to use an export file.
    # On AIX, we need to use an export file.
    set shared -shared
    set shared -shared
    if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
    if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
        set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
        set shared "-bM:SRE -bE:$tmpdir/xcoff.exp"
    }
    }
    if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
    if {![ld_simple_link $CC $tmpdir/$progname.so "$shared $shldflags $tmpdir/$sh1 $tmpdir/$sh2"]} {
        fail "$testname"
        fail "$testname"
        return
        return
    }
    }
    # Link against the shared library.  Use -rpath so that the
    # Link against the shared library.  Use -rpath so that the
    # dynamic linker can locate the shared library at runtime.
    # dynamic linker can locate the shared library at runtime.
    # On AIX, we must include /lib in -rpath, as otherwise the loader
    # On AIX, we must include /lib in -rpath, as otherwise the loader
    # can not find -lc.
    # can not find -lc.
    set rpath $tmpdir
    set rpath $tmpdir
    if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
    if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
        set rpath /lib:$tmpdir
        set rpath /lib:$tmpdir
    }
    }
    if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
    if ![ld_simple_link $CC $tmpdir/$progname "-Wl,-rpath,$rpath $tmpdir/$main $tmpdir/$progname.so"] {
        fail "$testname"
        fail "$testname"
        return
        return
    }
    }
    # Run the resulting program
    # Run the resulting program
    send_log "$tmpdir/$progname >$tmpdir/$progname.out\n"
    send_log "$tmpdir/$progname >$tmpdir/$progname.out\n"
    verbose "$tmpdir/$progname >$tmpdir/$progname.out"
    verbose "$tmpdir/$progname >$tmpdir/$progname.out"
    catch "exec $tmpdir/$progname >$tmpdir/$progname.out" exec_output
    catch "exec $tmpdir/$progname >$tmpdir/$progname.out" exec_output
    if ![string match "" $exec_output] then {
    if ![string match "" $exec_output] then {
        send_log "$exec_output\n"
        send_log "$exec_output\n"
        verbose "$exec_output"
        verbose "$exec_output"
        fail "$testname"
        fail "$testname"
        return
        return
    }
    }
    send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n"
    send_log "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat\n"
    verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat"
    verbose "diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat"
    catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output
    catch "exec diff $tmpdir/$progname.out $srcdir/$subdir/$dat.dat" exec_output
    set exec_output [prune_warnings $exec_output]
    set exec_output [prune_warnings $exec_output]
    if {![string match "" $exec_output]} then {
    if {![string match "" $exec_output]} then {
        send_log "$exec_output\n"
        send_log "$exec_output\n"
        verbose "$exec_output"
        verbose "$exec_output"
        fail "$testname"
        fail "$testname"
        return
        return
    }
    }
    pass "$testname"
    pass "$testname"
}
}
 
 
if [istarget mips*-*-*] {
# Old version of GCC for MIPS default to enabling -fpic
 
# and get confused if it is used on the command line.
 
if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
    set picflag ""
    set picflag ""
} else {
} else {
    # Unfortunately, the gcc argument is -fpic and the cc argument is
    # Unfortunately, the gcc argument is -fpic and the cc argument is
    # -KPIC.  We have to try both.
    # -KPIC.  We have to try both.
    set picflag "-fpic"
    set picflag "-fpic"
    send_log "$CC $picflag\n"
    send_log "$CC $picflag\n"
    verbose "$CC $picflag"
    verbose "$CC $picflag"
    catch "exec $CC $picflag" exec_output
    catch "exec $CC $picflag" exec_output
    send_log "$exec_output\n"
    send_log "$exec_output\n"
    verbose "--" "$exec_output"
    verbose "--" "$exec_output"
    if { [string match "*illegal option*" $exec_output] \
    if { [string match "*illegal option*" $exec_output] \
         || [string match "*option ignored*" $exec_output] \
         || [string match "*option ignored*" $exec_output] \
         || [string match "*unrecognized option*" $exec_output] \
         || [string match "*unrecognized option*" $exec_output] \
         || [string match "*passed to ld*" $exec_output] } {
         || [string match "*passed to ld*" $exec_output] } {
        if [istarget *-*-sunos4*] {
        if [istarget *-*-sunos4*] {
            set picflag "-pic"
            set picflag "-pic"
        } else {
        } else {
            set picflag "-KPIC"
            set picflag "-KPIC"
        }
        }
    }
    }
}
}
verbose "Using $picflag to compile PIC code"
verbose "Using $picflag to compile PIC code"
# Compile the main program.
# Compile the main program.
if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
if ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
    unresolved "shared (non PIC)"
    unresolved "shared (non PIC)"
    unresolved "shared"
    unresolved "shared"
} else {
} else {
    # The shared library is composed of two files.  First compile them
    # The shared library is composed of two files.  First compile them
    # without using -fpic.  That should work on an ELF system,
    # without using -fpic.  That should work on an ELF system,
    # although it will be less efficient because the dynamic linker
    # although it will be less efficient because the dynamic linker
    # will need to do more relocation work.  However, note that not
    # will need to do more relocation work.  However, note that not
    # using -fpic will cause some of the tests to return different
    # using -fpic will cause some of the tests to return different
    # results.
    # results.
    if { ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
    if { ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
         || ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
         || ![ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
        unresolved "shared (non PIC)"
        unresolved "shared (non PIC)"
    } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
    } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
        shared_test shnp "shared (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff
        shared_test shnp "shared (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff
    } else {
    } else {
        # SunOS non PIC shared libraries don't permit some cases of
        # SunOS non PIC shared libraries don't permit some cases of
        # overriding.
        # overriding.
        setup_xfail "*-*-sunos4*"
        setup_xfail "*-*-sunos4*"
        setup_xfail "ia64-*-linux*"
        setup_xfail "ia64-*-linux*"
        setup_xfail "alpha*-*-linux*"
        setup_xfail "alpha*-*-linux*"
        setup_xfail "powerpc64*-*-*"
        setup_xfail "powerpc64*-*-*"
        if { ![istarget hppa*64*-*-linux*] } {
        if { ![istarget hppa*64*-*-linux*] } {
            setup_xfail "hppa*-*-linux*"
            setup_xfail "hppa*-*-linux*"
        }
        }
        if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
        if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
            setup_xfail "sparc*-*-linux*"
            setup_xfail "sparc*-*-linux*"
        }
        }
        if { [is_elf64 $tmpdir/mainnp.o] } {
        if { [is_elf64 $tmpdir/mainnp.o] } {
            setup_xfail "x86_64-*-linux*"
            setup_xfail "x86_64-*-linux*"
        }
        }
        setup_xfail "s390x-*-linux*"
        setup_xfail "s390x-*-linux*"
        if [ string match $shared_needs_pic "yes" ] {
        if [ string match $shared_needs_pic "yes" ] {
            setup_xfail "arm*-*-linux*"
            setup_xfail "arm*-*-linux*"
        }
        }
        shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared
        shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o shared
        # Test ELF shared library relocations with a non-zero load
        # Test ELF shared library relocations with a non-zero load
        # address for the library.  Near as I can tell, the R_*_RELATIVE
        # address for the library.  Near as I can tell, the R_*_RELATIVE
        # relocations for various targets are broken in the case where
        # relocations for various targets are broken in the case where
        # the load address is not zero (which is the default).
        # the load address is not zero (which is the default).
        setup_xfail "*-*-sunos4*"
        setup_xfail "*-*-sunos4*"
        setup_xfail "*-*-linux*libc1"
        setup_xfail "*-*-linux*libc1"
        setup_xfail "powerpc*-*-linux*"
        setup_xfail "powerpc*-*-linux*"
        setup_xfail "ia64-*-linux*"
        setup_xfail "ia64-*-linux*"
        setup_xfail "alpha*-*-linux*"
        setup_xfail "alpha*-*-linux*"
        setup_xfail "mips*-*-linux*"
        setup_xfail "mips*-*-linux*"
        if { ![istarget hppa*64*-*-linux*] } {
        if { ![istarget hppa*64*-*-linux*] } {
            setup_xfail "hppa*-*-linux*"
            setup_xfail "hppa*-*-linux*"
        }
        }
        if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
        if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainnp.o] } {
            setup_xfail "sparc*-*-linux*"
            setup_xfail "sparc*-*-linux*"
        }
        }
        if { [is_elf64 $tmpdir/mainnp.o] } {
        if { [is_elf64 $tmpdir/mainnp.o] } {
            setup_xfail "x86_64-*-linux*"
            setup_xfail "x86_64-*-linux*"
        }
        }
        setup_xfail "s390x-*-linux*"
        setup_xfail "s390x-*-linux*"
        if [ string match $shared_needs_pic "yes" ] {
        if [ string match $shared_needs_pic "yes" ] {
            setup_xfail "arm*-*-linux*"
            setup_xfail "arm*-*-linux*"
        }
        }
        shared_test shnp "shared (non PIC, load offset)" \
        shared_test shnp "shared (non PIC, load offset)" \
                mainnp.o sh1np.o sh2np.o shared \
                mainnp.o sh1np.o sh2np.o shared \
                "-T $srcdir/$subdir/elf-offset.ld"
                "-T $srcdir/$subdir/elf-offset.ld"
    } }
    } }
    # Now compile the code using -fpic.
    # Now compile the code using -fpic.
    if { ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
    if { ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
         || ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
         || ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
        unresolved "shared"
        unresolved "shared"
    } else {
    } else {
        # SunOS can not compare function pointers correctly
        # SunOS can not compare function pointers correctly
        if [istarget "*-*-sunos4*"] {
        if [istarget "*-*-sunos4*"] {
            shared_test shp "shared" mainnp.o sh1p.o sh2p.o sun4
            shared_test shp "shared" mainnp.o sh1p.o sh2p.o sun4
        } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
        } else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
            shared_test shp "shared" mainnp.o sh1p.o sh2p.o xcoff
            shared_test shp "shared" mainnp.o sh1p.o sh2p.o xcoff
        } else {
        } else {
            shared_test shp "shared" mainnp.o sh1p.o sh2p.o shared
            shared_test shp "shared" mainnp.o sh1p.o sh2p.o shared
            ld_compile "$CC $CFLAGS -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
            ld_compile "$CC $CFLAGS -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
            ld_compile "$CC $CFLAGS -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
            ld_compile "$CC $CFLAGS -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
            shared_test shp "shared -Bsymbolic" mainnp.o sh1p.o sh2p.o symbolic "-Bsymbolic"
            shared_test shp "shared -Bsymbolic" mainnp.o sh1p.o sh2p.o symbolic "-Bsymbolic"
            ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
            ld_compile "$CC $CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
            ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
            ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
        } }
        } }
    }
    }
}
}
# Now do the same tests again, but this time compile main.c PIC.
# Now do the same tests again, but this time compile main.c PIC.
if ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
if ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
    unresolved "shared (PIC main, non PIC so)"
    unresolved "shared (PIC main, non PIC so)"
    unresolved "shared (PIC main)"
    unresolved "shared (PIC main)"
} else {
} else {
    if { [file exists $tmpdir/sh1np.o ] && [ file exists $tmpdir/sh2np.o ] } {
    if { [file exists $tmpdir/sh1np.o ] && [ file exists $tmpdir/sh2np.o ] } {
        if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
        if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
            shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff
            shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff
        } else {
        } else {
            # SunOS non PIC shared libraries don't permit some cases of
            # SunOS non PIC shared libraries don't permit some cases of
            # overriding.
            # overriding.
            setup_xfail "*-*-sunos4*"
            setup_xfail "*-*-sunos4*"
            setup_xfail "ia64-*-linux*"
            setup_xfail "ia64-*-linux*"
            setup_xfail "alpha*-*-linux*"
            setup_xfail "alpha*-*-linux*"
            setup_xfail "powerpc64*-*-*"
            setup_xfail "powerpc64*-*-*"
            if { ![istarget hppa*64*-*-linux*] } {
            if { ![istarget hppa*64*-*-linux*] } {
                setup_xfail "hppa*-*-linux*"
                setup_xfail "hppa*-*-linux*"
            }
            }
            if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainp.o] } {
            if { [istarget sparc*-*-linux*] && [is_elf64 $tmpdir/mainp.o] } {
                setup_xfail "sparc*-*-linux*"
                setup_xfail "sparc*-*-linux*"
            }
            }
            if { [is_elf64 $tmpdir/mainp.o] } {
            if { [is_elf64 $tmpdir/mainp.o] } {
                setup_xfail "x86_64-*-linux*"
                setup_xfail "x86_64-*-linux*"
            }
            }
            setup_xfail "s390x-*-linux*"
            setup_xfail "s390x-*-linux*"
            if [ string match $shared_needs_pic "yes" ] {
            if [ string match $shared_needs_pic "yes" ] {
                setup_xfail "arm*-*-linux*"
                setup_xfail "arm*-*-linux*"
            }
            }
            shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared
            shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o shared
        }
        }
    } else {
    } else {
        unresolved "shared (PIC main, non PIC so)"
        unresolved "shared (PIC main, non PIC so)"
    }
    }
    if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } {
    if { [file exists $tmpdir/sh1p.o ] && [ file exists $tmpdir/sh2p.o ] } {
        if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
        if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
            shared_test shmpp "shared (PIC main)" mainp.o sh1p.o sh2p.o xcoff
            shared_test shmpp "shared (PIC main)" mainp.o sh1p.o sh2p.o xcoff
        } else {
        } else {
            shared_test shmpp "shared (PIC main)" mainp.o sh1p.o sh2p.o shared
            shared_test shmpp "shared (PIC main)" mainp.o sh1p.o sh2p.o shared
        }
        }
    } else {
    } else {
        unresolved "shared (PIC main)"
        unresolved "shared (PIC main)"
    }
    }
}
}
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
    # Remove the temporary directory.
    # Remove the temporary directory.
    catch "exec rm -rf $tmpdir" exec_status
    catch "exec rm -rf $tmpdir" exec_status
}
}
 
 

powered by: WebSVN 2.1.0

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