Blame SOURCES/0008-testsuite-build-plugins-with-std-c-11.patch

e60d6e
From 16694079a3f415f5e5683b0afe6978810ac259b1 Mon Sep 17 00:00:00 2001
e60d6e
From: David Malcolm <dmalcolm@redhat.com>
e60d6e
Date: Tue, 31 Aug 2021 17:01:05 -0400
e60d6e
Subject: [PATCH 08/17] testsuite: build plugins with -std=c++11
e60d6e
e60d6e
Various testsuite plugins fail when built within DTS with e.g.:
e60d6e
  cc1: error: cannot load plugin ./diagnostic_plugin_test_paths.so: /builddir/build/BUILD/gcc-11.1.1-20210623/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/src/.libs/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./diagnostic_plugin_test_paths.so)
e60d6e
e60d6e
These turn out to C++14's sized deletion
e60d6e
(see https://en.cppreference.com/w/cpp/memory/new/operator_delete):
e60d6e
e60d6e
   14: 0000000000000000      0 FUNC    GLOBAL DEFAULT    UNDEF _ZdlPvm@CXXABI_1.3.9 (4)
e60d6e
   48: 0000000000000000      0 FUNC    GLOBAL DEFAULT    UNDEF _ZdlPvm@CXXABI_1.3.9
e60d6e
   14: 0000000000000000      0 FUNC    GLOBAL DEFAULT    UNDEF operator delete(void*, unsigned long)@CXXABI_1.3.9 (4)
e60d6e
   48: 0000000000000000      0 FUNC    GLOBAL DEFAULT    UNDEF operator delete(void*, unsigned long)@CXXABI_1.3.9
e60d6e
e60d6e
Looks like plugin.exp is building the test plugins against the
e60d6e
freshly-built libstdc++, and then trying to dynamically load them
e60d6e
against the system libstdc++.
e60d6e
e60d6e
This patch forces the use of -std=c++11 when building these test plugins,
e60d6e
to sidestep the problem.
e60d6e
---
e60d6e
 gcc/testsuite/lib/plugin-support.exp | 2 +-
e60d6e
 1 file changed, 1 insertion(+), 1 deletion(-)
e60d6e
e60d6e
diff --git a/gcc/testsuite/lib/plugin-support.exp b/gcc/testsuite/lib/plugin-support.exp
e60d6e
index 6d651901e..9943dbb37 100644
e60d6e
--- a/gcc/testsuite/lib/plugin-support.exp
e60d6e
+++ b/gcc/testsuite/lib/plugin-support.exp
e60d6e
@@ -103,7 +103,7 @@ proc plugin-test-execute { plugin_src plugin_tests } {
e60d6e
 	}
e60d6e
 	set optstr [concat $optstr "-DIN_GCC -fPIC -shared -fno-rtti -undefined dynamic_lookup"]
e60d6e
     } else {
e60d6e
-	set plug_cflags $PLUGINCFLAGS 
e60d6e
+	set plug_cflags "$PLUGINCFLAGS -std=c++11"
e60d6e
 	set optstr "$includes $extra_flags -DIN_GCC -fPIC -shared -fno-rtti"
e60d6e
     }
e60d6e
 
e60d6e
-- 
e60d6e
2.31.1
e60d6e