https://gcc.gnu.org/g:8f7c06df424fffa88422f83ba0a7c58576ae3d91
commit r15-1982-g8f7c06df424fffa88422f83ba0a7c58576ae3d91 Author: Ian Lance Taylor <i...@golang.org> Date: Thu Jul 11 16:07:06 2024 -0700 libbacktrace: fix testsuite for clang * btest.c (test1, test3): Add optnone attribute. * edtest.c (test1): Likewise. * mtest.c (test1, test3): Likewise. * configure.ac: Use -Wno-attributes and -Wno-unknown-attributes. * configure: Regenerate. Diff: --- libbacktrace/btest.c | 4 ++-- libbacktrace/configure | 3 ++- libbacktrace/configure.ac | 3 ++- libbacktrace/edtest.c | 2 +- libbacktrace/mtest.c | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libbacktrace/btest.c b/libbacktrace/btest.c index d9fc372d33d9..c4b2db2cce2f 100644 --- a/libbacktrace/btest.c +++ b/libbacktrace/btest.c @@ -49,7 +49,7 @@ POSSIBILITY OF SUCH DAMAGE. */ /* Test the backtrace function with non-inlined functions. */ -static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f2 (int) __attribute__ ((noinline, noclone)); static int f3 (int, int) __attribute__ ((noinline, noclone)); @@ -163,7 +163,7 @@ f13 (int f1line, int f2line) /* Test the backtrace_simple function with non-inlined functions. */ -static int test3 (void) __attribute__ ((noinline, noclone, unused)); +static int test3 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f22 (int) __attribute__ ((noinline, noclone)); static int f23 (int, int) __attribute__ ((noinline, noclone)); diff --git a/libbacktrace/configure b/libbacktrace/configure index ab94a85f45c1..fe0bb2083eb1 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -12384,7 +12384,8 @@ WARN_FLAGS= save_CFLAGS="$CFLAGS" for real_option in -W -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wold-style-definition \ - -Wmissing-format-attribute -Wcast-qual; do + -Wmissing-format-attribute -Wcast-qual \ + -Wno-attributes -Wno-unknown-attributes; do # Do the check with the no- prefix removed since gcc silently # accepts any -Wno-* option on purpose case $real_option in diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index 59e9c415db8f..bfd7f35d2d2b 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -144,7 +144,8 @@ AC_SUBST(EXTRA_FLAGS) ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wold-style-definition \ - -Wmissing-format-attribute -Wcast-qual], + -Wmissing-format-attribute -Wcast-qual \ + -Wno-attributes -Wno-unknown-attributes], [WARN_FLAGS]) AC_ARG_ENABLE([werror], diff --git a/libbacktrace/edtest.c b/libbacktrace/edtest.c index d99b8a602950..b644d93788cb 100644 --- a/libbacktrace/edtest.c +++ b/libbacktrace/edtest.c @@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "testlib.h" -static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, optnone, unused)); extern int f2 (int); extern int f3 (int, int); diff --git a/libbacktrace/mtest.c b/libbacktrace/mtest.c index 9afe70895148..f793391653dc 100644 --- a/libbacktrace/mtest.c +++ b/libbacktrace/mtest.c @@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "testlib.h" -static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f2 (int) __attribute__ ((noinline, noclone)); static int f3 (int, int) __attribute__ ((noinline, noclone)); @@ -211,7 +211,7 @@ f3 (int f1line __attribute__ ((unused)), int f2line __attribute__ ((unused))) /* Test the backtrace_simple function with non-inlined functions. */ -static int test3 (void) __attribute__ ((noinline, noclone, unused)); +static int test3 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f22 (int) __attribute__ ((noinline, noclone)); static int f23 (int, int) __attribute__ ((noinline, noclone));