aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-shared/shared.exp
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-09-03 16:26:21 +0930
committerAlan Modra <amodra@gmail.com>2021-09-03 16:26:21 +0930
commit669d5115345a3f3dc1c06aec31098eb4b349a6d0 (patch)
tree0bd69d93c3e4c1b7b57d6a58e803ad3a9bd0419f /ld/testsuite/ld-shared/shared.exp
parentad77db1c02a92c912f9719f32e2452890aa738ad (diff)
downloadgdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.zip
gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.gz
gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.bz2
ld testsuite tidy
Fixes a few issues: 1) If you use "-fsanitize=address,undefined" in CFLAGS, the Makefile attempt to trim off -fsanitize options left us with ",undefined". 2) ld_compile adds CFLAGS_FOR_TARGET itself, no need to pass it. 3) CFLAGS might be needed linking bootstrap test. * Makefile.am (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Trim off all -fsanitize=*. * Makefile.in: Regenerate. * testsuite/ld-bootstrap/bootstrap.exp: Use CFLAGS when linking. * testsuite/ld-cdtest/cdtest.exp: Use CFLAGS_FOR_TARGET when linking. * testsuite/ld-auto-import/auto-import.exp: Don't pass CFLAGS_FOR_TARGET to ld_compile. * testsuite/ld-cygwin/exe-export.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-pe/pe-compile.exp: Likewise. * testsuite/ld-pe/pe-run.exp: Likewise. * testsuite/ld-pe/pe-run2.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Likewise, and don't allow nios2 testing to trash CFLAGS_FOR_TARGET. * testsuite/ld-scripts/crossref.exp: Don't pass options in CC_FOR_TARGET, do so in CFLAGS_FOR_TARGET instead. * testsuite/ld-srec/srec.exp: Likewise, and for CXX.
Diffstat (limited to 'ld/testsuite/ld-shared/shared.exp')
-rw-r--r--ld/testsuite/ld-shared/shared.exp20
1 files changed, 10 insertions, 10 deletions
diff --git a/ld/testsuite/ld-shared/shared.exp b/ld/testsuite/ld-shared/shared.exp
index d191e31..655a56d 100644
--- a/ld/testsuite/ld-shared/shared.exp
+++ b/ld/testsuite/ld-shared/shared.exp
@@ -212,7 +212,7 @@ if { [istarget mips*-*-*] && ! [at_least_gcc_version 4 3] } then {
verbose "Using $picflag to compile PIC code"
# Compile the main program.
-if ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
+if ![ld_compile "$CC_FOR_TARGET $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
unsupported "shared (non PIC)"
unsupported "shared"
} else {
@@ -223,8 +223,8 @@ if ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG" $srcdir/$subdir/mai
# using -fpic will cause some of the tests to return different
# results. Make sure that PLT is used since PLT is expected.
global PLT_CFLAGS NOPIE_CFLAGS
- if { ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $NOPIE_CFLAGS $CFLAGS_FOR_TARGET $SHCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
- || ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $CFLAGS_FOR_TARGET $SHCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
+ if { ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $NOPIE_CFLAGS $SHCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
+ || ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $SHCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
unsupported "shared (non PIC)"
} else { if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
shared_test shnp "shared (nonPIC)" mainnp.o sh1np.o sh2np.o xcoff
@@ -284,25 +284,25 @@ if ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG" $srcdir/$subdir/mai
# Now compile the code using -fpic.
- if { ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
- || ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
+ if { ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
+ || ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
unsupported "shared"
} else {
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
shared_test shp "shared" mainnp.o sh1p.o sh2p.o xcoff
} else {
shared_test shp "shared" mainnp.o sh1p.o sh2p.o shared
- ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
- ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
+ ld_compile "$CC_FOR_TARGET -DSYMBOLIC_TEST -DXCOFF_TEST $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
+ ld_compile "$CC_FOR_TARGET -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"
- ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
- ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
+ ld_compile "$CC_FOR_TARGET $SHCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o
+ ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o
}
}
}
# Now do the same tests again, but this time compile main.c PIC.
-if ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
+if ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
unsupported "shared (PIC main, non PIC so)"
unsupported "shared (PIC main)"
} else {