aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/abi
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2022-06-23 23:20:48 -0300
committerAlexandre Oliva <oliva@gnu.org>2022-06-23 23:25:52 -0300
commitfc2fb4fd547fb39d76237a3a1a50f5c4f3646936 (patch)
treee2ce526f9b58b8cb644e0df36e82464286dfd4ce /gcc/testsuite/g++.dg/abi
parent2b86788d7c976a261446654166291e855cdc8191 (diff)
downloadgcc-fc2fb4fd547fb39d76237a3a1a50f5c4f3646936.zip
gcc-fc2fb4fd547fb39d76237a3a1a50f5c4f3646936.tar.gz
gcc-fc2fb4fd547fb39d76237a3a1a50f5c4f3646936.tar.bz2
Introduce -nostdlib++ option
Using g++ to link without libstdc++, as in g++.dg/abi/pure-virtual1.C, is error prone, because there's no way to tell g++ to drop libstdc++ without also dropping libc and any other libraries that the target implicitly links in. This has often led to the need for manual adjustments to this testcase. I figured adding support for -nostdlib++, even though redundant, makes some sense. One could presumably use gcc rather than g++ for linking, for the same effect, but sometimes changing the link command is harder than adding an option, as in our testsuite. Since clang already had an option with this effect, we've adopted the same spelling. for gcc/ChangeLog * common.opt (nostdlib++): New. * doc/invoke.texi (-nostdlib++): Document it. for gcc/cp/ChangeLog * g++spec.cc (lang_specific_driver): Implement -nostdlib++. for gcc/testsuite/ChangeLog * g++.dg/abi/pure-virtual1.C: Use -nostdlib++.
Diffstat (limited to 'gcc/testsuite/g++.dg/abi')
-rw-r--r--gcc/testsuite/g++.dg/abi/pure-virtual1.C2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/abi/pure-virtual1.C b/gcc/testsuite/g++.dg/abi/pure-virtual1.C
index 538e2cb..59eaf22 100644
--- a/gcc/testsuite/g++.dg/abi/pure-virtual1.C
+++ b/gcc/testsuite/g++.dg/abi/pure-virtual1.C
@@ -1,7 +1,7 @@
// Test that we don't need libsupc++ just for __cxa_pure_virtual.
// { dg-do link }
// { dg-require-weak }
-// { dg-additional-options "-fno-rtti -nodefaultlibs -lc" }
+// { dg-additional-options "-fno-rtti -nostdlib++" }
// { dg-additional-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } }
// { dg-xfail-if "AIX weak" { powerpc-ibm-aix* } }