From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1147) id 1D7F9395BC44; Sun, 20 Nov 2022 13:56:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D7F9395BC44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668952598; bh=QjUwNyh6XAn2wKarlw7Nj3I3zucede4oRk9RiifQJXY=; h=From:To:Subject:Date:From; b=q1O9lAA2ahfuhDPtC1VcT/VdkLDF4POdWOAilyMWbYLCV7D2GM9QiFNS5cF9NzVdh w0ecG5QdisXNde03HJEyvzuDEGw+4adKpm8/epFJhJEzE0m+YLhoVVnGz51d/r8SPs xnN9fi+Bust9LE6jUs6cgc75teehQKzmTt5cdPWY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Rainer Orth To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] [PR build/29791] gnulib: Disable _GL_ATTRIBUTE_DEALLOC on Solaris X-Act-Checkin: binutils-gdb X-Git-Author: Rainer Orth X-Git-Refname: refs/heads/master X-Git-Oldrev: f1a8d786c37bbe40d0bc2fec618d0e875d043811 X-Git-Newrev: 10a63f80ae9a440fe38271be91193b0192215fb6 Message-Id: <20221120135638.1D7F9395BC44@sourceware.org> Date: Sun, 20 Nov 2022 13:56:38 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D10a63f80ae9a= 440fe38271be91193b0192215fb6 commit 10a63f80ae9a440fe38271be91193b0192215fb6 Author: Rainer Orth Date: Sun Nov 20 14:55:52 2022 +0100 [PR build/29791] gnulib: Disable _GL_ATTRIBUTE_DEALLOC on Solaris =20 gdbsupport compilation badly fails with GCC 12 on Solaris, with errors like =20 ../gnulib/config.h:1693:72: error: =E2=80=98malloc=E2=80=99 attribute a= rgument 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 di= sambiguate =20 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. =20 As Tom suggested in the PR, this is done using our infrastructure for local gnulib patches. =20 Tested on sparcv9-sun-solaris2.11, amd64-pc-solaris2.11, and x86_64-pc-linux-gnu. =20 Approved-By: Simon Marchi Diff: --- gnulib/config.in | 3 ++- gnulib/import/m4/gnulib-common.m4 | 3 ++- gnulib/patches/0002-no-solaris-_gl_attribute_dealloc | 13 +++++++++++++ gnulib/update-gnulib.sh | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gnulib/config.in b/gnulib/config.in index 07efd1334fa..f70c6a52b43 100644 --- a/gnulib/config.in +++ b/gnulib/config.in @@ -1688,7 +1688,8 @@ _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) diff --git a/gnulib/import/m4/gnulib-common.m4 b/gnulib/import/m4/gnulib-co= mmon.m4 index 30911d1581a..529ec340ba8 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) diff --git a/gnulib/patches/0002-no-solaris-_gl_attribute_dealloc b/gnulib/= patches/0002-no-solaris-_gl_attribute_dealloc new file mode 100644 index 00000000000..85dbc4b79b7 --- /dev/null +++ b/gnulib/patches/0002-no-solaris-_gl_attribute_dealloc @@ -0,0 +1,13 @@ +diff --git a/gnulib/import/m4/gnulib-common.m4 b/gnulib/import/m4/gnulib-c= ommon.m4 +--- 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) diff --git a/gnulib/update-gnulib.sh b/gnulib/update-gnulib.sh index 80aa3fafbf8..f82b08b5ebc 100755 --- a/gnulib/update-gnulib.sh +++ b/gnulib/update-gnulib.sh @@ -188,6 +188,7 @@ apply_patches () } =20 apply_patches "patches/0001-use-windows-stat" +apply_patches "patches/0002-no-solaris-_gl_attribute_dealloc" =20 # Regenerate all necessary files... aclocal &&