From owner-svn-src-head@FreeBSD.ORG Sat Jun 1 17:39:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 04CCBD70 for ; Sat, 1 Jun 2013 17:39:14 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx1.freebsd.org (Postfix) with ESMTP id B9E728B8 for ; Sat, 1 Jun 2013 17:39:13 +0000 (UTC) Received: by mail-vc0-f177.google.com with SMTP id ia10so1149297vcb.36 for ; Sat, 01 Jun 2013 10:39:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=26Oyd93mBS5feZ4X373UsFR1hy/AgwaAege9nTea6XE=; b=FGJCg0dfbYTazk5e0bViUkclICVZRmTVrpWG4PBowMjphdQFkI9M7gW32wd2KKHo5R 0rPCROe0H+B0ekgO+A9l4/9xC1SKEtAwDcXepsUkL4AQgCaX/xcNBDAldpwT2MeE0Mnx 88fXFdWNf5TnGxLPP3tigwNVr062U3CV5A27U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=26Oyd93mBS5feZ4X373UsFR1hy/AgwaAege9nTea6XE=; b=hQRVzddA9qbwgPAzChPSt53sO/jOUljFGDlatgEzKSrGqIVgRQKh+iWAj/ZTg2U6zO 5DLIZr+iIhgtsmpw9nLMqUvvHmgSRV0QTFfqy7X3FqT/sB2Wql6U/yGdU1eiI4/DDC4K AUilIjxmOrV+Z8SfGno8ATCWp3I0k00tbBqmSkR1myhsQAT5Oa8gJSXGkLHBSaSwJQrn eU/wf328NC5Z29co8zCXZGxf8EylDwvenrlFbPUoFjoE9vqb56nhaUKu7xb31Qy6zq58 kJRjdLxM0+mY7pzOjmgQ4jciKHA9ADx/D0AQ5/f/QVA6OEnycOZkmXJgU/nQURK3ZrgA 8Asg== MIME-Version: 1.0 X-Received: by 10.58.15.193 with SMTP id z1mr14769405vec.40.1370108347632; Sat, 01 Jun 2013 10:39:07 -0700 (PDT) Received: by 10.220.119.2 with HTTP; Sat, 1 Jun 2013 10:39:07 -0700 (PDT) In-Reply-To: <201306011416.r51EGq41024554@svn.freebsd.org> References: <201306011416.r51EGq41024554@svn.freebsd.org> Date: Sat, 1 Jun 2013 10:39:07 -0700 Message-ID: Subject: Re: svn commit: r251225 - head/contrib/binutils/bfd From: Peter Wemm To: "Pedro F. Giffuni" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmkJCxvbJtJAVw1ME1FJ0WPDMk5KL8nPmQnXtjpDvNqbUpaRy+HR77Qnt/LacM5orquDdb3 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 17:39:14 -0000 FYI, this broke i386 builds. Please fix it. /scratch/src/gnu/usr.bin/binutils/libbfd/../../../../contrib/binutils/bfd/bfdio.c:389:1: error: conflicting types for 'bfd_get_mtime' bfd_get_mtime (bfd *abfd) ^ /scratch/src/gnu/usr.bin/binutils/libbfd/bfd.h:1150:6: note: previous declaration is here long bfd_get_mtime (bfd *abfd); ^ 1 error generated. On Sat, Jun 1, 2013 at 7:16 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jun 1 14:16:51 2013 > New Revision: 251225 > URL: http://svnweb.freebsd.org/changeset/base/251225 > > Log: > BFD: Use time_t instead of long for archive timestamps. > > This basically follows the suggestion in the binutils code and is more > in line with what BSD ar(1) does. > > Obtained from: OpenBSD > MFC after: 2 weeks. > > Modified: > head/contrib/binutils/bfd/archive.c > head/contrib/binutils/bfd/bfd-in2.h > head/contrib/binutils/bfd/bfdio.c > head/contrib/binutils/bfd/coff-rs6000.c > head/contrib/binutils/bfd/ecoff.c > head/contrib/binutils/bfd/libbfd-in.h > head/contrib/binutils/bfd/libbfd.h > > Modified: head/contrib/binutils/bfd/archive.c > ============================================================================== > --- head/contrib/binutils/bfd/archive.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/archive.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -1390,8 +1390,8 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, c > /* ar headers are space padded, not null padded! */ > memset (hdr, ' ', sizeof (struct ar_hdr)); > > - _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12ld", > - status.st_mtime); > + _bfd_ar_spacepad (hdr->ar_date, sizeof (hdr->ar_date), "%-12lld", > + (long long)status.st_mtime); > #ifdef HPUX_LARGE_AR_IDS > /* HP has a very "special" way to handle UID/GID's with numeric values > > 99999. */ > @@ -1458,6 +1458,11 @@ bfd_generic_stat_arch_elt (bfd *abfd, st > if (aloser == hdr->arelt) \ > return -1; > > +#define fooll(arelt, stelt, size) \ > + buf->stelt = strtoll (hdr->arelt, &aloser, size); \ > + if (aloser == hdr->arelt) \ > + return -1; > + > /* Some platforms support special notations for large IDs. */ > #ifdef HPUX_LARGE_AR_IDS > # define foo2(arelt, stelt, size) \ > @@ -1484,7 +1489,7 @@ bfd_generic_stat_arch_elt (bfd *abfd, st > # define foo2(arelt, stelt, size) foo (arelt, stelt, size) > #endif > > - foo (ar_date, st_mtime, 10); > + fooll (ar_date, st_mtime, 10); > foo2 (ar_uid, st_uid, 10); > foo2 (ar_gid, st_gid, 10); > foo (ar_mode, st_mode, 8); > > Modified: head/contrib/binutils/bfd/bfd-in2.h > ============================================================================== > --- head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/bfd-in2.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -38,6 +38,7 @@ extern "C" { > > #include "ansidecl.h" > #include "symcat.h" > +#include /* time_t */ > #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) > #ifndef SABER > /* This hack is to avoid a problem with some strict ANSI C preprocessors. > @@ -1141,7 +1142,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_se > > > /* Extracted from bfdio.c. */ > -long bfd_get_mtime (bfd *abfd); > +time_t bfd_get_mtime (bfd *abfd); > > file_ptr bfd_get_size (bfd *abfd); > > > Modified: head/contrib/binutils/bfd/bfdio.c > ============================================================================== > --- head/contrib/binutils/bfd/bfdio.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/bfdio.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -377,7 +377,7 @@ FUNCTION > bfd_get_mtime > > SYNOPSIS > - long bfd_get_mtime (bfd *abfd); > + time_t bfd_get_mtime (bfd *abfd); > > DESCRIPTION > Return the file modification time (as read from the file system, or > @@ -385,7 +385,7 @@ DESCRIPTION > > */ > > -long > +time_t > bfd_get_mtime (bfd *abfd) > { > struct stat buf; > > Modified: head/contrib/binutils/bfd/coff-rs6000.c > ============================================================================== > --- head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/coff-rs6000.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -1548,7 +1548,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) > { > struct xcoff_ar_hdr *hdrp = arch_xhdr (abfd); > > - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); > + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); > s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); > s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); > s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); > @@ -1558,7 +1558,7 @@ _bfd_xcoff_stat_arch_elt (abfd, s) > { > struct xcoff_ar_hdr_big *hdrp = arch_xhdr_big (abfd); > > - s->st_mtime = strtol (hdrp->date, (char **) NULL, 10); > + s->st_mtime = strtoll (hdrp->date, (char **) NULL, 10); > s->st_uid = strtol (hdrp->uid, (char **) NULL, 10); > s->st_gid = strtol (hdrp->gid, (char **) NULL, 10); > s->st_mode = strtol (hdrp->mode, (char **) NULL, 8); > @@ -1678,6 +1678,7 @@ xcoff_write_armap_old (abfd, elength, ma > static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; > #define FMT20 "%-20lld" > #define FMT12 "%-12d" > +#define FMT12_LL "%-12lld" > #define FMT12_OCTAL "%-12o" > #define FMT4 "%-4d" > #define PRINT20(d, v) \ > @@ -1688,6 +1689,10 @@ static char buff20[XCOFFARMAGBIG_ELEMENT > sprintf (buff20, FMT12, (int)(v)), \ > memcpy ((void *) (d), buff20, 12) > > +#define PRINT12_LL(d, v) \ > + sprintf (buff20, FMT12_LL, (long long)(v)), \ > + memcpy ((void *) (d), buff20, 12) > + > #define PRINT12_OCTAL(d, v) \ > sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ > memcpy ((void *) (d), buff20, 12) > @@ -2152,7 +2157,7 @@ xcoff_write_archive_contents_old (abfd) > } > > sprintf (ahdrp->size, "%ld", (long) s.st_size); > - sprintf (ahdrp->date, "%ld", (long) s.st_mtime); > + sprintf (ahdrp->date, "%lld", (long long) s.st_mtime); > sprintf (ahdrp->uid, "%ld", (long) s.st_uid); > sprintf (ahdrp->gid, "%ld", (long) s.st_gid); > sprintf (ahdrp->mode, "%o", (unsigned int) s.st_mode); > @@ -2388,7 +2393,7 @@ xcoff_write_archive_contents_big (abfd) > } > > PRINT20 (ahdrp->size, s.st_size); > - PRINT12 (ahdrp->date, s.st_mtime); > + PRINT12_LL (ahdrp->date, s.st_mtime); > PRINT12 (ahdrp->uid, s.st_uid); > PRINT12 (ahdrp->gid, s.st_gid); > PRINT12_OCTAL (ahdrp->mode, s.st_mode); > > Modified: head/contrib/binutils/bfd/ecoff.c > ============================================================================== > --- head/contrib/binutils/bfd/ecoff.c Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/ecoff.c Sat Jun 1 14:16:51 2013 (r251225) > @@ -3050,7 +3050,7 @@ _bfd_ecoff_write_armap (bfd *abfd, > linker just checks the archive name; the GNU linker may check the > date. */ > stat (abfd->filename, &statbuf); > - sprintf (hdr.ar_date, "%ld", (long) (statbuf.st_mtime + 60)); > + sprintf (hdr.ar_date, "%lld", (long long) (statbuf.st_mtime + 60)); > > /* The DECstation uses zeroes for the uid, gid and mode of the > armap. */ > > Modified: head/contrib/binutils/bfd/libbfd-in.h > ============================================================================== > --- head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/libbfd-in.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -71,8 +71,7 @@ struct artdata { > symindex symdef_count; /* how many there are */ > char *extended_names; /* clever intel extension */ > bfd_size_type extended_names_size; /* Size of extended names */ > - /* when more compilers are standard C, this can be a time_t */ > - long armap_timestamp; /* Timestamp value written into armap. > + time_t armap_timestamp; /* Timestamp value written into armap. > This is used for BSD archives to check > that the timestamp is recent enough > for the BSD linker to not complain, > > Modified: head/contrib/binutils/bfd/libbfd.h > ============================================================================== > --- head/contrib/binutils/bfd/libbfd.h Sat Jun 1 13:10:24 2013 (r251224) > +++ head/contrib/binutils/bfd/libbfd.h Sat Jun 1 14:16:51 2013 (r251225) > @@ -76,8 +76,7 @@ struct artdata { > symindex symdef_count; /* how many there are */ > char *extended_names; /* clever intel extension */ > bfd_size_type extended_names_size; /* Size of extended names */ > - /* when more compilers are standard C, this can be a time_t */ > - long armap_timestamp; /* Timestamp value written into armap. > + time_t armap_timestamp; /* Timestamp value written into armap. > This is used for BSD archives to check > that the timestamp is recent enough > for the BSD linker to not complain, -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV