From patchwork Wed Jan 17 15:20:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 25429 Received: (qmail 3176 invoked by alias); 17 Jan 2018 15:21:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2956 invoked by uid 89); 17 Jan 2018 15:21:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Jan 2018 15:21:03 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebpWJ-0003li-JA for gdb-patches@sourceware.org; Wed, 17 Jan 2018 10:21:01 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebpWJ-0003lY-G0; Wed, 17 Jan 2018 10:20:55 -0500 Received: from [176.228.60.248] (port=2379 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ebpWI-0002hQ-Oc; Wed, 17 Jan 2018 10:20:55 -0500 Date: Wed, 17 Jan 2018 17:20:48 +0200 Message-Id: <83tvvkwlyn.fsf@gnu.org> From: Eli Zaretskii To: Andreas Schwab CC: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org In-reply-to: <87tvvljwfc.fsf@linux-m68k.org> (message from Andreas Schwab on Tue, 16 Jan 2018 23:00:55 +0100) Subject: Re: Compilation warning in simple-object-xcoff.c Reply-to: Eli Zaretskii References: <831sipy83q.fsf@gnu.org> <87tvvljwfc.fsf@linux-m68k.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes > From: Andreas Schwab > Cc: Eli Zaretskii , gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org > Date: Tue, 16 Jan 2018 23:00:55 +0100 > > On Jan 16 2018, DJ Delorie wrote: > > > And it's not the host's bit size that counts; there are usually ways to > > get 64-bit file operations on 32-bit hosts. > > If ACX_LARGEFILE doesn't succeed in enabling those 64-bit file > operations (thus making off_t a 64-bit type) then you are out of luck > (or AC_SYS_LARGEFILE doesn't support your host yet). Yes, AC_SYS_LARGEFILE doesn't support MinGW. DJ, would the following semi-kludgey workaround be acceptable? --- libiberty/simple-object-xcoff.c~0 2018-01-12 05:31:04.000000000 +0200 +++ libiberty/simple-object-xcoff.c 2018-01-17 12:21:08.496186000 +0200 @@ -596,13 +596,19 @@ simple_object_xcoff_find_sections (simpl aux = (unsigned char *) auxent; if (u64) { + /* Use an intermediate 64-bit type to avoid + compilation warning about 32-bit shift below on + hosts with 32-bit off_t which aren't supported by + AC_SYS_LARGEFILE. */ + ulong_type x_scnlen64; + if ((auxent->u.xcoff64.x_csect.x_smtyp & 0x7) != XTY_SD || auxent->u.xcoff64.x_csect.x_smclas != XMC_XO) continue; - x_scnlen = fetch_32 (aux + offsetof (union external_auxent, - u.xcoff64.x_csect.x_scnlen_hi)); - x_scnlen = x_scnlen << 32 + x_scnlen64 = fetch_32 (aux + offsetof (union external_auxent, + u.xcoff64.x_csect.x_scnlen_hi)); + x_scnlen = x_scnlen64 << 32 | fetch_32 (aux + offsetof (union external_auxent, u.xcoff64.x_csect.x_scnlen_lo)); }