aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2020-11-17 14:52:49 +0000
committerGary Benson <gbenson@redhat.com>2020-11-17 14:52:49 +0000
commit811bdca093965e857e4f4473fbf336da2a93518a (patch)
treee987ff0a4c365d6e6a0ba7f5fd17a4d7b9ee605f /gdb
parent0833984dda29c0b363785edb54a2e1cbdf0d129e (diff)
downloadbinutils-811bdca093965e857e4f4473fbf336da2a93518a.zip
binutils-811bdca093965e857e4f4473fbf336da2a93518a.tar.gz
binutils-811bdca093965e857e4f4473fbf336da2a93518a.tar.bz2
Fix gdb.trace testcase build failures with Clang
25 gdb.trace tests failed to build on x86 with Clang because the x86_trace_dummy function is optimized out, causing the builds to fail with variations on the following error: gdb compile failed, /usr/bin/ld: /gdbtest/build/gdb/testsuite/outputs/gdb.trace/backtrace/backtrace0.o: in function `main': /gdbtest/src/gdb/testsuite/gdb.trace/actions.c:146: undefined reference to `x86_trace_dummy' clang-12: error: linker command failed with exit code 1 This commit adds __attribute__ ((used)) to x86_trace_dummy to prevent this. gdb/testsuite/ChangeLog: * gdb.trace/trace-common.h (x86_trace_dummy): Add __attribute__ ((used)).
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.trace/trace-common.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9c326d5..14b3da5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-11-17 Gary Benson <gbenson@redhat.com>
+
+ * gdb.trace/trace-common.h (x86_trace_dummy): Add
+ __attribute__ ((used)).
+
2020-11-17 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.gdb/unittest.exp: Spot 'Running...' lines.
diff --git a/gdb/testsuite/gdb.trace/trace-common.h b/gdb/testsuite/gdb.trace/trace-common.h
index a83f110..2354c0c 100644
--- a/gdb/testsuite/gdb.trace/trace-common.h
+++ b/gdb/testsuite/gdb.trace/trace-common.h
@@ -30,7 +30,7 @@
#if (defined __x86_64__ || defined __i386__)
-static void
+static void __attribute__ ((used))
x86_trace_dummy ()
{
int x = 0;