From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59925 invoked by alias); 6 Nov 2015 13:33:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 59894 invoked by uid 89); 6 Nov 2015 13:33:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_50,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Nov 2015 13:33:02 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-7-mzsV8ELVTIWAW7NCOajTpw-1; Fri, 06 Nov 2015 13:32:57 +0000 Received: from [10.2.206.40] ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 6 Nov 2015 13:32:57 +0000 Message-ID: <563CAC08.7050109@arm.com> Date: Fri, 06 Nov 2015 13:33:00 -0000 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Richard Earnshaw , Ramana Radhakrishnan Subject: [PATCH, ARM, v2] PR target/68059 libgcc should not use __write for printing fatal error X-MC-Unique: mzsV8ELVTIWAW7NCOajTpw-1 Content-Type: multipart/mixed; boundary="------------030904030708070607090102" X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00627.txt.bz2 This is a multi-part message in MIME format. --------------030904030708070607090102 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 604 libgcc/config/arm/linux-atomic-64bit.c uses __write to print an error message if the 64bit cmpxchg method is not available in the kernel. __write is not part of the public libc abi, so use write instead. (user code may define write in iso c conforming mode and then the error message may not be visible before the crash.) The return type in the declaration of write is fixed too. OK for trunk and backporting? libgcc/ChangeLog: 2015-11-06 Szabolcs Nagy PR target/68059 * config/arm/linux-atomic-64bit.c (__write): Rename to... (write): ...this and fix the return type. --------------030904030708070607090102 Content-Type: text/x-patch; name=arm_write.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="arm_write.diff" Content-length: 983 diff --git a/libgcc/config/arm/linux-atomic-64bit.c b/libgcc/config/arm/lin= ux-atomic-64bit.c index cdf713c..894450e 100644 --- a/libgcc/config/arm/linux-atomic-64bit.c +++ b/libgcc/config/arm/linux-atomic-64bit.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. = If not, see kernels; we check for that in an init section and bail out rather unceremoneously. */ =20 -extern unsigned int __write (int fd, const void *buf, unsigned int count); +extern int write (int fd, const void *buf, unsigned int count); extern void abort (void); =20 /* Kernel helper for compare-and-exchange. */ @@ -56,7 +56,7 @@ static void __check_for_sync8_kernelhelper (void) for the user - I'm not sure I can rely on much else being available at this point, so do the same as generic-morestack.c write () and abort (). */ - __write (2 /* stderr. */, err, sizeof (err)); + write (2 /* stderr. */, err, sizeof (err)); abort (); } }; --------------030904030708070607090102--