[gcc(refs/users/aoliva/heads/testme)] testsuite: shared: check for shared libsupc++ as well
Alexandre Oliva
aoliva@gcc.gnu.org
Sat Mar 28 08:43:53 GMT 2026
https://gcc.gnu.org/g:1800c178117e7361c880a460e86adaa0e26cf537
commit 1800c178117e7361c880a460e86adaa0e26cf537
Author: Alexandre Oliva <oliva@adacore.com>
Date: Tue Mar 10 04:18:50 2026 -0300
testsuite: shared: check for shared libsupc++ as well
When checking for -shared support for C++ tests, also bring symbols
from libstdc++, to make sure they can be brought into shared
libraries. Otherwise, pr114790_[01].C will fail when the dejagnu test
run arranges to link -lsupc++ explicitly, even if the test uses
-nostdlib.
for gcc/testsuite/ChangeLog
* lib/target-supports.exp (check_effective_target_shared):
When compiling C++, also check libstdc++ symbols.
Diff:
---
gcc/testsuite/lib/target-supports.exp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 56c64ef62872..29634b583945 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1531,11 +1531,16 @@ proc check_effective_target_shared { } {
# requires GOT references, and with a libc symbol that would
# bring in significant parts of a static-only libc. Absent a
# shared libc, this would make -shared tests fail, so we don't
- # want to enable the shared effective target then.
+ # want to enable the shared effective target then. When
+ # compiling c++, also bring in symbols from libsupc++.
return [check_no_compiler_messages shared executable {
#include <stdlib.h>
extern int foo (void); extern int bar;
char *baz (void) {
+ #if __cplusplus
+ extern char *p;
+ delete p;
+ #endif
return foo () + (char*) malloc (bar);
}
} "-shared -fpic $extra_flags"]
More information about the Gcc-cvs
mailing list