Index: ld/testsuite/ld-elfvers/vers.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elfvers/vers.exp,v retrieving revision 1.53 diff -u -p -r1.53 vers.exp --- ld/testsuite/ld-elfvers/vers.exp 15 Mar 2011 23:34:30 -0000 1.53 +++ ld/testsuite/ld-elfvers/vers.exp 5 Dec 2011 20:15:51 -0000 @@ -72,26 +72,22 @@ set SOBJDUMP_FLAGS --syms set shared "--shared --no-undefined-version" set script --version-script -if [istarget mips*-*-*] { - set picflag "" -} else { - # Unfortunately, the gcc argument is -fpic and the cc argument is - # -KPIC. We have to try both. - set picflag "-fpic" - send_log "$CC $picflag\n" - verbose "$CC $picflag" - catch "exec $CC $picflag" exec_output - send_log "$exec_output\n" - verbose "--" "$exec_output" - if { [string match "*illegal option*" $exec_output] - || [string match "*option ignored*" $exec_output] - || [string match "*unrecognized option*" $exec_output] - || [string match "*passed to ld*" $exec_output] } { - if [istarget *-*-sunos4*] { - set picflag "-pic" - } else { - set picflag "-KPIC" - } +# Unfortunately, the gcc argument is -fpic and the cc argument is +# -KPIC. We have to try both. +set picflag "-fpic" +send_log "$CC $picflag\n" +verbose "$CC $picflag" +catch "exec $CC $picflag" exec_output +send_log "$exec_output\n" +verbose "--" "$exec_output" +if { [string match "*illegal option*" $exec_output] + || [string match "*option ignored*" $exec_output] + || [string match "*unrecognized option*" $exec_output] + || [string match "*passed to ld*" $exec_output] } { + if [istarget *-*-sunos4*] { + set picflag "-pic" + } else { + set picflag "-KPIC" } } @@ -768,8 +764,8 @@ proc build_exec { test source execname f pass $test } -if [istarget x86_64-*-linux*] { - # x86_64 doesn't like non-pic shared libraries +if { [istarget x86_64-*-linux*] || [istarget mips*-*-linux*] } { + # x86_64 and MIPS don't like non-pic shared libraries set pic "yes" } else { set pic "no" Index: ld/testsuite/ld-elfvsb/elfvsb.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elfvsb/elfvsb.exp,v retrieving revision 1.36 diff -u -p -r1.36 elfvsb.exp --- ld/testsuite/ld-elfvsb/elfvsb.exp 19 Jun 2011 21:22:13 -0000 1.36 +++ ld/testsuite/ld-elfvsb/elfvsb.exp 5 Dec 2011 20:15:51 -0000 @@ -249,7 +249,7 @@ proc visibility_run {visibility} { set VSBCFLAG "" }}}}}}}}} - if { [istarget powerpc*-*-linux*] } { + if { [istarget powerpc*-*-linux*] || [istarget mips*-*-linux*] } { # Testing non-PIC libraries is a waste of effort on any target. # If you don't pass -fpic or -fPIC to gcc, gcc will assume quite # reasonably that you are not compiling for a shared library. @@ -453,26 +453,22 @@ proc visibility_run {visibility} { }} } -if [istarget mips*-*-*] { - set picflag "" -} else { - # Unfortunately, the gcc argument is -fpic and the cc argument is - # -KPIC. We have to try both. - set picflag "-fpic" - send_log "$CC $picflag\n" - verbose "$CC $picflag" - catch "exec $CC $picflag" exec_output - send_log "$exec_output\n" - verbose "--" "$exec_output" - if { [string match "*illegal option*" $exec_output] \ - || [string match "*option ignored*" $exec_output] \ - || [string match "*unrecognized option*" $exec_output] \ - || [string match "*passed to ld*" $exec_output] } { - if [istarget *-*-sunos4*] { - set picflag "-pic" - } else { - set picflag "-KPIC" - } +# Unfortunately, the gcc argument is -fpic and the cc argument is +# -KPIC. We have to try both. +set picflag "-fpic" +send_log "$CC $picflag\n" +verbose "$CC $picflag" +catch "exec $CC $picflag" exec_output +send_log "$exec_output\n" +verbose "--" "$exec_output" +if { [string match "*illegal option*" $exec_output] \ + || [string match "*option ignored*" $exec_output] \ + || [string match "*unrecognized option*" $exec_output] \ + || [string match "*passed to ld*" $exec_output] } { + if [istarget *-*-sunos4*] { + set picflag "-pic" + } else { + set picflag "-KPIC" } } verbose "Using $picflag to compile PIC code" Index: ld/testsuite/ld-elfweak/elfweak.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-elfweak/elfweak.exp,v retrieving revision 1.18 diff -u -p -r1.18 elfweak.exp --- ld/testsuite/ld-elfweak/elfweak.exp 21 Dec 2010 11:00:48 -0000 1.18 +++ ld/testsuite/ld-elfweak/elfweak.exp 5 Dec 2011 20:15:51 -0000 @@ -370,26 +370,22 @@ proc build_exec { test execname objs fla pass $test } -if [istarget mips*-*-*] { - set picflag "" -} else { - # Unfortunately, the gcc argument is -fpic and the cc argument is - # -KPIC. We have to try both. - set picflag "-fpic" - send_log "$CC $picflag\n" - verbose "$CC $picflag" - catch "exec $CC $picflag" exec_output - send_log "$exec_output\n" - verbose "--" "$exec_output" - if { [string match "*illegal option*" $exec_output] - || [string match "*option ignored*" $exec_output] - || [string match "*unrecognized option*" $exec_output] - || [string match "*passed to ld*" $exec_output] } { - if [istarget *-*-sunos4*] { - set picflag "-pic" - } else { - set picflag "-KPIC" - } +# Unfortunately, the gcc argument is -fpic and the cc argument is +# -KPIC. We have to try both. +set picflag "-fpic" +send_log "$CC $picflag\n" +verbose "$CC $picflag" +catch "exec $CC $picflag" exec_output +send_log "$exec_output\n" +verbose "--" "$exec_output" +if { [string match "*illegal option*" $exec_output] + || [string match "*option ignored*" $exec_output] + || [string match "*unrecognized option*" $exec_output] + || [string match "*passed to ld*" $exec_output] } { + if [istarget *-*-sunos4*] { + set picflag "-pic" + } else { + set picflag "-KPIC" } } verbose "Using $picflag to compile PIC code" Index: ld/testsuite/ld-shared/shared.exp =================================================================== RCS file: /cvs/src/src/ld/testsuite/ld-shared/shared.exp,v retrieving revision 1.27 diff -u -p -r1.27 shared.exp --- ld/testsuite/ld-shared/shared.exp 19 Jun 2011 21:22:13 -0000 1.27 +++ ld/testsuite/ld-shared/shared.exp 5 Dec 2011 20:15:51 -0000 @@ -181,26 +181,22 @@ proc shared_test { progname testname mai pass "$testname" } -if [istarget mips*-*-*] { - set picflag "" -} else { - # Unfortunately, the gcc argument is -fpic and the cc argument is - # -KPIC. We have to try both. - set picflag "-fpic" - send_log "$CC $picflag\n" - verbose "$CC $picflag" - catch "exec $CC $picflag" exec_output - send_log "$exec_output\n" - verbose "--" "$exec_output" - if { [string match "*illegal option*" $exec_output] \ - || [string match "*option ignored*" $exec_output] \ - || [string match "*unrecognized option*" $exec_output] \ - || [string match "*passed to ld*" $exec_output] } { - if [istarget *-*-sunos4*] { - set picflag "-pic" - } else { - set picflag "-KPIC" - } +# Unfortunately, the gcc argument is -fpic and the cc argument is +# -KPIC. We have to try both. +set picflag "-fpic" +send_log "$CC $picflag\n" +verbose "$CC $picflag" +catch "exec $CC $picflag" exec_output +send_log "$exec_output\n" +verbose "--" "$exec_output" +if { [string match "*illegal option*" $exec_output] \ + || [string match "*option ignored*" $exec_output] \ + || [string match "*unrecognized option*" $exec_output] \ + || [string match "*passed to ld*" $exec_output] } { + if [istarget *-*-sunos4*] { + set picflag "-pic" + } else { + set picflag "-KPIC" } } verbose "Using $picflag to compile PIC code"