From 10a63f80ae9a440fe38271be91193b0192215fb6 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Sun, 20 Nov 2022 14:55:52 +0100 Subject: [PR build/29791] gnulib: Disable _GL_ATTRIBUTE_DEALLOC on Solaris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gdbsupport compilation badly fails with GCC 12 on Solaris, with errors like ../gnulib/config.h:1693:72: error: ‘malloc’ attribute argument 1 is ambiguous 1693 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) | ^ ../gnulib/config.h:1693:72: note: use a cast to the expected type to disambiguate We've not yet been able to determine where the ambiguity actually lies, so this patch works around the issue by disabling _GL_ATTRIBUTE_DEALLOC on Solaris, at least as a workaround for GDB 13. As Tom suggested in the PR, this is done using our infrastructure for local gnulib patches. Tested on sparcv9-sun-solaris2.11, amd64-pc-solaris2.11, and x86_64-pc-linux-gnu. Approved-By: Simon Marchi --- gnulib/import/m4/gnulib-common.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnulib/import') diff --git a/gnulib/import/m4/gnulib-common.m4 b/gnulib/import/m4/gnulib-common.m4 index 30911d1..529ec34 100644 --- a/gnulib/import/m4/gnulib-common.m4 +++ b/gnulib/import/m4/gnulib-common.m4 @@ -182,7 +182,8 @@ AC_DEFUN([gl_COMMON_BODY], [ _GL_ATTRIBUTE_DEALLOC_FREE declares that the function returns pointers that can be freed via 'free'; it can be used only after declaring 'free'. */ /* Applies to: functions. Cannot be used on inline functions. */ -#if _GL_GNUC_PREREQ (11, 0) +/* Disable on Solaris to avoid GDB PR build/29791. */ +#if _GL_GNUC_PREREQ (11, 0) && !(defined(__sun__) && defined(__svr4__)) # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i))) #else # define _GL_ATTRIBUTE_DEALLOC(f, i) -- cgit v1.1