This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH,testsuite] Add check_effective_target_rdynamic and use it in g++.dg/lto/pr69589_0.C.
- From: Toma Tabacu <Toma dot Tabacu at imgtec dot com>
- To: Renlin Li <renlin dot li at foss dot arm dot com>, Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Matthew Fortune <Matthew dot Fortune at imgtec dot com>, "catherine_moore at mentor dot com" <catherine_moore at mentor dot com>
- Date: Mon, 5 Jun 2017 12:21:01 +0000
- Subject: RE: [PATCH,testsuite] Add check_effective_target_rdynamic and use it in g++.dg/lto/pr69589_0.C.
- Authentication-results: sourceware.org; auth=none
- References: <A614194ED15B4844BC4C9FB7F21FCD9270456A99@hhmail02.hh.imgtec.org> <yddo9xbzu5y.fsf@CeBiTec.Uni-Bielefeld.DE> <A614194ED15B4844BC4C9FB7F21FCD9270457146@hhmail02.hh.imgtec.org> <593170D0.9000501@foss.arm.com>
Hi Renlin,
>
> Thanks for fixing this! Do you have plan to backport the fix to gcc-6 branch?
>
I am happy to backport it.
I've rebased the patch on top of the gcc-6 branch and attached it below.
Rainer, is this OK for gcc-6?
Regards,
Toma Tabacu
gcc/ChangeLog:
Backported from mainline
2017-03-09 Toma Tabacu <toma.tabacu@imgtec.com>
* doc/sourcebuild.texi (Effective-Target Keywords, Other attributes):
Document rdynamic.
gcc/testsuite/ChangeLog:
Backported from mainline
2017-03-09 Toma Tabacu <toma.tabacu@imgtec.com>
* g++.dg/lto/pr69589_0.C: Add dg-require-effective-target for
rdynamic.
* lib/target-supports.exp (check_effective_target_rdynamic):
New proc.
Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi (revision 248876)
+++ gcc/doc/sourcebuild.texi (working copy)
@@ -1950,6 +1950,9 @@
@item pie
Target supports @option{-pie}, @option{-fpie} and @option{-fPIE}.
+@item rdynamic
+Target supports @option{-rdynamic}.
+
@item section_anchors
Target supports section anchors.
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 248876)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -1424,6 +1424,14 @@
} "-static"]
}
+# Return 1 if we can use the -rdynamic option, 0 otherwise.
+
+proc check_effective_target_rdynamic { } {
+ return [check_no_compiler_messages rdynamic executable {
+ int main() { return 0; }
+ } "-rdynamic"]
+}
+
# Return 1 if cilk-plus is supported by the target, 0 otherwise.
proc check_effective_target_cilkplus { } {
Index: gcc/testsuite/g++.dg/lto/pr69589_0.C
===================================================================
--- gcc/testsuite/g++.dg/lto/pr69589_0.C (revision 248876)
+++ gcc/testsuite/g++.dg/lto/pr69589_0.C (working copy)
@@ -1,6 +1,7 @@
// { dg-lto-do link }
// { dg-lto-options "-O2 -rdynamic" }
// { dg-extra-ld-options "-r -nostdlib" }
+// { dg-require-effective-target rdynamic }
#pragma GCC visibility push(hidden)
struct A { int &operator[] (long); };
template <typename> struct B;