From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 87169384F4A8 for ; Fri, 18 Nov 2022 13:08:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 87169384F4A8 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 81055AFBA6 for ; Fri, 18 Nov 2022 14:08:53 +0100 (CET) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DYDRbvWFJT9O for ; Fri, 18 Nov 2022 14:08:53 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855a16.dip0.t-ipconnect.de [80.133.90.22]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id E1EA5AF5F3 for ; Fri, 18 Nov 2022 14:08:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1668776932; bh=/P97SEyZJ/sqyYjDqj/2mTLfVELd7JR7ygQG7cLxDBc=; h=From:To:Subject:Date:From; b=XZJfAmUrP+tdIBTVKdaDXP5yERKNumnChNhazYP3eCOXz8Mf/OTd7ZvEMfftppZM9 bdHIRqAAiskvvZlQFTYzNWrhn6iyZ/UY/XUbk23oI97CENGIkbjLm/Rxi+AvugOmti fqqiSD7mqRgwzB0wUDOxFJoXyFkdSOtfvvlX2fNWHPNRsdgrySrNNdgIoB+e6cHdeB 3YldjHTRIU2Pe8X0XCazdy+TDu3ix21NqCGw2B8l3W2Brvp/zNpY/lfAIqqak+46sR jVVL/RY+Rd+2BS+ieprpxkk2jVz9ZZuhIAGDWnSKdRvBQ+qMbFyUVr/w5+MX+QByYw Vr7YV3dI0K6BQ== From: Rainer Orth To: gdb-patches@sourceware.org Subject: [PATCH][PR build/29791] gnulib: Disable _GL_ATTRIBUTE_DEALLOC on Solaris Date: Fri, 18 Nov 2022 14:08:52 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-3794.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable gdbsupport compilation badly fails with GCC 12 on Solaris, with errors like ../gnulib/config.h:1693:72: error: =E2=80=98malloc=E2=80=99 attribute argum= ent 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 disamb= iguate 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. Ok for trunk? Rainer --=20 ---------------------------------------------------------------------------= -- Rainer Orth, Center for Biotechnology, Bielefeld University --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sol2-attribute-malloc-error-gcc12.patch # HG changeset patch # Parent ebbd2c43c7405df23a60abebbe5cbf995bb99de2 [PR build/29791] gnulib: Disable _GL_ATTRIBUTE_DEALLOC on Solaris diff --git a/gnulib/config.in b/gnulib/config.in --- 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-common.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/patches/0002-no-solaris-_gl_attribute_dealloc b/gnulib/patches/0002-no-solaris-_gl_attribute_dealloc new file mode 100644 --- /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-common.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 --- a/gnulib/update-gnulib.sh +++ b/gnulib/update-gnulib.sh @@ -188,6 +188,7 @@ apply_patches () } apply_patches "patches/0001-use-windows-stat" +apply_patches "patches/0002-no-solaris-_gl_attribute_dealloc" # Regenerate all necessary files... aclocal && --=-=-=--